You can visualize PCA for example by
val N = 2
val pc: Matrix = mat.computePrincipalComponents(N) // Principal components
are stored in a local dense matrix.
// Project the rows to the linear space spanned by the top N principal
components.
val projected: RowMatrix = mat.multiply(pc)
Each row of
Also the guide on this is useful:
http://spark.apache.org/docs/latest/mllib-dimensionality-reduction.html#principal-component-analysis-pca
On Wed, Mar 18, 2015 at 11:46 PM, Reza Zadeh wrote:
> You can visualize PCA for example by
>
> val N = 2
> val pc: Matrix = mat.computePrincipalComponents(N)