lale.lib.sklearn.bagging_regressor module

class lale.lib.sklearn.bagging_regressor.BaggingRegressor(*, n_estimators=10, max_samples=1.0, max_features=1.0, bootstrap=True, bootstrap_features=False, oob_score=False, warm_start=False, n_jobs=None, random_state=None, verbose=0, estimator=None)

Bases: PlannedIndividualOp

Bagging classifier from scikit-learn for bagging ensemble.

This documentation is auto-generated from JSON schemas.

Parameters
  • n_estimators (integer, >=10 for optimizer, <=100 for optimizer, uniform distribution, default 10) – The number of base estimators in the ensemble.

  • max_samples (union type, not for optimizer, default 1.0) –

    The number of samples to draw from X to train each base estimator.

    • integer, >=2, <=’X/maxItems’, not for optimizer

      Draw max_samples samples.

    • or float, >0.0, <=1.0

      Draw max_samples * X.shape[0] samples.

  • max_features (union type, not for optimizer, default 1.0) –

    The number of features to draw from X to train each base estimator.

    • integer, >=2, <=’X/items/maxItems’, not for optimizer

      Draw max_features features.

    • or float, >0.0, <=1.0

      Draw max_samples * X.shape[1] features.

  • bootstrap (boolean, default True) –

    Whether samples are drawn with (True) or without (False) replacement.

    See also constraint-1.

  • bootstrap_features (boolean, not for optimizer, default False) – Whether features are drawn with (True) or wrhout (False) replacement.

  • oob_score (boolean, not for optimizer, default False) –

    Whether to use out-of-bag samples to estimate the generalization error.

    See also constraint-1, constraint-2.

  • warm_start (boolean, not for optimizer, default False) –

    When set to True, reuse the solution of the previous call to fit and add more estimators to the ensemble, otherwise, just fit a whole new ensemble.

    See also constraint-2.

  • n_jobs (union type, not for optimizer, default None) –

    The number of jobs to run in parallel for both fit and predict.

    • None

      1 unless in joblib.parallel_backend context.

    • or -1

      Use all processors.

    • or integer, >=1

      Number of CPU cores.

  • random_state (union type, not for optimizer, default None) –

    If int, random_state is the seed used by the random number generator;

    • integer

    • or numpy.random.RandomState

    • or None

  • verbose (integer, not for optimizer, default 0) – Controls the verbosity when fitting and predicting.

  • estimator (union type, optional, not for optimizer, default None) –

    The base estimator to fit on random subsets of the dataset.

    • operator

    • or None

      DecisionTreeClassifier

    See also constraint-3.

Notes

constraint-1 : union type

Out of bag estimation only available if bootstrap=True

  • bootstrap : True

  • or oob_score : False

constraint-2 : union type

Out of bag estimate only available if warm_start=False

  • warm_start : False

  • or oob_score : False

constraint-3 : union type

Only estimator or base_estimator should be specified. As base_estimator is deprecated, use estimator.

  • base_estimator : False or ‘deprecated’

  • or estimator : None

fit(X, y=None, **fit_params)

Train the operator.

Note: The fit method is not available until this operator is trainable.

Once this method is available, it will have the following signature:

Parameters
  • X (array of items : array of items : float) – The training input samples. Sparse matrices are accepted only if they are supported by the base estimator.

  • y (array of items : float) – The target values (class labels in classification, real numbers in regression)

  • sample_weight (union type, optional) –

    Sample weights. Supported only if the base estimator supports sample weighting.

    • array of items : float

    • or None

      Samples are equally weighted.

predict(X, **predict_params)

Make predictions.

Note: The predict method is not available until this operator is trained.

Once this method is available, it will have the following signature:

Parameters

X (array of items : array of items : float) –

Returns

result

Return type

array of items : float