我有一个方形的pyspark RowMatrix
,看起来像这样:
>>> row_mat.numRows()
100
>>> row_mat.numCols()
100
>>> row_mat.rows.first()
SparseVector(100, {0: 0.0, 1: 0.0018, 2: 0.1562, 3: 0.0342...})
我想运行pyspark.ml.feature.PCA,但它的fit()方法只需要 DataFrame
. 有没有办法将此 RowMatrix
转换为 DataFrame
?
或者有更好的方法吗?
1 回答
使用: