【发布时间】:2021-03-20 00:26:08
【问题描述】:
我正在检测未标记数据集中的异常值(数据未标记为内点/异常值),并且我正在 Python 中使用隔离森林(scikit-learn 库)。
我想获得数据集中数据的异常分数,所以我使用以下代码:
if_model = IsolationForest(max_samples=100)
if_model.fit(dataset)
anomaly_score = if_model.score_samples(dataset)
但是我有一些问题:
- 之前的过程是否正确,或者我应该将我的数据集分成两部分,以便在一组上执行拟合并在另一组上获得异常分数?
- 方法
predict有什么用处?我应该如何使用它?
【问题讨论】:
标签: python scikit-learn random-forest anomaly-detection isolation-forest