0

我使用隔离森林来检测异常值,但我想更多地探索它为什么将这些数据确定为异常值,我很难直接从结果中看到。有没有办法做到这一点?或者我如何检查准确性?

model=IsolationForest(n_estimators=50, max_samples='auto', contamination=float(0.1), max_features=1.0)

model.fit(df)

pred = model.predict(df)

df['anomaly']=pred

outliers=df.loc[df['anomaly']==-1]

print(df['anomaly'].value_counts())

我从 70000 个数据中得到了大约 7000 个异常值,但我不知道这是否准确。

4

0 回答 0