Using various dimension reduction techniques to classify calls using the k-Nearest Neighbors classification model

Now that we have seen that reducing dimensions can lead to better performing classification models, let's try a couple of more methods and introduce another classification algorithm: the k-Nearest Neighbors (kNN) algorithm.

In this recipe, we will test and compare three dimensionality reduction methods: PCA (as a benchmark), fast Independent Component Analysis (ICA), and the truncated SVD method.

Getting ready

To execute this recipe, you will need pandas and Scikit. No other prerequisites are required.

How to do it…

In this recipe, we leverage the fact that everything in Python is an object (methods as well) and we can pass these around ...

Get Practical Data Analysis Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.