Class: Jubatus::Classifier::EstimateResult
- Inherits:
-
Object
- Object
- Jubatus::Classifier::EstimateResult
- Includes:
- Jubatus::Common
- Defined in:
- lib/jubatus/classifier/types.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(label, score) ⇒ EstimateResult
constructor
A new instance of EstimateResult.
- #to_msgpack(out = '') ⇒ Object
- #to_s ⇒ Object
Methods included from Jubatus::Common
Constructor Details
#initialize(label, score) ⇒ EstimateResult
Returns a new instance of EstimateResult.
15 16 17 18 |
# File 'lib/jubatus/classifier/types.rb', line 15 def initialize(label, score) @label = label @score = score end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
39 40 41 |
# File 'lib/jubatus/classifier/types.rb', line 39 def label @label end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
39 40 41 |
# File 'lib/jubatus/classifier/types.rb', line 39 def score @score end |
Class Method Details
.from_msgpack(m) ⇒ Object
25 26 27 28 |
# File 'lib/jubatus/classifier/types.rb', line 25 def EstimateResult.from_msgpack(m) val = TYPE.from_msgpack(m) EstimateResult.new(*val) end |
Instance Method Details
#to_msgpack(out = '') ⇒ Object
20 21 22 23 |
# File 'lib/jubatus/classifier/types.rb', line 20 def to_msgpack(out = '') t = [@label, @score] return TYPE.to_msgpack(t) end |
#to_s ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/jubatus/classifier/types.rb', line 30 def to_s gen = Jubatus::Common::MessageStringGenerator.new gen.open("estimate_result") gen.add("label", @label) gen.add("score", @score) gen.close() return gen.to_s end |