【发布时间】:2019-11-01 14:22:28
【问题描述】:
我正在使用IsolationForest 来检测我的数据集的异常数据点。
clf = IsolationForest(max_samples='auto',
random_state=42,
behaviour="new",
contamination=.01)
clf.fit(X)
y_pred_train = clf.predict(X)
outliers = []
for item in np.where(y_pred_train == -1)[0]:
outliers.append(df_nodes[item])
我希望将预测的异常值作为排名列表。也就是说,我想知道什么是最潜在的异常值以及下一个等等(可能使用一些预测概率进行排序)。我试图在sklearn 中找到一种方法。但是,我仍然找不到方法。请告诉我一个合适的方法。
如果需要,我很乐意提供更多详细信息。
【问题讨论】:
标签: python machine-learning scikit-learn outliers