Iris data (PCA Principal Component Analysis)

1. Package guide

2. Extract Data

 3.PCA dimensionality reduction

3.1 calls PCA

 Drawing 3.2

 

Extraction of two principal components of cumulative contribution rate reached 0.9777, indicating that better explain the effect of the main ingredient.

 4 contribution rate curve

When the value of the parameter does not fill any n_components, the default return min (X.shape) features. In general, the sample size will be larger than the number of features, so nothing to fill the equivalent of converting a new feature space, but without reducing the number of features. Generally do not use such input shutter mode. But we can use this shutter mode to draw the cumulative difference may explain ⽅ contribution rate curve, in order to select the best of the n- _components value.

 

 From the curves it can be seen that the cumulative contribution ratio extraction cumulative contribution ratio reaches 0.9777 two principal components, a main component extracted four cumulative contribution rate of 0.9948, two principal components increasing cumulative contribution ratio increased by only 0.0171, but the model has increased complexity, increase the amount of computation, increasing the running time, it is extracted two most appropriate principal components.

 

Guess you like

Origin www.cnblogs.com/lvzw/p/11655902.html