Class: DSPy::Evaluate::EvaluationResult
- Inherits:
-
Object
- Object
- DSPy::Evaluate::EvaluationResult
- Extended by:
- T::Sig
- Defined in:
- lib/dspy/evaluate.rb
Overview
Result of evaluating a single example
Instance Attribute Summary collapse
-
#example ⇒ Object
readonly
Returns the value of attribute example.
-
#metrics ⇒ Object
readonly
Returns the value of attribute metrics.
-
#passed ⇒ Object
readonly
Returns the value of attribute passed.
-
#prediction ⇒ Object
readonly
Returns the value of attribute prediction.
-
#trace ⇒ Object
readonly
Returns the value of attribute trace.
Instance Method Summary collapse
-
#initialize(example:, prediction:, trace:, metrics:, passed:) ⇒ EvaluationResult
constructor
A new instance of EvaluationResult.
- #to_h ⇒ Object
Constructor Details
#initialize(example:, prediction:, trace:, metrics:, passed:) ⇒ EvaluationResult
Returns a new instance of EvaluationResult.
40 41 42 43 44 45 46 |
# File 'lib/dspy/evaluate.rb', line 40 def initialize(example:, prediction:, trace:, metrics:, passed:) @example = example @prediction = prediction @trace = trace @metrics = metrics @passed = passed end |
Instance Attribute Details
#example ⇒ Object (readonly)
Returns the value of attribute example.
17 18 19 |
# File 'lib/dspy/evaluate.rb', line 17 def example @example end |
#metrics ⇒ Object (readonly)
Returns the value of attribute metrics.
26 27 28 |
# File 'lib/dspy/evaluate.rb', line 26 def metrics @metrics end |
#passed ⇒ Object (readonly)
Returns the value of attribute passed.
29 30 31 |
# File 'lib/dspy/evaluate.rb', line 29 def passed @passed end |
#prediction ⇒ Object (readonly)
Returns the value of attribute prediction.
20 21 22 |
# File 'lib/dspy/evaluate.rb', line 20 def prediction @prediction end |
#trace ⇒ Object (readonly)
Returns the value of attribute trace.
23 24 25 |
# File 'lib/dspy/evaluate.rb', line 23 def trace @trace end |
Instance Method Details
#to_h ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/dspy/evaluate.rb', line 49 def to_h { example: @example, prediction: @prediction.respond_to?(:to_h) ? @prediction.to_h : @prediction, trace: @trace, metrics: @metrics, passed: @passed } end |