Creating three-dimensional scatter plots to present principal components

Principal components are nothing more than multidimensional vectors that we can use to transform our data. By finding the principal dimensions of our data, we can discover a different picture that our data paints.

Getting ready

To execute this recipe, you will need Matplotlib with MPL Toolkits. These should come preinstalled if you are using the Anaconda distribution of Python. No other prerequisites are required.

How to do it…

To plot our three-dimensional data, we will use the plot_components(...) method (the helper.py file):

def plot_components(z, y, color_marker, **f_params): ''' Produce and save the chart presenting 3 principal components ''' # import necessary modules import ...

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.