Coding Challenge: Create Local Outlier Factor Model

Create a local outlier factor model with an outlier proportion of 10%, assign anomaly labels and print the outlier dataset.

Problem statement

In this challenge, we’ll create and label a local outlier factor model with an outlier proportion of 1010% and assign it to the model variable. Afterward, we must assign anomaly labels and scores to the data_assigned variable. Now, we need to create a new dataset named data_outliers, containing only the instances that have been labeled as outliers. Finally, print the first 55 instances of the outlier dataset.

Expected output

Get hands-on with 1200+ tech skills courses.