Class: Spark::Mllib::ClassificationModel

Inherits:
Object
  • Object
show all
Defined in:
lib/spark/mllib/classification/common.rb

Direct Known Subclasses

LogisticRegressionModel, SVMModel

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(weights, intercept) ⇒ ClassificationModel

Returns a new instance of ClassificationModel.



7
8
9
10
11
# File 'lib/spark/mllib/classification/common.rb', line 7

def initialize(weights, intercept)
  @weights = Spark::Mllib::Vectors.to_vector(weights)
  @intercept = intercept.to_f
  @threshold = nil
end

Instance Attribute Details

#interceptObject (readonly)

Returns the value of attribute intercept.



5
6
7
# File 'lib/spark/mllib/classification/common.rb', line 5

def intercept
  @intercept
end

#thresholdObject

Returns the value of attribute threshold.



5
6
7
# File 'lib/spark/mllib/classification/common.rb', line 5

def threshold
  @threshold
end

#weightsObject (readonly)

Returns the value of attribute weights.



5
6
7
# File 'lib/spark/mllib/classification/common.rb', line 5

def weights
  @weights
end

Instance Method Details

#clear_thresholdObject



17
18
19
# File 'lib/spark/mllib/classification/common.rb', line 17

def clear_threshold
  @threshold = nil
end