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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.