Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

explained_variance_ratio kernel pca

#compute the explained variance (and ratio) by doing:
kpca_transform = kpca.fit_transform(feature_vec)
explained_variance = numpy.var(kpca_transform, axis=0)
explained_variance_ratio = explained_variance / numpy.sum(explained_variance)

#to get the cumulative proportion explained variance (often useful in selecting components and estimating the dimensionality of your space):
numpy.cumsum(explained_variance_ratio)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #kernel #pca
ADD COMMENT
Topic
Name
4+4 =