Class: DecisionAgent::Scoring::MaxWeight

Inherits:
Base
  • Object
show all
Defined in:
lib/decision_agent/scoring/max_weight.rb

Instance Method Summary collapse

Instance Method Details

#score(evaluations) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/decision_agent/scoring/max_weight.rb', line 6

def score(evaluations)
  return { decision: nil, confidence: 0.0 } if evaluations.empty?

  max_eval = evaluations.max_by(&:weight)

  {
    decision: max_eval.decision,
    confidence: round_confidence(normalize_confidence(max_eval.weight))
  }
end