skclean.handlers.SampleWeight

class skclean.handlers.SampleWeight(classifier, detector=None, *, n_jobs=1, random_state=None)

Simply passes conf_score (computed with detector) as sample weight to underlying classifier.

Parameters
  • classifier (object) – A classifier instance supporting sklearn API. Must support sample_weight in fit() method.

  • 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.

  • 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, n_jobs, …])

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