yobx.sklearn.imblearn.rus_boost#

yobx.sklearn.imblearn.rus_boost.sklearn_rus_boost_classifier(g: GraphBuilderExtendedProtocol, sts: Dict, outputs: List[str], estimator: RUSBoostClassifier, X: str, name: str = 'rus_boost_classifier') str | Tuple[str, str][source]#

Converts an imblearn.ensemble.RUSBoostClassifier into ONNX.

RUSBoostClassifier is a boosting classifier that combines the SAMME algorithm with Random Under-Sampling (RUS). During training, each iteration applies random under-sampling to balance the class distribution before fitting the next base estimator. At inference time the resampling step is inactive; the resulting ensemble has exactly the same structure as a plain AdaBoostClassifier and is therefore converted using the same helper.

Graph structure (two base estimators as an example):

X ──[base est 0]──► label_0 (N,)
X ──[base est 1]──► label_1 (N,)
    label_i == classes_k ? w_i : -w_i/(C-1)  ──► vote_i (N, C)
                Add votes ──► decision (N, C)
            ArgMax(axis=1) ──Cast──Gather(classes_) ──► label
        decision/(C-1) ──Softmax ──► probabilities
Parameters:
  • g – the graph builder to add nodes to

  • sts – shapes and types defined by scikit-learn

  • outputs – desired output tensor names; two entries for (label, probabilities), one entry for label only

  • estimator – a fitted RUSBoostClassifier

  • X – name of the input tensor

  • name – prefix used for names of nodes added by this converter

Returns:

label tensor name, or tuple (label, probabilities)