facet.selection.base.CandidateEstimatorDF#
- class facet.selection.base.CandidateEstimatorDF(candidate=None, candidate_name=None)[source]#
A trivial wrapper for classifiers, regressors and transformers, acting like a pipeline with a single step.
Used in conjunction with
MultiEstimatorParameterSpace
to evaluate multiple competing models: thecandidate
parameter determines the estimator to be used and is used to include multiple estimators as part of the parameter space that is searched during model tuning.- Bases
- Metaclasses
- Parameters
candidate (
Union
[ClassifierDF
,RegressorDF
,TransformerDF
,None
]) – the current estimator candidate; usually not specified on class creation but set as a parameter during multi-estimator model selectioncandidate_name (
Optional
[str
]) – a name for the estimator candidate; usually not specified on class creation but set as a parameter during multi-estimator model selection
Method summary
Compute the decision function for the given inputs.
Fit this estimator using the given inputs.
Inverse-transform the given inputs.
Predict outputs for the given inputs.
Predict class log-probabilities for the given inputs.
Predict class probabilities for the given inputs.
Score this learner using the given inputs and outputs.
See
sklearn.utils.set_output()
Transform the given inputs.
Attribute summary
COL_FEATURE
Name assigned to an
Index
or aSeries
with the names of the features used to fit aEstimatorDF
.COL_FEATURE_ORIGINAL
Name assigned to a
Series
with the original feature names before transformation.name of the candidate parameter
name of the candidate_name parameter
True
if this object is fitted,False
otherwise.The currently selected estimator candidate.
The name of the candidate, used for more readable summary reports of model tuning results.
Definitions
- clone()#
- decision_function(X, **predict_params)[source]#
Compute the decision function for the given inputs.
The inputs must have the same features as the inputs used to fit this learner. The features can be provided in any order since they are identified by their column names.
- Parameters
- Return type
- Returns
a data frame with observations as rows and classes as columns, and values as the raw values predicted per observation and class; for multi-output classifiers, a list of one observation/class data frames per output
- fit(X, y=None, **fit_params)[source]#
Fit this estimator using the given inputs.
- Parameters
- Return type
- Returns
self
- fit_transform(X, y=None, **fit_params)#
- get_params(deep=True)#
- inverse_transform(X)[source]#
Inverse-transform the given inputs.
The inputs must have the same features as the inputs used to fit this transformer. The features can be provided in any order since they are identified by their column names.
- predict(X, **predict_params)[source]#
Predict outputs for the given inputs.
The inputs must have the same features as the inputs used to fit this learner. The features can be provided in any order since they are identified by their column names.
- Parameters
- Return type
- Returns
predictions per observation as a series, or as a data frame in case of multiple outputs
- predict_log_proba(X, **predict_params)[source]#
Predict class log-probabilities for the given inputs.
The inputs must have the same features as the inputs used to fit this learner. The features can be provided in any order since they are identified by their column names.
- Parameters
- Return type
- Returns
a data frame with observations as rows and classes as columns, and values as log-probabilities per observation and class; for multi-output classifiers, a list of one observation/class data frames per output
- predict_proba(X, **predict_params)[source]#
Predict class probabilities for the given inputs.
The inputs must have the same features as the inputs used to fit this learner. The features can be provided in any order since they are identified by their column names.
- Parameters
- Return type
- Returns
a data frame with observations as rows and classes as columns, and values as probabilities per observation and class; for multi-output classifiers, a list of one observation/class data frames per output
- score(X, y, sample_weight=None)[source]#
Score this learner using the given inputs and outputs.
- Parameters
X (
Union
[Series
,DataFrame
]) – data frame with observations as rows and features as columnsy (
Series
) – a series or data frame with the true outputs per observationsample_weight (
Optional
[Series
]) – optional series of scalar weights, for calculating the resulting score as the weighted mean of the scores for the individual predictions
- Return type
- Returns
the score
- set_output(*, transform=None)#
See
sklearn.utils.set_output()
- set_params(**params)#
- to_expression()#
- transform(X)[source]#
Transform the given inputs.
The inputs must have the same features as the inputs used to fit this transformer. The features can be provided in any order since they are identified by their column names.
- PARAM_CANDIDATE = 'candidate'#
name of the candidate parameter
- PARAM_CANDIDATE_NAME = 'candidate_name'#
name of the candidate_name parameter
- candidate: Optional[Union[sklearndf.ClassifierDF, sklearndf.RegressorDF, sklearndf.TransformerDF]]#
The currently selected estimator candidate.
- candidate_name: Optional[str]#
The name of the candidate, used for more readable summary reports of model tuning results.
- property classes_: Union[numpy.ndarray[Any, numpy.dtype[Any]], List[numpy.ndarray[Any, numpy.dtype[Any]]]]#
- property feature_names_in_: pandas.Index#
- property feature_names_original_: pandas.Series#
- property feature_names_out_: pandas.Index#
- property native_estimator: sklearn.base.BaseEstimator#