Class: NexosisApi::Metric
- Inherits:
-
Object
- Object
- NexosisApi::Metric
- Defined in:
- lib/nexosis_api/metric.rb
Overview
Class to parse algorithm metrics from model results
Instance Attribute Summary collapse
-
#code ⇒ String
Identifier for metric type.
-
#name ⇒ String
Friendly name of the metric.
-
#value ⇒ Float
Calculated metric.
Instance Method Summary collapse
-
#initialize(metricHash) ⇒ Metric
constructor
A new instance of Metric.
Constructor Details
permalink #initialize(metricHash) ⇒ Metric
Returns a new instance of Metric.
4 5 6 7 8 |
# File 'lib/nexosis_api/metric.rb', line 4 def initialize(metricHash) metricHash.each do |k,v| instance_variable_set("@#{k}", v) unless v.nil? end end |
Instance Attribute Details
permalink #code ⇒ String
Identifier for metric type
16 17 18 |
# File 'lib/nexosis_api/metric.rb', line 16 def code @code end |
permalink #name ⇒ String
Friendly name of the metric
12 13 14 |
# File 'lib/nexosis_api/metric.rb', line 12 def name @name end |
permalink #value ⇒ Float
Calculated metric
20 21 22 |
# File 'lib/nexosis_api/metric.rb', line 20 def value @value end |