sahandha / eif

Extended Isolation Forest for Anomaly Detection
Other
445 stars 117 forks source link

Use in novelty detection/one-class classification #19

Closed oulenz closed 4 years ago

oulenz commented 4 years ago

From what I understand, your api doesn't distinguish between constructing the trees and querying to obtain scores (like the fit/predict methods of scikit-learn), is that correct?

So it's not currently possible to use this implementation for novelty detection/one-class classification, where the training set is different from the test set?

mgckind commented 4 years ago

Hi @oulenz , It is possible, After constructing the trees with for example: F = iso.iForest(X, ntrees=Ntrees, sample_size=Nsamples, ExtensionLevel=1) You can use that to evaluate the scores for any input data with the same shape as X, like: S_new= F.compute_paths(X_in=X_new) X and X_new don't need to be the same, but they need to have the same dimensions Thanks!

oulenz commented 4 years ago

Thanks! Somehow I completely missed that iso.iforest takes an argument X.