Class: Retab::ExperimentByTargetMetricsResponse

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb

Constant Summary collapse

HASH_ATTRS =
{
  run_id: :run_id,
  kind: :kind,
  view: :view,
  target: :target,
  score: :score,
  prior_score: :prior_score,
  confusion: :confusion,
  documents: :documents
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ ExperimentByTargetMetricsResponse

Returns a new instance of ExperimentByTargetMetricsResponse.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb', line 30

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @run_id = hash[:run_id]
  @kind = hash[:kind]
  @view = hash[:view]
  @target = hash[:target]
  @score = hash[:score]
  @prior_score = hash[:prior_score]
  @confusion = hash[:confusion] ? Retab::ExperimentTargetConfusionMetric.new(hash[:confusion]) : nil
  @documents = (hash[:documents] || []).map { |item|
    item ? Retab::ExperimentByTargetDocumentMetric.new(item) : nil
  }
end

Instance Attribute Details

#confusionObject

Returns the value of attribute confusion.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb', line 19

def confusion
  @confusion
end

#documentsObject

Returns the value of attribute documents.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb', line 19

def documents
  @documents
end

#kindObject

Returns the value of attribute kind.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb', line 19

def kind
  @kind
end

#prior_scoreObject

Returns the value of attribute prior_score.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb', line 19

def prior_score
  @prior_score
end

#run_idObject

Returns the value of attribute run_id.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb', line 19

def run_id
  @run_id
end

#scoreObject

Returns the value of attribute score.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb', line 19

def score
  @score
end

#targetObject

Returns the value of attribute target.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb', line 19

def target
  @target
end

#viewObject

Returns the value of attribute view.



19
20
21
# File 'lib/retab/experiment_run_metrics/experiment_by_target_metrics_response.rb', line 19

def view
  @view
end