lale.lib.sklearn.dummy_regressor module¶
- class lale.lib.sklearn.dummy_regressor.DummyRegressor(*, strategy='mean', constant=None, quantile=None)¶
Bases:
PlannedIndividualOp
Dummy regressor regressor that makes predictions using simple rules.
This documentation is auto-generated from JSON schemas.
- Parameters
strategy (union type, not for optimizer, default 'mean') –
Strategy to use to generate predictions.
’mean’
Always predicts the mean of the training set.
or ‘median’
Always predicts the median of the training set.
or ‘quantile’, not for optimizer
Always predicts a specified quantile of the training set, provided with the quantile parameter.
or ‘constant’, not for optimizer
Always predicts a constant label that is provided by the user. This is useful for metrics that evaluate a non-majority class
See also constraint-1, constraint-2.
constant (union type, optional, not for optimizer, default None) –
The explicit constant as predicted by the “constant” strategy. This parameter is useful only for the “constant” strategy.
float
or None
See also constraint-1.
quantile (union type, not for optimizer, default None) –
The quantile to predict using the “quantile” strategy. A quantile of 0.5 corresponds to the median, while 0.0 to the minimum and 1.0 to the maximum.
None
or float, >=0.0, <=1.0
See also constraint-2.
Notes
constraint-1 : union type
The constant strategy requires a non-None value for the constant hyperparameter.
strategy : negated type of ‘constant’
or constant : negated type of None
constraint-2 : union type
The quantile strategy requires a non-None value for the quantile hyperparameter.
strategy : negated type of ‘quantile’
or quantile : negated type of 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) – Features; the outer array is over samples.
y (array of items : float) – Target values.
- 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, optional of items : array of items : Any) – Features; the outer array is over samples.
- Returns
result – Predicted values per sample.
- Return type
array of items : float