hoops_ai.ml.context_layer.ContextPrediction
- class hoops_ai.ml.context_layer.ContextPrediction(value, confidence, evidence_count=0, alternatives=<factory>, status=None, reasons=<factory>, coverage=None, evidence=None, injected_context=None)
Bases:
objectA single predicted context value with confidence.
- Parameters:
- value
The inferred value for the context key.
- Type:
Any
- status
Optional decision label — one of
ready_to_propose,needs_review, orinsufficient_evidence.Nonewhen the caller has not requested status evaluation.- Type:
str | None
- reasons
Optional human-readable reasons explaining the status (empty when status is
ready_to_proposeorNone).
- coverage
Optional coverage diagnostics about the hit pool that produced this prediction. Keys include
observed_hits,total_hits,observed_score_weight,missing_score_weight. Successful predictions fromContextPredictor.inferinclude coverage; insufficient sentinels include coverage when status/evidence output was requested.
- evidence
Optional per-hit contribution records (rank, score, value, source). Populated only when
return_evidence=Trueis passed toContextPredictor.infer.
- injected_context
Optional snapshot of the
query_contexttheContextPredictoractually fed to the rule for this key. Populated for numeric keys whenContextPredictor.inferforwards earlierready_to_proposecategorical predictions (or the caller’squery_context) so downstream rules can re-rank neighbors.Nonewhen no context was injected.
- value: Any