儲存離群點機率
繼續建立你的集成模型,撰寫迴圈處理 estimators 並產生離群點機率的程式碼區塊。
已縮放並含額外特徵的 apple 資料集已可使用。
本練習屬於課程
Python 中的異常偵測
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
estimators = [IForest(n_estimators=50), IForest(n_estimators=100)]
shape = (len(apple), len(estimators))
probability_scores = np.empty(shape=shape)
for ____, ____ in ____:
# Fit the estimator
____