I am working on one Anomaly detection problem (unsupervise problem) Data set have 1) 15 columns and around 8k rows , including normal and abnormal(outlier ) rows, without label , all are numeric

following are my query : 1) can i implement k means on this dataset , if yes then how as there are 15 columns (usually online tutorials only explain k means with 2 columns ) and how i will evaluate k means ?

2) which is best algorithm to implement on this type dataset i) Local Outlier Factor ii) isolation Forest iii) one class SVM iv) Multivariate Gaussian

Any suggestion/pointers will be helpful , please add your comments Thanks :)


Regarding your first question, yes, you can use k-means. K-means can be used on data with any number of input features. Euclidean distances can be measured between points and cluster means in any dimensional space.

With regards to which algorithm you should use for outlier detection, scikit-learn's website has a good walkthrough of some of the commonly used algorithms (sklearn: Novelty and Outlier Detection. K-means is not commonly used for outlier detection. Local outlier factor seems to behave well, but the performance of each algorithm probably depends on the nature of your dataset.

I would recommend implementing multiple algorithms on a training set of your data and investigating the results. It would be good if you had some ground truth criteria for what you believed an outlier to be. In that case you can systematically evaluate each algorithm, or even train a supervised method.

  • 1
    $\begingroup$ Thanks @Matt C for your answer , My another concern with all these methods , how i will visualize it as i have 15 features . Everywhere on internet they have taken only 2 features to explain all above mention algorithms $\endgroup$ – user3219871 Mar 31 '20 at 6:23
  • $\begingroup$ For visualization you can either choose pairs of features to plot against each other with the k-means label as the point color. Another common approach is to perform PCA on the data and plot the first principal component against the second principal component. $\endgroup$ – Matt C Mar 31 '20 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.