Covariance
模型接口类别 |
函数接口 |
---|---|
MLlib RowMatrix API |
def computeCovariance (): Matrix |
- 输入输出
- 包名:org.apache.spark.mllib.linalg.distributed
- 类名:RowMatrix
- 方法名:computeCovariance
- 输入:RowMatrix,输入矩阵
参数名称
取值类型
描述
rows
RDD[Vector]
矩阵,以行为单位进行存储
nRows
Long
行数
nCols
Int
列数
- 算法参数
代码接口示例:
1 2
val matrix = new RowMatrix(data) val covMat = matrix.computeCovariance()
- 输出:协方差矩阵Matrix
参数名称
取值类型
描述
Mat
Matrix
协方差矩阵
- 使用样例
1
val mat = mat.computeCovariance ()
父主题: 特征工程