hypernets.model package¶
Submodules¶
hypernets.model.estimator module¶
-
class
hypernets.model.estimator.
CrossValidationEstimator
(base_estimator, task, num_folds=3, stratified=False, shuffle=False, random_state=None)[source]¶ Bases:
object
hypernets.model.hyper_model module¶
-
class
hypernets.model.hyper_model.
HyperModel
(searcher, dispatcher=None, callbacks=None, reward_metric=None, task=None, discriminator=None)[source]¶ Bases:
object
-
best_reward
¶
-
best_trial_no
¶
-
reward_metrics
¶
-
search
(X, y, X_eval, y_eval, X_test=None, cv=False, num_folds=3, max_trials=10, dataset_id=None, trial_store=None, **fit_kwargs)[source]¶ Parameters: - X – Pandas or Dask DataFrame, feature data for training
- y – Pandas or Dask Series, target values for training
- X_eval – (Pandas or Dask DataFrame) or None, feature data for evaluation
- y_eval – (Pandas or Dask Series) or None, target values for evaluation
- X_test – (Pandas or Dask Series) or None, target values for evaluation of indicators like PSI
- cv – Optional, int(default=False), If set to true, use cross-validation instead of evaluation set reward to guide the search process
- num_folds – Optional, int(default=3), Number of cross-validated folds, only valid when cv is true
- max_trials – Optional, int(default=10), The upper limit of the number of search trials, the search process stops when the number is exceeded
- dataset_id –
- trial_store –
- fit_kwargs – Optional, dict, parameters for fit method of model
Returns:
-
hypernets.model.objectives module¶
-
class
hypernets.model.objectives.
CVWrapperEstimator
(estimators, x_vals, y_vals)[source]¶ Bases:
object
-
classes_
¶
-
-
class
hypernets.model.objectives.
NumOfFeatures
(sample_size=1000)[source]¶ Bases:
hypernets.core.objective.Objective
Detect the number of features used (NF)
References
[1] Molnar, Christoph, Giuseppe Casalicchio, and Bernd Bischl. “Quantifying model complexity via functional decomposition for better post-hoc interpretability.” Machine Learning and Knowledge Discovery in Databases: International Workshops of ECML PKDD 2019, Würzburg, Germany, September 16–20, 2019, Proceedings, Part I. Springer International Publishing, 2020.
-
class
hypernets.model.objectives.
PSIObjective
(n_bins=10, task='binary', average='macro', eps=1e-06)[source]¶