CodexFlow_TM / utils.py
LordXido's picture
Create utils.py
3c17485 verified
raw
history blame contribute delete
332 Bytes
def normalize(value: float, min_v: float, max_v: float) -> float:
return (value - min_v) / (max_v - min_v) if max_v > min_v else 0.0
def compute_risk_score(confidence: float, physical_support: float) -> float:
"""
Higher of both yields safer profile.
"""
return round(min(1.0, confidence * physical_support), 4)