piml.models
.GLMRegressor¶
- class piml.models.GLMRegressor(feature_names=None, feature_types=None, l1_regularization=0, l2_regularization=0, fit_intercept=True, random_state=0)¶
A wrapper of generalized linear model regressor in scikit-learn.
- Parameters:
- feature_nameslist or None, default=None
The list of feature names.
- feature_typeslist or None, default=None
The list of feature types. Available types include “numerical” and “categorical”.
- l1_regularization: float, default=0
The strength of l1 regularization, l1_regularization must be non-negative float.
{l1_regularization=0 & l2_regularization=0}: Ordinary least squares Linear Regression.
{l1_regularization>0 & l2_regularization=0}: Lasso Regression.
{l1_regularization=0 & l2_regularization>0}: Ridge Regression.
{l1_regularization>0 & l2_regularization>0}: Elasticnet Regression.
- l2_regularization: float, default=0
The strength of l2 regularization, l2_regularization must be non-negative float.
{l1_regularization=0 & l2_regularization=0}: Ordinary least squares Linear Regression.
{l1_regularization>0 & l2_regularization=0}: Lasso Regression.
{l1_regularization=0 & l2_regularization>0}: Ridge Regression.
{l1_regularization>0 & l2_regularization>0}: Elasticnet Regression.
- fit_interceptbool, default=True
Whether to fit intercept.
- random_stateint, default=0
Random state of model.
- Attributes:
- feature_names_list of str
The feature name list of all input features.
- feature_types_list of str
The feature type list of all input features.
Methods
Get metadata routing of this object.
get_params
([deep])Get parameters for this estimator.
set_params
- 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.
- set_params(**parameters)¶
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.
Examples using piml.models.GLMRegressor
¶
GLM Linear Regression (Bike Sharing)