Computer Vision News - March 2019
23 Focus on Computer Vision News Python open source toolbox for Outlier Detection # plot outliers and contour subplot = plt . subplot ( 2 , 2 , i + 1 ) subplot . contourf ( xx , yy , ZZ , levels = np . linspace ( ZZ . min (), threshold , 15 )) subplot . contour ( xx , yy , ZZ , levels =[ threshold ], linewidths = 2 , colors = 'red' ) # fill orange contour lines where range of anomaly score is from threshold to maximum anomaly score subplot . contourf ( xx , yy , ZZ , levels =[ threshold , ZZ . max ()], colors = 'blue' ) # scatter plot of inliers with white dots subplot . scatter ( X_train [:- n_outliers , 0 ], X_train [:- n_outliers , 1 ], c = 'white' , s = 12 , edgecolor = 'g' ) # scatter plot of outliers with black dots subplot . scatter ( X_train [- n_outliers :, 0 ], X_train [- n_outliers :, 1 ], c = 'black' , s = 12 , edgecolor = 'g' ) subplot . axis ( 'tight' ) subplot . set_title ( clf_name ) subplot . set_xlim ((- 15 , 15 )) subplot . set_ylim ((- 15 , 15 )) plt . show () Where the output is: We clearly see that ABOD, Isolation Forest and KNN found the main groups (red contour) and left the outlier out, while the BAG failed to find the outliers.
Made with FlippingBook
RkJQdWJsaXNoZXIy NTc3NzU=