CommencerCommencer gratuitement

Choosing n_estimators

n_estimators is the parameter that influences model performance the most. Building IForest with enough trees ensures that the algorithm has enough generalization power to isolate the outliers from normal data points. The optimal number of trees depends on dataset size, and any number that is too high or too low will lead to inaccurate predictions.

Practice setting n_estimators on the big_mart dataset, which has been loaded for you along with IForest from pyod.

Cet exercice fait partie du cours

Anomaly Detection in Python

Afficher le cours

Instructions

  • Create an IForest() estimator with 300 iTrees.
  • Fit the instance to big_mart.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create an IForest with 300 trees
iforest = ____

# Fit to the Big Mart sales data
____
Modifier et exécuter le code