Covariance
Model API Type |
Function API |
|---|---|
MLlib RowMatrix API |
def computeCovariance (): Matrix |
MLlib RowMatrix API
- Input/Output
- Package name: org.apache.spark.mllib.linalg.distributed
- Class name: RowMatrix
- Method name: computeCovariance
- Input: matrix (RowMatrix)
Parameter
Type
Description
rows
RDD[Vector]
Matrix, which is stored in the unit of row
nRows
Long
Number of rows
nCols
Int
Number of columns
- Algorithm parameters
Code interface example:
1 2
val matrix = new RowMatrix(data) val covMat = matrix.computeCovariance()
- Output: covariance matrix
Parameter
Type
Description
Mat
Matrix
Covariance matrix
- Example
1val mat = mat.computeCovariance ()
Parent topic: Developing an Application