Spaces:
Sleeping
Sleeping
Create utils.py
Browse files
utils.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def normalize(value: float, min_v: float, max_v: float) -> float:
|
| 2 |
+
return (value - min_v) / (max_v - min_v) if max_v > min_v else 0.0
|
| 3 |
+
|
| 4 |
+
def compute_risk_score(confidence: float, physical_support: float) -> float:
|
| 5 |
+
"""
|
| 6 |
+
Higher of both yields safer profile.
|
| 7 |
+
"""
|
| 8 |
+
return round(min(1.0, confidence * physical_support), 4)
|