January 2018
Beginner to intermediate
316 pages
7h 14m
English
Let's see if we can add in a PCA component to the pipeline to enhance this accuracy. We will begin again by setting up our variables. This time we will need to create a scikit-learn pipeline object to house the PCA module as well as our linear model. We will keep the same parameters that we used for the linear classifier and add new parameters for our PCA. We will attempt to find the optimal number of components between 10, 100, and 200 components. Try to take a moment and hypothesize which of three will end up being the best (hint, think back to the scree plot and explained variance):
# Use PCA to extract new features lr = LogisticRegression()pca = PCA() # set the params for the pipeline
Read now
Unlock full access