Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: LOF in Practice | Density-Based Methods
Outlier and Novelty Detection in Practice

bookChallenge: LOF in Practice

Aufgabe

Swipe to start coding

You are given a 2D dataset with clusters and some outliers. Your task is to apply Local Outlier Factor (LOF) from sklearn.neighbors to identify which samples are locally inconsistent (low-density points).

Steps:

  1. Import and initialize LocalOutlierFactor with n_neighbors=20, contamination=0.1.
  2. Fit the model on X and obtain predictions via .fit_predict(X).
  3. Extract negative outlier factor values (model.negative_outlier_factor_).
  4. Print the number of detected outliers and example scores.

Remember:

  • -1 = outlier;
  • 1 = inlier.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 4. Kapitel 4
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

Awesome!

Completion rate improved to 4.55

bookChallenge: LOF in Practice

Swipe um das Menü anzuzeigen

Aufgabe

Swipe to start coding

You are given a 2D dataset with clusters and some outliers. Your task is to apply Local Outlier Factor (LOF) from sklearn.neighbors to identify which samples are locally inconsistent (low-density points).

Steps:

  1. Import and initialize LocalOutlierFactor with n_neighbors=20, contamination=0.1.
  2. Fit the model on X and obtain predictions via .fit_predict(X).
  3. Extract negative outlier factor values (model.negative_outlier_factor_).
  4. Print the number of detected outliers and example scores.

Remember:

  • -1 = outlier;
  • 1 = inlier.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 4. Kapitel 4
single

single

some-alt