Class: NexosisApi::AlgorithmSelection
- Inherits:
-
Object
- Object
- NexosisApi::AlgorithmSelection
- Defined in:
- lib/nexosis_api/algorithm_selection.rb
Overview
Class to parse the model data results from a session
Instance Attribute Summary collapse
-
#champion ⇒ NexosisApi::AlgorithmRun
The champion algorithm used.
-
#contestants ⇒ Array of NexosisApi::AlgorithmRun
All other algorithms which competed.
-
#date ⇒ DateTime
The date on which this algo was selected as champion.
-
#sessionId ⇒ String
The session which selected the algorithm.
Instance Method Summary collapse
-
#initialize(dataHash) ⇒ AlgorithmSelection
constructor
A new instance of AlgorithmSelection.
Constructor Details
permalink #initialize(dataHash) ⇒ AlgorithmSelection
Returns a new instance of AlgorithmSelection.
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/nexosis_api/algorithm_selection.rb', line 4 def initialize(dataHash) dataHash.each do |k,v| if k == "champion" instance_variable_set("@#{k}", NexosisApi::AlgorithmRun.new(v)) elsif k == "contestants" @contestantArray = Array.new v.each {|c| @contestantArray << NexosisApi::AlgorithmRun.new(c)} instance_variable_set("@#{k}", @contestantArray) else instance_variable_set("@#{k}", v) unless v.nil? end end end |
Instance Attribute Details
permalink #champion ⇒ NexosisApi::AlgorithmRun
The champion algorithm used
28 29 30 |
# File 'lib/nexosis_api/algorithm_selection.rb', line 28 def champion @champion end |
permalink #contestants ⇒ Array of NexosisApi::AlgorithmRun
All other algorithms which competed
32 33 34 |
# File 'lib/nexosis_api/algorithm_selection.rb', line 32 def contestants @contestants end |
permalink #date ⇒ DateTime
The date on which this algo was selected as champion
20 21 22 |
# File 'lib/nexosis_api/algorithm_selection.rb', line 20 def date @date end |
permalink #sessionId ⇒ String
The session which selected the algorithm
24 25 26 |
# File 'lib/nexosis_api/algorithm_selection.rb', line 24 def sessionId @sessionId end |