qolmat.imputations.preprocessing.MixteHGBM¶
- class qolmat.imputations.preprocessing.MixteHGBM[source]¶
MixteHGBM class.
This is a custom scikit-learn estimator implementing a mixed model using HistGradientBoostingClassifier for string target data and HistGradientBoostingRegressor for numeric target data.
- fit(X: ndarray[tuple[int, ...], dtype[_ScalarType_co]], y: ndarray[tuple[int, ...], dtype[_ScalarType_co]]) MixteHGBM[source]¶
Fit the model according to the given training data.
- Parameters
- X{array-like, sparse matrix}, shape (n_samples, n_features)
Training vectors.
- yarray-like, shape (n_samples,)
Target values.
- Returns
- selfobject
Returns self.
- predict(X: ndarray[tuple[int, ...], dtype[_ScalarType_co]]) ndarray[tuple[int, ...], dtype[_ScalarType_co]][source]¶
Predict using the fitted model.
- Parameters
- X{array-like, sparse matrix}, shape (n_samples, n_features)
Samples.
- Returns
- y_predarray-like, shape (n_samples,)
Predicted target values.
- set_model_parameters(**args_model)[source]¶
Set the arguments of the underlying model.
- Parameters
- **args_modeldict
Additional keyword arguments to be passed to the underlying models.
- set_score_request(*, sample_weight: Union[bool, None, str] = '$UNCHANGED$') MixteHGBM¶
Configure whether metadata should be requested to be passed to the
scoremethod.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True(seesklearn.set_config()). Please check the User Guide on how the routing mechanism works.The options for each parameter are:
True: metadata is requested, and passed toscoreif provided. The request is ignored if metadata is not provided.False: metadata is not requested and the meta-estimator will not pass it toscore.None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.New in version 1.3.
- Parameters
- sample_weightstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED
Metadata routing for
sample_weightparameter inscore.
- Returns
- selfobject
The updated object.