from the preceding outputas expectedwe can see the maximum variance is explained by the first principal component to obtain the reduced feature setwe can use the following snippet in [ ]bc_pca pca transform(bc_xnp round(bc_pca out[ ]array([ - ] - ] - ] - ] - ]- - ]]if you compare the values of this reduced feature set with the values obtained in our mathematical implementation based codeyou will see they are exactly the same except sign inversions in some cases the reason for sign inversion in some of the values in principal components is because the direction of these principal components is unstable the sign indicates direction hence even if the principal components point in opposite directionsthey should still be on the same plane and hence shouldn' have an effect when modeling with this data let' now quickly build logistic regression model as before and use model accuracy and five-fold cross validation to evaluate the model quality using these three features in [ ]np average(cross_val_score(lrbc_pcabc_yscoring='accuracy'cv= )out[ ] we can see from the preceding output that even though we used only three features derived from the principal components instead of the original featureswe still obtained model accuracy close to %which is quite decentsummary this was content packed with lot of hands-on examples based on real-world datasets the main intent of this is to get you familiarized with essential conceptstoolstechniquesand strategies used for feature extractionengineeringscalingand selection one of the toughest tasks that data scientists face day in and day out is data processing and feature engineering hence it is of paramount importance that you understand the various aspects involved with deriving features from raw data this is intended to be used both as starting ground as well as reference guide for understanding what techniques and strategy should be applied when trying to engineer features on your own datasets we cover the basic concepts of feature engineeringscalingand selection and also the importance behind each of these processes feature engineering techniques are covered extensively for diverse data types including numericalcategoricaltext