Challenge: Isolation Forest Implementation
Tarefa
Swipe to start coding
You are given a 2D dataset containing normal points and a few outliers. Your goal is to train an Isolation Forest model to detect anomalies, compute anomaly scores, and flag potential outliers.
Steps:
- Import and initialize
IsolationForestfromsklearn.ensemble. - Fit the model on the dataset
X. - Compute anomaly scores using
decision_function(X). - Predict labels using
.predict(X)— note:1→ inlier-1→ outlier
- Print the number of detected outliers and show example scores.
- Use parameters:
contamination=0.15,random_state=42, andn_estimators=100.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 4
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Awesome!
Completion rate improved to 4.55
Challenge: Isolation Forest Implementation
Deslize para mostrar o menu
Tarefa
Swipe to start coding
You are given a 2D dataset containing normal points and a few outliers. Your goal is to train an Isolation Forest model to detect anomalies, compute anomaly scores, and flag potential outliers.
Steps:
- Import and initialize
IsolationForestfromsklearn.ensemble. - Fit the model on the dataset
X. - Compute anomaly scores using
decision_function(X). - Predict labels using
.predict(X)— note:1→ inlier-1→ outlier
- Print the number of detected outliers and show example scores.
- Use parameters:
contamination=0.15,random_state=42, andn_estimators=100.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 3. Capítulo 4
single