nemos.regularizer.UnRegularized#

class nemos.regularizer.UnRegularized[source]#

Bases: Regularizer

Regularizer class for unregularized models.

This class equips models with the identity proximal operator (no shrinkage) and the unpenalized loss function.

Attributes

__init__()[source]#

Methods

__init__()

check_solver(solver_name)

Raise an error if the given solver is not allowed.

get_metadata_routing()

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}_request methods.

This uses PEP-487 [1] to set the set_{method}_request methods. 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 default None.

References

property allowed_solvers: Tuple[str]#
check_solver(solver_name)#

Raise an error if the given solver is not allowed.

Parameters:

solver_name (str)

property default_solver: str#
get_metadata_routing()#

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Returns:

routing – A MetadataRequest encapsulating 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:

dict

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.

Parameters:

init_params

Return type:

Callable[[Any, float, float], Tuple[Array, Array]]

penalized_loss(loss, strength, init_params)#

Return a function for calculating the penalized loss using Lasso regularization.

Return type:

Callable

Parameters:
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