StackingClassifier

class falcon.tabular.models.StackingClassifier(estimators: List[Tuple[str, BaseEstimator]], final_estimator: BaseEstimator, balanced: bool = True, cv: Any = 5, n_jobs: int = 1, passthrough: bool = False, verbose: int = 0, stack_method: Any = 'auto', **kwargs: Any)

Small wrapper around sklearn.ensemble.StackingClassifier.

__init__(estimators: List[Tuple[str, BaseEstimator]], final_estimator: BaseEstimator, balanced: bool = True, cv: Any = 5, n_jobs: int = 1, passthrough: bool = False, verbose: int = 0, stack_method: Any = 'auto', **kwargs: Any) None

Small wrapper around sklearn.ensemble.StackingClassifier. For more detailed description please refer to sklarn documentation.

Parameters
  • estimators (List[Tuple[str, BaseEstimator]]) – base estimators

  • final_estimator (BaseEstimator) – meta estimator, by default LogisticRegression

  • balanced (bool, optional) – if True, the classes are balanced by performing random oversampling, by default True

  • cv (Any, optional) – number of CV folds, or custom CV object, by default 5

  • n_jobs (int, optional) – number of parallel jobs, by default -1

  • passthrough (bool, optional) – when True the meta estimator is trained on original data in addition to the predictions of base estimators, by default False

  • verbose (int, optional) – verbosity level of underlying sklearn estimator, by default 0

  • stack_method (Any, optional) – methods called for each base estimator, by default “auto”

fit(X: ndarray[Any, dtype[float32]], y: ndarray[Any, dtype[float32]], *args: Any, **kwargs: Any) None

Fits the model

Parameters
  • X (Float32Array) – Features

  • y (Float32Array) – targets

predict(X: ndarray[Any, dtype[float32]], *args: Any, **kwargs: Any) ndarray[Any, dtype[float32]]

Predicts the target for the given input

Parameters

X (Float32Array) – featrues

Returns

predictions

Return type

Float32Array

to_onnx() SerializedModelRepr

Serializes the model to onnx.

Return type

SerializedModelRepr