MLOps/tests/demo_normal_case.py

39 lines
1.1 KiB
Python

import requests
import json
def test_normal_prediction():
"""Démo cas normal - Match entre deux équipes top 10"""
match = {
"team_1": "Natus Vincere",
"team_2": "FaZe Clan",
"rank_1": 1,
"rank_2": 2,
"map_name": "Mirage"
}
print("=" * 50)
print("CAS NORMAL - Prédiction Match Pro")
print("=" * 50)
print(f"\n📋 Input:")
print(json.dumps(match, indent=2))
# Appel API
response = requests.post("http://localhost:8000/predict", json=match)
print(f"\n✅ Réponse:")
result = response.json()
print(json.dumps(result, indent=2))
print(f"\n📊 Interprétation:")
winner = match['team_1'] if result['winner'] == 1 else match['team_2']
print(f"Gagnant prédit: {winner}")
print(f"Confiance: {result['probability']:.1%}")
print(f"Latence: {result['latency_ms']:.1f}ms")
# Vérifier dashboard Grafana
print(f"\n🎨 Dashboard: http://localhost:3000")
print(f"MLflow: http://localhost:5000")
if __name__ == "__main__":
test_normal_prediction()