Class: DSPy::Teleprompt::MIPROv2::MIPROv2Result
- Inherits:
-
OptimizationResult
- Object
- OptimizationResult
- DSPy::Teleprompt::MIPROv2::MIPROv2Result
- Extended by:
- T::Sig
- Defined in:
- lib/dspy/teleprompt/mipro_v2.rb
Overview
Result of MIPROv2 optimization
Instance Attribute Summary collapse
-
#best_evaluation_result ⇒ Object
readonly
Returns the value of attribute best_evaluation_result.
-
#bootstrap_statistics ⇒ Object
readonly
Returns the value of attribute bootstrap_statistics.
-
#evaluated_candidates ⇒ Object
readonly
Returns the value of attribute evaluated_candidates.
-
#optimization_trace ⇒ Object
readonly
Returns the value of attribute optimization_trace.
-
#proposal_statistics ⇒ Object
readonly
Returns the value of attribute proposal_statistics.
Instance Method Summary collapse
-
#initialize(optimized_program:, scores:, history:, evaluated_candidates:, optimization_trace:, bootstrap_statistics:, proposal_statistics:, best_score_name: nil, best_score_value: nil, metadata: {}, best_evaluation_result: nil) ⇒ MIPROv2Result
constructor
A new instance of MIPROv2Result.
- #to_h ⇒ Object
Constructor Details
#initialize(optimized_program:, scores:, history:, evaluated_candidates:, optimization_trace:, bootstrap_statistics:, proposal_statistics:, best_score_name: nil, best_score_value: nil, metadata: {}, best_evaluation_result: nil) ⇒ MIPROv2Result
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 294 def initialize(optimized_program:, scores:, history:, evaluated_candidates:, optimization_trace:, bootstrap_statistics:, proposal_statistics:, best_score_name: nil, best_score_value: nil, metadata: {}, best_evaluation_result: nil) super( optimized_program: optimized_program, scores: scores, history: history, best_score_name: best_score_name, best_score_value: best_score_value, metadata: ) @evaluated_candidates = evaluated_candidates.freeze @optimization_trace = optimization_trace.freeze @bootstrap_statistics = bootstrap_statistics.freeze @proposal_statistics = proposal_statistics.freeze @best_evaluation_result = best_evaluation_result&.freeze end |
Instance Attribute Details
#best_evaluation_result ⇒ Object (readonly)
Returns the value of attribute best_evaluation_result.
277 278 279 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 277 def best_evaluation_result @best_evaluation_result end |
#bootstrap_statistics ⇒ Object (readonly)
Returns the value of attribute bootstrap_statistics.
271 272 273 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 271 def bootstrap_statistics @bootstrap_statistics end |
#evaluated_candidates ⇒ Object (readonly)
Returns the value of attribute evaluated_candidates.
265 266 267 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 265 def evaluated_candidates @evaluated_candidates end |
#optimization_trace ⇒ Object (readonly)
Returns the value of attribute optimization_trace.
268 269 270 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 268 def optimization_trace @optimization_trace end |
#proposal_statistics ⇒ Object (readonly)
Returns the value of attribute proposal_statistics.
274 275 276 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 274 def proposal_statistics @proposal_statistics end |
Instance Method Details
#to_h ⇒ Object
311 312 313 314 315 316 317 318 319 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 311 def to_h super.merge({ evaluated_candidates: @evaluated_candidates.map(&:to_h), optimization_trace: @optimization_trace, bootstrap_statistics: @bootstrap_statistics, proposal_statistics: @proposal_statistics, best_evaluation_result: @best_evaluation_result&.to_h }) end |