Python 中的异常检测
Bekhruz (Bex) Tuychiev
Kaggle Master, Data Science Content Creator
对 IForest 影响最大的超参数:
contaminationn_estimatorsmax_samplesmax_featuresIForest 如何判别数据点:
contamination 的阈值contamination 的最高异常分数作为离群点from pyod.models.iforest import IForest# 接受 0 到 0.5 之间的值 iforest = IForest(contamination=0.05)
# 大数据集用更多树
iforest = IForest(n_estimators=1000)
iforest.fit(airbnb_df)
iforest = IForest(n_estimators=200, max_samples=0.6, max_features=0.9)iforest.fit(airbnb_df)
Python 中的异常检测