Class: NexosisApi::SessionContest
- Defined in:
- lib/nexosis_api/session_contest.rb
Overview
Class to parse the algorithm contestants from a session
Instance Attribute Summary collapse
-
#champion ⇒ NexosisApi::AlgorithmContestant
The champion algorithm used.
-
#champion_metric ⇒ String
Name of metric used to determine champion algorithm.
-
#contestants ⇒ Array of NexosisApi::AlgorithmContestant
All other algorithms which competed.
Attributes inherited from Session
#column_metadata, #datasource_name, #end_date, #extra_parameters, #links, #messages, #model_id, #prediction_domain, #prediction_intervals, #requested_date, #result_interval, #session_id, #start_date, #status, #status_history, #target_column, #type
Instance Method Summary collapse
-
#initialize(contest_hash) ⇒ SessionContest
constructor
A new instance of SessionContest.
Constructor Details
permalink #initialize(contest_hash) ⇒ SessionContest
Returns a new instance of SessionContest.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/nexosis_api/session_contest.rb', line 5 def initialize(contest_hash) contest_hash.each do |k, v| if k.to_s == 'champion' instance_variable_set("@#{k}", NexosisApi::AlgorithmContestant.new(v)) elsif k.to_s == 'contestants' instance_variable_set("@#{k}", v.map { |c| NexosisApi::AlgorithmContestant.new(c) }) elsif k.to_s == 'championMetric' @champion_metric = v end end super(contest_hash.reject { |key, _v| key == 'champion' || key == 'contestants' }) end |
Instance Attribute Details
permalink #champion ⇒ NexosisApi::AlgorithmContestant
The champion algorithm used
20 21 22 |
# File 'lib/nexosis_api/session_contest.rb', line 20 def champion @champion end |
permalink #champion_metric ⇒ String
Name of metric used to determine champion algorithm
28 29 30 |
# File 'lib/nexosis_api/session_contest.rb', line 28 def champion_metric @champion_metric end |
permalink #contestants ⇒ Array of NexosisApi::AlgorithmContestant
All other algorithms which competed
24 25 26 |
# File 'lib/nexosis_api/session_contest.rb', line 24 def contestants @contestants end |