nemos.regularizer.UnRegularized#
- class nemos.regularizer.UnRegularized[source]#
Bases:
RegularizerRegularizer class for unregularized models.
This class equips models with the identity proximal operator (no shrinkage) and the unpenalized loss function.
Attributes
Methods
__init__()check_solver(solver_name)Raise an error if the given solver is not allowed.
Get metadata routing of this object.
get_params([deep])From scikit-learn, get parameters by inspecting init.
get_proximal_operator([init_params])Return the identity operator.
penalized_loss(loss, strength, init_params)Return a function for calculating the penalized loss using Lasso regularization.
set_params(**params)Set the parameters of this estimator.
- classmethod __init_subclass__(**kwargs)#
Set the
set_{method}_requestmethods.This uses PEP-487 [1] to set the
set_{method}_requestmethods. It looks for the information available in the set default values which are set using__metadata_request__*class attributes, or inferred from method signatures.The
__metadata_request__*class attributes are used when a method does not explicitly accept a metadata through its arguments or if the developer would like to specify a request value for those metadata which are different from the defaultNone.References
- check_solver(solver_name)#
Raise an error if the given solver is not allowed.
- Parameters:
solver_name (str)
- get_metadata_routing()#
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
routing – A
MetadataRequestencapsulating routing information.- Return type:
MetadataRequest
- get_params(deep=True)#
From scikit-learn, get parameters by inspecting init.
- Parameters:
deep – If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Return type:
- Returns:
A dictionary containing the parameters. Key is the parameter name, value is the parameter value.
- get_proximal_operator(init_params=None)[source]#
Return the identity operator.
Unregularized method corresponds to an identity proximal operator, since no shrinkage factor is applied.
- penalized_loss(loss, strength, init_params)#
Return a function for calculating the penalized loss using Lasso regularization.
- 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:
**params (dict) – Estimator parameters.
- Returns:
self – Estimator instance.
- Return type:
estimator instance