sklearn.ensemble.IsolationForest

From GM-RKB
Jump to navigation Jump to search

A sklearn.ensemble.IsolationForest is an Outlier Detection Algorithm used in high-dimensional random forests within sklearn.ensemble module.

1) Import Isolation Forest Algorithm from scikit-learn : from sklearn.ensemble import IsolationForest
2) Generate training input sample: X
3) Create Isolation Forest Algorithm object: clf=IsolationForest([n_estimators=100, max_samples=’auto’, contamination=0.1, max_features=1.0, bootstrap=False, n_jobs=1, random_state=None, verbose=0])
4) Choose method(s):
  • decision_function(X), average anomaly score of X of the base classifiers.
  • fit(X[, y, sample_weight]), fits estimator.
  • get_params([deep]), gets parameters for this estimator.
  • predict(X), predicts if a particular sample is an outlier or not.
  • set_params(**params), sets the parameters of this estimator.


References

2017a

2017b

2008