If you look at the class LabeledPoint, you'll see it has a field called "label":
data.label data.features(1) would access the second element of features, which is not the same thing. On Fri, Aug 1, 2014 at 3:01 AM, SK <skrishna...@gmail.com> wrote: > > Hi, > > I want to extract the individual elements of a feature vector that is part > of a LabeledPoint. I tried the following: > > data.features._1 > data.features(1) > data.features.map(_.1) > > > data is a LabeledPoint with a feature vector containing 3 features. All of > the above resulted in compilation errors. What is the right way to extract > the elements of the feature vector? > > thanks > > > > -- > View this message in context: > http://apache-spark-user-list.1001560.n3.nabble.com/Extracting-an-element-from-the-feature-vector-in-LabeledPoint-tp11110.html > Sent from the Apache Spark User List mailing list archive at Nabble.com.