howso.scikit#
Classes
This class is intended for use within scikit-learn only. |
|
A HowsoEstimator for regression analysis. |
|
A HowsoEstimator for classification analysis. |
The Python API for the Howso Scikit Client.
- class howso.scikit.HowsoClassifier(client=None, features=None, targets=None, verbose=False, debug=False, ttl=43200000, client_params=None, trainee_params=None)#
Bases:
HowsoEstimator
A HowsoEstimator for classification analysis.
- Parameters:
features (
Dict
|None
, default:None
) –The features that will predict the targets(s). Will be generated automatically if not specified.
Example:
{ "feature_name": { "parameter1" : "value1", "parameter2" : "value2" }, "length": { "type" : "continuous", "decimal_places": 1 }, "width": { "type" : "continuous", "significant_digits": 4 }, "degrees": { "type" : "continuous", "cycle_length": 360 }, "class": { "type" : "nominal" } }
targets (
Dict
|None
, default:None
) –The target(s) to be predicted. Will be generated automatically if not specified.
Example:
{ "target_name": { "parameter1" : "value1", "parameter2" : "value2" }, "klass": { "type" : "nominal" } }
client (
AbstractHowsoClient
|None
, default:None
) – A subclass of AbstractHowsoClient used to interface with Howso.verbose (
bool
, default:False
) – A flag for verbose output.debug (
bool
, default:False
) – A flag for debug output.ttl (
int
, default:43200000
) – The maximum time a server should maintain a connection open for a trainee when processing requests.client_params (
Dict
|None
, default:None
) – The parameters with which to instantiate the client.trainee_params (
Dict
|None
, default:None
) – The parameters with which to instantiate the client. Intended for use by HowsoEstimator.get_params.
- fit(X, y, analyze=True)#
Fit a model with Howso.
- Parameters:
X (
ndarray
) – Datay (
ndarray
) – Target. Will be cast to X’s dtype if necessaryanalyze (
bool
, default:True
) –(Optional) If trainee should be analyzed.
a user may plan to call analyze themselves after fit() to specify parameters
- Returns:
self
- load(trainee_id)#
Load the trainee and re-populates the classes_ variable.
This is based on the available classes in the loaded trainee.
- Parameters:
trainee_id (
str
) – The id of the trainee.
- partial_fit(X, y)#
Adds data to an existing Howso model.
- Parameters:
X (
ndarray
) – Datay (
ndarray
) – Target. Will be cast to X’s dtype if necessary
- predict_proba(X)#
Probability estimates.
The returned estimates for all classes are ordered by the label of classes.
For a multi_class problem, if multi_class is set to be “multinomial” the softmax function is used to find the predicted probability of each class. Else use a one-vs-rest approach, i.e calculate the probability of each class assuming it to be positive using the logistic function and normalize these values across all the classes.
NOTE: Only works with single target models at this time.
- Parameters:
X (
ndarray
) – Data- Returns:
The probabilities of the classes for the given prediction.
- Return type:
ndarray
- set_fit_request(*, analyze='$UNCHANGED$')#
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
analyze (bool | None | str) – Metadata routing for
analyze
parameter infit
.self (HowsoClassifier)
- Returns:
self – The updated object.
- Return type:
- class howso.scikit.HowsoEstimator(client=None, features=None, targets=None, method=None, verbose=False, debug=False, ttl=43200000, trainee_params=None, client_params=None)#
Bases:
BaseEstimator
This class is intended for use within scikit-learn only.
This Estimator follows scikit-learn’s conventions. For access to a wider range of Howso capabilities, please use the client specified in the howso.client module.
- Parameters:
features (
Dict
|None
, default:None
) –The features that will predict the targets(s). Will be generated automatically if not specified.
Example:
{ "feature_name": { "parameter1" : "value1", "parameter2" : "value2" }, "length": { "type" : "continuous", "decimal_places": 1 }, "width": { "type" : "continuous", "significant_digits": 4 }, "degrees": { "type" : "continuous", "cycle_length": 360 }, "class": { "type" : "nominal" } }
targets (
Dict
, default:None
) –The target(s) to be predicted. Will be generated automatically if not specified.
Example:
{ "`target_name`": { "parameter1" : "value1", "parameter2" : "value2" }, "klass": { "type" : "nominal" } }
client (
AbstractHowsoClient
|None
, default:None
) – A subclass of AbstractHowsoClient used to interface with Howso.method (
str
|None
, default:None
) – One of ‘classification’ or ‘regression’.verbose (
bool
, default:False
) – A flag for verbose output.debug (
bool
, default:False
) – A flag for debug output.ttl (
int
, default:43200000
) – The maximum time a server should maintain a connection open for a trainee when processing requests.client_params (
Dict
|None
, default:None
) – The parameters with which to instantiate the client.trainee_params (
Dict
|None
, default:None
) – The parameters with which to instantiate the trainee.
Examples
>>> import pandas as pd >>> from howso.scikit import HowsoClassifier >>> from sklearn.model_selection import train_test_split >>> # Read in the data. >>> df = pd.read_csv('iris.csv') >>> >>> # Split the dataset into the feature (X) and targets (y) and convert >>> # the string targets into integer hashes. >>> X = df.drop('class', axis=1).values.astype(float) >>> y = df['class'].apply(hash).values.astype(int) >>> >>> # Split the dataset into an 80/20 train/test set. >>> X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, shuffle=True, random_state=1) >>> >>> # Create a classifier. >>> howso = HowsoClassifier() >>> >>> # Fit the training data. >>> howso.fit(X_train, y_train) >>> >>> # Test against the reserved test data. >>> score = howso.score(X_test, y_test) >>> >>> # Print the resulting accuracy. >>> print(score) 0.9666666666666667
- analyze(seed=None, **kwargs)#
Analyze a trainee.
- Parameters:
seed – A random seed.
**kwargs – Refer to docstring in howso.client.analyze method for complete reference of all parameters
- delete()#
Delete this trainee from the howso cloud service.
- describe_prediction(X, details=None)#
Describe a prediction in detail.
- Parameters:
X – Feature values.
details –
(Optional) If details are specified, the response will contain the requested explanation data along with the reaction. Below are the valid keys and data types for the different audit details. Omitted keys, values set to None, or False values for Booleans will not be included in the audit data returned.
- boundary_casesbool, optional
If True, outputs an automatically determined (when ‘num_boundary_cases’ is not specified) relevant number of boundary cases. Uses both context and action features of the reacted case to determine the counterfactual boundary based on action features, which maximize the dissimilarity of action features while maximizing the similarity of context features. If action features aren’t specified, uses familiarity conviction to determine the boundary instead.
- boundary_cases_familiarity_convictionsbool, optional
If True, outputs familiarity conviction of addition for each of the boundary cases.
- case_contributions_fullbool, optional
If true outputs each influential case’s differences between the predicted action feature value and the predicted action feature value if each individual case were not included. Uses only the context features of the reacted case to determine that area. Uses full calculations, which uses leave-one-out for cases for computations.
- case_contributions_robustbool, optional
If true outputs each influential case’s differences between the predicted action feature value and the predicted action feature value if each individual case were not included. Uses only the context features of the reacted case to determine that area. Uses robust calculations, which uses uniform sampling from the power set of all combinations of cases.
- case_feature_residuals_fullbool, optional
If True, outputs feature residuals for all (context and action) features for just the specified case. Uses leave-one-out for each feature, while using the others to predict the left out feature with their corresponding values from this case. Uses full calculations, which uses leave-one-out for cases for computations.
- case_feature_residuals_robustbool, optional
If True, outputs feature residuals for all (context and action) features for just the specified case. Uses leave-one-out for each feature, while using the others to predict the left out feature with their corresponding values from this case. Uses robust calculations, which uses uniform sampling from the power set of features as the contexts for predictions.
- case_mda_robustbool, optional
If True, outputs each influential case’s mean decrease in accuracy of predicting the action feature in the local model area, as if each individual case were included versus not included. Uses only the context features of the reacted case to determine that area. Uses robust calculations, which uses uniform sampling from the power set of all combinations of cases.
- case_mda_fullbool, optional
If True, outputs each influential case’s mean decrease in accuracy of predicting the action feature in the local model area, as if each individual case were included versus not included. Uses only the context features of the reacted case to determine that area. Uses full calculations, which uses leave-one-out for cases for computations.
- categorical_action_probabilitiesbool, optional
If True, outputs probabilities for each class for the action. Applicable only to categorical action features.
- derivation_parametersbool, optional
If True, outputs a dictionary of the parameters used in the react call. These include k, p, distance_transform, feature_weights, feature_deviations, nominal_class_counts, and use_irw.
k: the number of cases used for the local model.
p: the parameter for the Lebesgue space.
distance_transform: the distance transform used as an exponent to convert distances to raw influence weights.
feature_weights: the weight for each feature used in the distance metric.
feature_deviations: the deviation for each feature used in the distance metric.
nominal_class_counts: the number of unique values for each nominal feature. This is used in the distance metric.
use_irw: a flag indicating if feature weights were derived using inverse residual weighting.
- distance_contributionbool, optional
If True, outputs the distance contribution (expected total surprisal contribution) for the reacted case. Uses both context and action feature values.
- distance_ratiobool, optional
If True, outputs the ratio of distance (relative surprisal) between this reacted case and its nearest case to the minimum distance (relative surprisal) in between the closest two cases in the local area. All distances are computed using only the specified context features.
- feature_contributions_robustbool, optional
If True outputs each context feature’s absolute and directional differences between the predicted action feature value and the predicted action feature value if each context were not in the model for all context features in the local model area Uses robust calculations, which uses uniform sampling from the power set of features as the contexts for predictions. Directional feature contributions are returned under the key ‘directional_feature_contributions_robust’.
- feature_contributions_fullbool, optional
If True outputs each context feature’s absolute and directional differences between the predicted action feature value and the predicted action feature value if each context were not in the model for all context features in the local model area. Uses full calculations, which uses leave-one-out for cases for computations. Directional feature contributions are returned under the key ‘directional_feature_contributions_full’.
- case_feature_contributions_robust: bool, optional
If True outputs each context feature’s absolute and directional differences between the predicted action feature value and the predicted action feature value if each context feature were not in the model for all context features in this case, using only the values from this specific case. Uses robust calculations, which uses uniform sampling from the power set of features as the contexts for predictions. Directional case feature contributions are returned under the ‘case_directional_feature_contributions_robust’ key.
- case_feature_contributions_full: bool, optional
If True outputs each context feature’s absolute and directional differences between the predicted action feature value and the predicted action feature value if each context feature were not in the model for all context features in this case, using only the values from this specific case. Uses full calculations, which uses leave-one-out for cases for computations. Directional case feature contributions are returned under the ‘case_directional_feature_contributions_full’ key.
- feature_mda_robustbool, optional
If True, outputs each context feature’s mean decrease in accuracy of predicting the action feature given the context. Uses only the context features of the reacted case to determine that area. Uses robust calculations, which uses uniform sampling from the power set of features as the contexts for predictions.
- feature_mda_fullbool, optional
If True, outputs each context feature’s mean decrease in accuracy of predicting the action feature given the context. Uses only the context features of the reacted case to determine that area. Uses full calculations, which uses leave-one-out for cases for computations.
- feature_mda_ex_post_robustbool, optional
If True, outputs each context feature’s mean decrease in accuracy of predicting the action feature as an explanation detail given that the specified prediction was already made as specified by the action value. Uses both context and action features of the reacted case to determine that area. Uses robust calculations, which uses uniform sampling from the power set of features as the contexts for predictions.
- feature_mda_ex_post_fullbool, optional
If True, outputs each context feature’s mean decrease in accuracy of predicting the action feature as an explanation detail given that the specified prediction was already made as specified by the action value. Uses both context and action features of the reacted case to determine that area. Uses full calculations, which uses leave-one-out for cases for computations.
- featureslist of str, optional
A list of feature names that specifies for what features will per-feature details be computed (residuals, contributions, mda, etc.). This should generally preserve compute, but will not when computing details robustly. Details will be computed for all context and action features if this value is not specified.
- feature_residual_robustbool, optional
If True, outputs feature residuals for all (context and action) features locally around the prediction. Uses only the context features of the reacted case to determine that area. Uses robust calculations, which uses uniform sampling from the power set of features as the contexts for predictions.
- feature_residuals_fullbool, optional
If True, outputs feature residuals for all (context and action) features locally around the prediction. Uses only the context features of the reacted case to determine that area. Uses full calculations, which uses leave-one-out for cases for computations.
- hypothetical_valuesdict, optional
A dictionary of feature name to feature value. If specified, shows how a prediction could change in a what-if scenario where the influential cases’ context feature values are replaced with the specified values. Iterates over all influential cases, predicting the action features each one using the updated hypothetical values. Outputs the predicted arithmetic over the influential cases for each action feature.
- influential_casesbool, optional
If True, outputs the most influential cases and their influence weights based on the surprisal of each case relative to the context being predicted among the cases. Uses only the context features of the reacted case.
- influential_cases_familiarity_convictionsbool, optional
If True, outputs familiarity conviction of addition for each of the influential cases.
- influential_cases_raw_weightsbool, optional
If True, outputs the surprisal for each of the influential cases.
- case_feature_residual_convictions_robustbool, optional
If True, outputs this case’s feature residual convictions for the region around the prediction. Uses only the context features of the reacted case to determine that region. Computed as: region feature residual divided by case feature residual. Uses robust calculations, which uses uniform sampling from the power set of features as the contexts for predictions.
- case_feature_residual_convictions_fullbool, optional
If True, outputs this case’s feature residual convictions for the region around the prediction. Uses only the context features of the reacted case to determine that region. Computed as: region feature residual divided by case feature residual. Uses full calculations, which uses leave-one-out for cases for computations.
- most_similar_casesbool, optional
If True, outputs an automatically determined (when ‘num_most_similar_cases’ is not specified) relevant number of similar cases, which will first include the influential cases. Uses only the context features of the reacted case.
- num_boundary_casesint, optional
Outputs this manually specified number of boundary cases.
- num_most_similar_casesint, optional
Outputs this manually specified number of most similar cases, which will first include the influential cases.
- num_most_similar_case_indicesint, optional
Outputs this specified number of most similar case indices when ‘distance_ratio’ is also set to True.
- num_robust_influence_samples_per_caseint, optional
Specifies the number of robust samples to use for each case. Applicable only for computing robust feature contributions or robust case feature contributions. Defaults to 2000. Higher values will take longer but provide more stable results.
- observational_errorsbool, optional
If True, outputs observational errors for all features as defined in feature attributes.
- outlying_feature_valuesbool, optional
If True, outputs the reacted case’s context feature values that are outside the min or max of the corresponding feature values of all the cases in the local model area. Uses only the context features of the reacted case to determine that area.
- prediction_statsbool, optional
When true outputs feature prediction stats for all (context and action) features locally around the prediction. The stats returned are (“r2”, “rmse”, “spearman_coeff”, “precision”, “recall”, “accuracy”, “mcc”, “confusion_matrix”, “missing_value_accuracy”). Uses only the context features of the reacted case to determine that area. Uses full calculations, which uses leave-one-out context features for computations.
- selected_prediction_statslist, optional
List of stats to output. When unspecified, returns all except the confusion matrix. Allowed values:
all : Returns all the the available prediction stats, including the confusion matrix.
accuracy : The number of correct predictions divided by the total number of predictions.
confusion_matrix : A sparse map of actual feature value to a map of predicted feature value to counts.
mae : Mean absolute error. For continuous features, this is calculated as the mean of absolute values of the difference between the actual and predicted values. For nominal features, this is 1 - the average categorical action probability of each case’s correct classes. Categorical action probabilities are the probabilities for each class for the action feature.
mda : Mean decrease in accuracy when each feature is dropped from the model, applies to all features.
feature_mda_permutation_full : Mean decrease in accuracy that used scrambling of feature values instead of dropping each feature, applies to all features.
precision : Precision (positive predictive) value for nominal features only.
r2 : The r-squared coefficient of determination, for continuous features only.
recall : Recall (sensitivity) value for nominal features only.
rmse : Root mean squared error, for continuous features only.
spearman_coeff : Spearman’s rank correlation coefficient, for continuous features only.
mcc : Matthews correlation coefficient, for nominal features only.
- similarity_convictionbool, optional
If True, outputs similarity conviction for the reacted case. Uses both context and action feature values as the case values for all computations. This is defined as expected (local) distance contribution divided by reacted case distance contribution.
- generate_attemptsbool, optional
If True outputs the number of attempts taken to generate each case. Only applicable when ‘generate_new_cases’ is “always” or “attempt”.
>>> details = {'num_most_similar_cases': 5, ... 'feature_residuals_full': True}
- Returns:
Format of:
{ 'action': list of dicts of action_features -> action_values, 'details': dict with requested audit data }
- Return type:
Dict
- feature_add(feature=None, value=None)#
Add a feature to a trainee.
- Parameters:
feature (
str
, default:None
) – The name of the feature. Will be generated automatically if not specified.value (
float
|int
|str
|None
, default:None
) – The value to populate the feature with.
- feature_remove(feature=None)#
Remove a feature from a trainee.
- Parameters:
feature (
str
|None
, default:None
) – Optional. The name of the feature to remove. Will quietly do nothing if the feature was not found.
- fit(X, y, analyze=True)#
Fit a model with Howso.
- Parameters:
X – Data
y – Target. Will be cast to X’s dtype if necessary
analyze –
A flag to not analyze the trainee by default
A user may plan to call analyze themselves after fit() to specify parameters
- Returns:
self
- Return type:
- get_case_conviction(X, features=None)#
Return case conviction.
- Parameters:
X – Data
features – A list of feature names to calculate convictions.
- Returns:
The conviction of the cases. Ex: [1.0, 3.2, 0.4]
- Return type:
List
- get_feature_conviction(features=None)#
Gets the conviction of the features in a model.
- Parameters:
features – Features to return conviction values for.
- Returns:
A map of feature convictions and contributions.
- Return type:
Dict
- get_params(deep=True)#
Get parameters for this estimator.
This code is taken from the source of sklearn.base.BaseEstimator and lightly modified to avoid calling the get_params method of self.trainee.
- Parameters:
deep – If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns:
params – Parameter names mapped to their values.
- Return type:
Dict[str, Any]
- load(trainee_id)#
Load a model from the server.
- Parameters:
trainee_id (
str
) – Id of the trainee. (can be obtained from this class).
- partial_fit(X, y)#
Add data to an existing Howso model.
- Parameters:
X – Data
y – Target. Will be cast to X’s dtype if necessary
- partial_unfit(precision, num_cases, criteria=None)#
Remove a training case from a trainee.
The training case will be completely purged from the model and the model will behave as if it had never been trained with this training case.
- Parameters:
precision (
str
) – The precision to use when removing the case. Options are ‘exact’ or ‘similar’.num_cases (
int
) – The number of cases to remove; minimum 1 case must be removed.criteria (
Dict
|None
, default:None
) – The condition map to select the cases to remove that meet all the provided conditions. Keys - features, values - one of | null (must have the feature) | a value (must match exactly) | an array of two values (a range, feature values must be between)
- predict(X)#
Make predictions using Howso.
- Parameters:
X – Data
- Returns:
The predicted values based on the feature values provided.
- Return type:
ndarray
- react_into_features(features=None, *, distance_contribution=False, familiarity_conviction_addition=False, familiarity_conviction_removal=False, influence_weight_entropy=False, p_value_of_addition=False, p_value_of_removal=False, similarity_conviction=False, use_case_weights=None, weight_feature=None)#
Calculate conviction and other data and stores them into features.
- Parameters:
features – A list of the feature names to use when calculating conviction.
distance_contribution – The name of the feature to store distance contribution. If set to True the values will be stored to the feature ‘distance_contribution’.
familiarity_conviction_addition – The name of the feature to store conviction of addition values. If set to True the values will be stored to the feature ‘familiarity_conviction_addition’.
familiarity_conviction_removal – The name of the feature to store conviction of removal values. If set to True the values will be stored to the feature ‘familiarity_conviction_removal’.
influence_weight_entropy – The name of the feature to store influence weight entropy values in. If set to True, the values will be stored in the feature ‘influence_weight_entropy’.
p_value_of_addition – The name of the feature to store p value of addition values. If set to True the values will be stored to the feature ‘p_value_of_addition’.
p_value_of_removal – The name of the feature to store p value of removal values. If set to True the values will be stored to the feature ‘p_value_of_removal’.
similarity_conviction – The name of the feature to store similarity conviction values. If set to True the values will be stored to the feature ‘similarity_conviction’.
use_case_weights – When True, will scale influence weights by each case’s weight_feature weight. If unspecified, case weights will be used if the Trainee has them.
weight_feature – Name of feature whose values to use as case weights. When left unspecified uses the internally managed case weight.
- Return type:
None
- release_resources()#
Release trainee resources created by this estimator.
If this estimator’s trainee is named (self._trainee_name is not None) then we’ll make an effort to persist the trainee to disk and release it’s resources. If the data persistence policy forbids this, that call will return an error. Upon error, delete_trainee() instead.
- NOTE: Errors are handled immediately because this is the instance’s
destructor. There is no further recourse at this point.
- save()#
Persist the trainee.
By default model resources are released after a short period of time. This method saves the model persistently to allow releasing trainee resources while keeping the model available for use later.
If this trainee has not already been named, then this method will set a randomly generated one.
- Raises:
HowsoNotUniqueError: – If unable to set the trainee name w/up to RENAME_RETRIES retries.
Exception: – if unable to persist the trainee.
- Return type:
None
- score(X, y)#
Score Howso.
For classifiers, accuracy is calculated. For regressors, R^2 is calculated.
- Parameters:
X – Test samples.
y – True values for X.
- Returns:
The mean squared error or accuracy
- Return type:
float
- set_fit_request(*, analyze='$UNCHANGED$')#
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
analyze (bool | None | str) – Metadata routing for
analyze
parameter infit
.self (HowsoEstimator)
- Returns:
self – The updated object.
- Return type:
- property trainee_id: str | None#
Return the trainee’s ID, if possible.
- property trainee_name: str | None#
Return the trainee name (getter).
- class howso.scikit.HowsoRegressor(client=None, features=None, targets=None, verbose=False, debug=False, ttl=43200000, client_params=None, trainee_params=None)#
Bases:
HowsoEstimator
A HowsoEstimator for regression analysis.
- Parameters:
features (
Dict
|None
, default:None
) –The features that will predict the targets(s). Will be generated automatically if not specified.
Example:
{ "feature_name": { "parameter1" : "value1", "parameter2" : "value2" }, "length": { "type" : "continuous", "decimal_places": 1 }, "width": { "type" : "continuous", "significant_digits": 4 }, "degrees": { "type" : "continuous", "cycle_length": 360 }, "class": { "type" : "nominal" } }
targets (
Dict
|None
, default:None
) –The target(s) to be predicted. Will be generated automatically if not specified.
Example:
{ "target_name": { "parameter1" : "value1", "parameter2" : "value2" }, "klass": { "type" : "nominal" } }
client – A subclass of AbstractHowsoClient used to interface with Howso.
verbose (
bool
, default:False
) – A flag for verbose output.debug (
bool
, default:False
) – A flag for debug output.ttl (
int
, default:43200000
) – The maximum time a server should maintain a connection open for a trainee when processing requests.client_params (
Dict
|None
, default:None
) – The parameters with which to instantiate the client.trainee_params (
Dict
|None
, default:None
) – The parameters with which to instantiate the client. Intended for use by HowsoEstimator.get_params.
- set_fit_request(*, analyze='$UNCHANGED$')#
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.- Parameters:
analyze (bool | None | str) – Metadata routing for
analyze
parameter infit
.self (HowsoRegressor)
- Returns:
self – The updated object.
- Return type: