class Spark::Mllib::LabeledPoint

LabeledPoint

The features and labels of a data point.

Parameters:

label

Label for this data point.

features

Vector of features for this point

Attributes

features[R]
label[R]

Public Class Methods

from_java(object) click to toggle source
# File lib/spark/mllib/regression/labeled_point.rb, line 24
def self.from_java(object)
  LabeledPoint.new(
    object.label,
    Spark.jb.java_to_ruby(object.features)
  )
end
new(label, features) click to toggle source
# File lib/spark/mllib/regression/labeled_point.rb, line 19
def initialize(label, features)
  @label = label.to_f
  @features = Spark::Mllib::Vectors.to_vector(features)
end

Public Instance Methods

marshal_dump() click to toggle source
# File lib/spark/mllib/regression/labeled_point.rb, line 31
def marshal_dump
  [@label, @features]
end
marshal_load(array) click to toggle source
# File lib/spark/mllib/regression/labeled_point.rb, line 35
def marshal_load(array)
  initialize(array[0], array[1])
end