November 2017
Intermediate to advanced
374 pages
10h 19m
English
This object follows the same form as the other objects we've used.
First, we'll import the required object, then we'll fit the model and examine the results:
from sklearn.decomposition import TruncatedSVDsvd = TruncatedSVD(2)iris_transformed = svd.fit_transform(iris_X)
Then, visualize the results:

The results look pretty good. Like PCA, there is explained variance with explained_variance_ratio_:
svd.explained_variance_ratio_array([ 0.53028106, 0.44685765])
Read now
Unlock full access