...
/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 variablemodel = create_model('lof', fraction = 0.10)# Assign anomaly labels and scores to the data_assigned variabledata_assigned = assign_model(model)# Create new dataset of outliers named data_outliersdata_outliers = data_assigned.query('Anomaly == 1')# Print first 5 instances of the outlier datasetdata_outliers.head(5)