GitHub user mengxr opened a pull request:
https://github.com/apache/spark/pull/685
[SPARK-1752][MLLIB] Standardize text format for vectors and labeled points
We should standardize the text format used to represent vectors and labeled
points. The proposed formats are the following:
1. dense vector: `[v0,v1,..]`
2. sparse vector: `(size,[i0,i1],[v0,v1])`
3. labeled point: `(label,vector)`
where "(..)" indicates a tuple and "[...]" indicate an array. Those are
compatible with Python's syntax and can be easily parsed using `eval`. This PR
doesn't contain changes to pyspark. I need to figure out how to change dense
array's `__str__`.
`MLUtils#saveLabeledData` and `MLUtils#loadLabeledData` are deprecated.
Users should use `RDD#saveAsTextFile` and `MLUtils#loadLabeledPoints` instead.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mengxr/spark labeled-io
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/685.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #685
----
commit 19aa5236a20aa2ad7479ed7fdd6db95cc6a6b13f
Author: Xiangrui Meng <[email protected]>
Date: 2014-05-07T20:22:13Z
update toString and add parsers for Vectors and LabeledPoint
commit 9e63a02b5fcf38c00b1634730e2f385961d0f326
Author: Xiangrui Meng <[email protected]>
Date: 2014-05-07T20:53:44Z
add loadVectors and loadLabeledPoints
commit e761d32f7ee62107bcef17fe7491ab086641ac5b
Author: Xiangrui Meng <[email protected]>
Date: 2014-05-07T21:52:17Z
make LabelPoint.parse compatible with the dense format used before v1.0 and
deprecate loadLabeledData and saveLabeledData
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---