skclean.detectors.RandomForestDetector

class skclean.detectors.RandomForestDetector(n_estimators=101, sampling_ratio=None, n_jobs=1, random_state=None)

Trains a Random Forest first- for each sample, only trees that didn’t select it for training (via bootstrapping) are used to predict it’s label. Percentage of trees that correctly predicted the label is the sample’s conf_score.

See [SMartinezMunozSuarez18] for details.

n_estimatorsint, default=101

No of trees in Random Forest.

sampling_ratiofloat, 0.0 to 1.0, default=1.0

No of samples drawn at each tree equals: len(X) * sampling_ratio

n_jobsint, default=1

No of parallel cpu cores to use

random_stateint, default=None

Set this value for reproducibility

Methods

__init__([n_estimators, sampling_ratio, …])

Initialize self.

detect(X, y)

fit_transform(X[, y])

Fit to data, then transform it.

get_params([deep])

Get parameters for this estimator.

set_params(**params)

Set the parameters of this estimator.

transform(X)