skclean.handlers.FilterCV

class skclean.handlers.FilterCV(classifier, detector=None, thresholds=None, fracs_to_filter=None, cv=5, n_jobs=1, random_state=None)

For quickly finding best cutoff point for Filter i.e. threshold or fraction_to_filter. This avoids recomputing conf_score for each hyper-parameter value as opposed to say GridSearchCV. See [SMartinezMunozSuarez18] for details/usage.

Parameters
  • classifier (object) – A classifier instance supporting sklearn API.

  • detector (BaseDetector or None, default=None) – To compute conf_score. Set it to None only if conf_score is expected in fit() (e.g. when used inside a Pipeline with a BaseDetector preceding it). Otherwise a Detector must be supplied during instantiation.

  • thresholds (list, default=None) – A list of thresholds to choose the best one from

  • fracs_to_filter (list, default=None) – A list of percentages to choose the best one from

  • cv (int, cross-validation generator or an iterable, default=None) – If None, uses 5-fold stratified k-fold if int, no of folds to use in stratified k-fold

  • n_jobs (int, default=1) – No of parallel cpu cores to use

  • random_state (int, default=None) – Set this value for reproducibility

Methods

__init__(classifier[, detector, thresholds, …])

Initialize self.

fit(X, y[, conf_score])

get_params([deep])

Get parameters for this estimator.

predict(X)

predict_proba(X)

score(X, y[, sample_weight])

Return the mean accuracy on the given test data and labels.

set_params(**params)

Set the parameters of this estimator.

Attributes

iterative