Class: Spark::Mllib::ClassificationModel
- Inherits:
-
Object
- Object
- Spark::Mllib::ClassificationModel
- Defined in:
- lib/spark/mllib/classification/common.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#intercept ⇒ Object
readonly
Returns the value of attribute intercept.
-
#threshold ⇒ Object
Returns the value of attribute threshold.
-
#weights ⇒ Object
readonly
Returns the value of attribute weights.
Instance Method Summary collapse
- #clear_threshold ⇒ Object
-
#initialize(weights, intercept) ⇒ ClassificationModel
constructor
A new instance of ClassificationModel.
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
#intercept ⇒ Object (readonly)
Returns the value of attribute intercept.
5 6 7 |
# File 'lib/spark/mllib/classification/common.rb', line 5 def intercept @intercept end |
#threshold ⇒ Object
Returns the value of attribute threshold.
5 6 7 |
# File 'lib/spark/mllib/classification/common.rb', line 5 def threshold @threshold end |
#weights ⇒ Object (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_threshold ⇒ Object
17 18 19 |
# File 'lib/spark/mllib/classification/common.rb', line 17 def clear_threshold @threshold = nil end |