...

/

Solution Review: Create Local Outlier Factor Model

Solution Review: Create Local Outlier Factor Model

This is the in-depth solution review of the coding challenge "Create Local Outlier Factor Model."

We'll cover the following...

Solution

Press + to interact
# Create Local Outlier Factor model with an outlier proportion of 10%
# and assign it to model variable
model = create_model('lof', fraction = 0.10)
# Assign anomaly labels and scores to the data_assigned variable
data_assigned = assign_model(model)
# Create new dataset of outliers named data_outliers
data_outliers = data_assigned.query('Anomaly == 1')
# Print first 5 instances of the outlier dataset
data_outliers.head(5)

Explanation

...