Class: Retab::ExperimentByDocumentMetricsResponse
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ExperimentByDocumentMetricsResponse
- Defined in:
- lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb
Constant Summary collapse
- HASH_ATTRS =
{ run_id: :run_id, kind: :kind, view: :view, document: :document, score: :score, prior_score: :prior_score, confusion: :confusion, targets: :targets }.freeze
Instance Attribute Summary collapse
-
#confusion ⇒ Object
Returns the value of attribute confusion.
-
#document ⇒ Object
Returns the value of attribute document.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#prior_score ⇒ Object
Returns the value of attribute prior_score.
-
#run_id ⇒ Object
Returns the value of attribute run_id.
-
#score ⇒ Object
Returns the value of attribute score.
-
#targets ⇒ Object
Returns the value of attribute targets.
-
#view ⇒ Object
Returns the value of attribute view.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ExperimentByDocumentMetricsResponse
constructor
A new instance of ExperimentByDocumentMetricsResponse.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ExperimentByDocumentMetricsResponse
Returns a new instance of ExperimentByDocumentMetricsResponse.
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb', line 29 def initialize(json) hash = self.class.normalize(json) @run_id = hash[:run_id] @kind = hash[:kind] @view = hash[:view] @document = hash[:document] ? Retab::ExperimentMetricDocumentRef.new(hash[:document]) : nil @score = hash[:score] @prior_score = hash[:prior_score] @confusion = hash[:confusion] ? Retab::ExperimentDocumentConfusionMetric.new(hash[:confusion]) : nil @targets = (hash[:targets] || []).map { |item| item ? Retab::ExperimentByDocumentTargetMetric.new(item) : nil } end |
Instance Attribute Details
#confusion ⇒ Object
Returns the value of attribute confusion.
19 20 21 |
# File 'lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb', line 19 def confusion @confusion end |
#document ⇒ Object
Returns the value of attribute document.
19 20 21 |
# File 'lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb', line 19 def document @document end |
#kind ⇒ Object
Returns the value of attribute kind.
19 20 21 |
# File 'lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb', line 19 def kind @kind end |
#prior_score ⇒ Object
Returns the value of attribute prior_score.
19 20 21 |
# File 'lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb', line 19 def prior_score @prior_score end |
#run_id ⇒ Object
Returns the value of attribute run_id.
19 20 21 |
# File 'lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb', line 19 def run_id @run_id end |
#score ⇒ Object
Returns the value of attribute score.
19 20 21 |
# File 'lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb', line 19 def score @score end |
#targets ⇒ Object
Returns the value of attribute targets.
19 20 21 |
# File 'lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb', line 19 def targets @targets end |
#view ⇒ Object
Returns the value of attribute view.
19 20 21 |
# File 'lib/retab/experiment_run_metrics/experiment_by_document_metrics_response.rb', line 19 def view @view end |