NormodMetaregLS#

class sknormod.metareg.NormodMetaregLS(fit_scale=False)#

Methods

fit(X, y[, X_scale, y_se])

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

predict_distr_p(X, p)

Predict the percentiles of the distribution.

predict_distr_params(X)

score(X, y)

Compute the logarithmic score of the predicted distribution parameters against the true values.

set_fit_request(*[, X_scale, y_se])

Request metadata passed to the fit method.

set_params(**params)

Set the parameters of this estimator.

transform_to_p(X, y)

Transform the target values to percentiles.

transform_to_z(X, y)

Transform the target values to z-scores.

get_metadata_routing()#

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Returns:
routingMetadataRequest

A MetadataRequest encapsulating routing information.

get_params(deep=True)#

Get parameters for this estimator.

Parameters:
deepbool, default=True

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:
paramsdict

Parameter names mapped to their values.

predict_distr_p(X, p)#

Predict the percentiles of the distribution.

Parameters:
Xarray-like or sparse matrix of shape (n_samples, n_features)

The input samples.

parray-like of shape (n_percentiles,)

The percentiles to predict.

Returns:
percentileslist of floats

The predicted percentiles.

score(X, y)#

Compute the logarithmic score of the predicted distribution parameters against the true values.

set_fit_request(*, X_scale: bool | None | str = '$UNCHANGED$', y_se: bool | None | str = '$UNCHANGED$') NormodMetaregLS#

Request metadata passed to the fit method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to fit if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to fit.

  • 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.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:
X_scalestr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED

Metadata routing for X_scale parameter in fit.

y_sestr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED

Metadata routing for y_se parameter in fit.

Returns:
selfobject

The updated object.

set_params(**params)#

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters:
**paramsdict

Estimator parameters.

Returns:
selfestimator instance

Estimator instance.

transform_to_p(X, y)#

Transform the target values to percentiles.

transform_to_z(X, y)#

Transform the target values to z-scores.

Examples using sknormod.metareg.NormodMetaregLS#

Meta-regression

Meta-regression