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
-
#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: {}) ⇒ 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: {}) ⇒ MIPROv2Result
Returns a new instance of MIPROv2Result.
205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 205 def initialize(optimized_program:, scores:, history:, evaluated_candidates:, optimization_trace:, bootstrap_statistics:, proposal_statistics:, best_score_name: nil, best_score_value: nil, metadata: {}) 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 end |
Instance Attribute Details
#bootstrap_statistics ⇒ Object (readonly)
Returns the value of attribute bootstrap_statistics.
186 187 188 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 186 def bootstrap_statistics @bootstrap_statistics end |
#evaluated_candidates ⇒ Object (readonly)
Returns the value of attribute evaluated_candidates.
180 181 182 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 180 def evaluated_candidates @evaluated_candidates end |
#optimization_trace ⇒ Object (readonly)
Returns the value of attribute optimization_trace.
183 184 185 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 183 def optimization_trace @optimization_trace end |
#proposal_statistics ⇒ Object (readonly)
Returns the value of attribute proposal_statistics.
189 190 191 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 189 def proposal_statistics @proposal_statistics end |
Instance Method Details
#to_h ⇒ Object
221 222 223 224 225 226 227 228 |
# File 'lib/dspy/teleprompt/mipro_v2.rb', line 221 def to_h super.merge({ evaluated_candidates: @evaluated_candidates.map(&:to_h), optimization_trace: @optimization_trace, bootstrap_statistics: @bootstrap_statistics, proposal_statistics: @proposal_statistics }) end |