facet.selection.base.BaseParameterSpace#

class facet.selection.base.BaseParameterSpace(estimator)[source]#

A collection of parameters spanning a parameter space for hyperparameter optimization.

Bases

HasExpressionRepr

Generic types

+T_Estimator(bound= EstimatorDF, __covariant__=True)

Metaclasses

ABCMeta

Parameters

estimator (BaseParameterSpace) – the estimator for which to specify parameter choices or distributions

Method summary

get_parameters

Generate a dictionary of parameter choices and distributions, or a list of such dictionaries, compatible with scikit-learn's CV search API (e.g., GridSearchCV or RandomizedSearchCV).

to_expression

See pytools.expression.HasExpressionRepr.to_expression()

Attribute summary

estimator

The estimator associated with this parameter space.

parameters

The parameter choices (as lists) or distributions (from scipy.stats) that constitute this parameter space.

Definitions

abstract get_parameters(prefix=None)[source]#

Generate a dictionary of parameter choices and distributions, or a list of such dictionaries, compatible with scikit-learn’s CV search API (e.g., GridSearchCV or RandomizedSearchCV).

Parameters

prefix (Optional[str]) – an optional prefix to prepend to all parameter names in the resulting dictionary, separated by two underscore characters (__) as per scikit-learn’s convention for hierarchical parameter names

Return type

Union[List[Dict[str, Union[List[Any], rv_continuous, rv_discrete]]], Dict[str, Union[List[Any], rv_continuous, rv_discrete]]]

Returns

one or more dictionaries, each mapping parameter names to parameter choices (as lists) or distributions (from scipy.stats)

abstract to_expression()#

See pytools.expression.HasExpressionRepr.to_expression()

property estimator: T_Estimator#

The estimator associated with this parameter space.

Return type

TypeVar(T_Estimator, bound= EstimatorDF, covariant=True)

property parameters: Union[List[Dict[str, Union[List[Any], scipy.stats.rv_continuous, scipy.stats.rv_discrete]]], Dict[str, Union[List[Any], scipy.stats.rv_continuous, scipy.stats.rv_discrete]]]#

The parameter choices (as lists) or distributions (from scipy.stats) that constitute this parameter space.

This is a shortcut for calling method get_parameters() with no arguments.

Return type

Union[List[Dict[str, Union[List[Any], rv_continuous, rv_discrete]]], Dict[str, Union[List[Any], rv_continuous, rv_discrete]]]