Prathamesh Bhamare commited on
Commit ·
c44f03d
1
Parent(s): 656bbaf
Migrated metrics to SVG
Browse files- MODEL_CARD.md +4 -4
- frontend/app/page.js +4 -4
- frontend/public/metrics/confusion_matrix.png +0 -0
- frontend/public/metrics/confusion_matrix.svg +984 -0
- frontend/public/metrics/feature_importance.png +0 -0
- frontend/public/metrics/feature_importance.svg +2058 -0
- frontend/public/metrics/pr_curve.png +0 -0
- frontend/public/metrics/pr_curve.svg +2038 -0
- frontend/public/metrics/roc_curve.png +0 -0
- frontend/public/metrics/roc_curve.svg +1497 -0
- scripts/generate_model_proofs.py +4 -4
MODEL_CARD.md
CHANGED
|
@@ -23,19 +23,19 @@ KRONECTOR is rigorously cross-validated against 10+ years of F1 data (2014-2024)
|
|
| 23 |
The ROC Curve demonstrates the model's ability to distinguish between a race winner and a non-winner. An AUC of 1.0 is perfect.
|
| 24 |
**KRONECTOR achieves an impressive ~0.94 AUC**, proving it is highly capable of separating true contenders from the rest of the grid.
|
| 25 |
|
| 26 |
-
, the PR curve is critical. High Area Under the PR Curve means when KRONECTOR predicts a driver will win, it is very rarely wrong.
|
| 30 |
|
| 31 |
-

|
| 39 |
This chart aggregates the absolute SHAP values across all predictions, revealing the fundamental laws of the model. As expected, **Grid Position**, **Championship Standing**, and **Driver Form** have the largest average impact on predicting race outcomes.
|
| 40 |
|
| 41 |
-

|
| 27 |
|
| 28 |
### 2. Precision-Recall Curve
|
| 29 |
Because Formula 1 is highly imbalanced (1 winner vs 19 losers per race), the PR curve is critical. High Area Under the PR Curve means when KRONECTOR predicts a driver will win, it is very rarely wrong.
|
| 30 |
|
| 31 |
+

|
| 32 |
|
| 33 |
### 3. Confusion Matrix
|
| 34 |
Evaluating the raw accuracy using a 50% probability threshold. This matrix shows the breakdown of True Positives, True Negatives, False Positives, and False Negatives.
|
| 35 |
|
| 36 |
+

|
| 37 |
|
| 38 |
### 4. Global Feature Importance (SHAP)
|
| 39 |
This chart aggregates the absolute SHAP values across all predictions, revealing the fundamental laws of the model. As expected, **Grid Position**, **Championship Standing**, and **Driver Form** have the largest average impact on predicting race outcomes.
|
| 40 |
|
| 41 |
+

|
frontend/app/page.js
CHANGED
|
@@ -177,19 +177,19 @@ export default function Home() {
|
|
| 177 |
<div style={{display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '2rem'}}>
|
| 178 |
<div>
|
| 179 |
<h3 style={{color: 'var(--neon-cyan)', marginBottom: '1rem', textAlign: 'center'}}>ROC AUC Curve</h3>
|
| 180 |
-
<img src="/metrics/roc_curve.
|
| 181 |
</div>
|
| 182 |
<div>
|
| 183 |
<h3 style={{color: 'var(--neon-cyan)', marginBottom: '1rem', textAlign: 'center'}}>Precision-Recall Curve</h3>
|
| 184 |
-
<img src="/metrics/pr_curve.
|
| 185 |
</div>
|
| 186 |
<div>
|
| 187 |
<h3 style={{color: 'var(--neon-cyan)', marginBottom: '1rem', textAlign: 'center'}}>Confusion Matrix</h3>
|
| 188 |
-
<img src="/metrics/confusion_matrix.
|
| 189 |
</div>
|
| 190 |
<div>
|
| 191 |
<h3 style={{color: 'var(--neon-cyan)', marginBottom: '1rem', textAlign: 'center'}}>Global Feature Importance</h3>
|
| 192 |
-
<img src="/metrics/feature_importance.
|
| 193 |
</div>
|
| 194 |
</div>
|
| 195 |
</div>
|
|
|
|
| 177 |
<div style={{display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '2rem'}}>
|
| 178 |
<div>
|
| 179 |
<h3 style={{color: 'var(--neon-cyan)', marginBottom: '1rem', textAlign: 'center'}}>ROC AUC Curve</h3>
|
| 180 |
+
<img src="/metrics/roc_curve.svg" alt="ROC Curve" style={{width: '100%', borderRadius: '10px'}} />
|
| 181 |
</div>
|
| 182 |
<div>
|
| 183 |
<h3 style={{color: 'var(--neon-cyan)', marginBottom: '1rem', textAlign: 'center'}}>Precision-Recall Curve</h3>
|
| 184 |
+
<img src="/metrics/pr_curve.svg" alt="PR Curve" style={{width: '100%', borderRadius: '10px'}} />
|
| 185 |
</div>
|
| 186 |
<div>
|
| 187 |
<h3 style={{color: 'var(--neon-cyan)', marginBottom: '1rem', textAlign: 'center'}}>Confusion Matrix</h3>
|
| 188 |
+
<img src="/metrics/confusion_matrix.svg" alt="Confusion Matrix" style={{width: '100%', borderRadius: '10px'}} />
|
| 189 |
</div>
|
| 190 |
<div>
|
| 191 |
<h3 style={{color: 'var(--neon-cyan)', marginBottom: '1rem', textAlign: 'center'}}>Global Feature Importance</h3>
|
| 192 |
+
<img src="/metrics/feature_importance.svg" alt="Feature Importance" style={{width: '100%', borderRadius: '10px'}} />
|
| 193 |
</div>
|
| 194 |
</div>
|
| 195 |
</div>
|
frontend/public/metrics/confusion_matrix.png
DELETED
|
Binary file (130 Bytes)
|
|
|
frontend/public/metrics/confusion_matrix.svg
ADDED
|
|
frontend/public/metrics/feature_importance.png
DELETED
|
Binary file (131 Bytes)
|
|
|
frontend/public/metrics/feature_importance.svg
ADDED
|
|
frontend/public/metrics/pr_curve.png
DELETED
|
Binary file (130 Bytes)
|
|
|
frontend/public/metrics/pr_curve.svg
ADDED
|
|
frontend/public/metrics/roc_curve.png
DELETED
|
Binary file (131 Bytes)
|
|
|
frontend/public/metrics/roc_curve.svg
ADDED
|
|
scripts/generate_model_proofs.py
CHANGED
|
@@ -91,7 +91,7 @@ def main():
|
|
| 91 |
|
| 92 |
ax.legend([f'AUC = {roc_auc:.3f}'], loc="lower right", facecolor="#1e293b", edgecolor="#334155", labelcolor="white", fontsize=12)
|
| 93 |
plt.tight_layout()
|
| 94 |
-
plt.savefig(os.path.join(args.output_dir, "roc_curve.
|
| 95 |
plt.close()
|
| 96 |
|
| 97 |
# 2. Precision-Recall Curve
|
|
@@ -111,7 +111,7 @@ def main():
|
|
| 111 |
|
| 112 |
ax.legend([f'AUC = {pr_auc:.3f}'], loc="lower left", facecolor="#1e293b", edgecolor="#334155", labelcolor="white", fontsize=12)
|
| 113 |
plt.tight_layout()
|
| 114 |
-
plt.savefig(os.path.join(args.output_dir, "pr_curve.
|
| 115 |
plt.close()
|
| 116 |
|
| 117 |
# 3. Confusion Matrix
|
|
@@ -132,7 +132,7 @@ def main():
|
|
| 132 |
ax.set_yticklabels(['Not Win', 'Win'], color='#94a3b8', fontsize=12, rotation=0)
|
| 133 |
|
| 134 |
plt.tight_layout()
|
| 135 |
-
plt.savefig(os.path.join(args.output_dir, "confusion_matrix.
|
| 136 |
plt.close()
|
| 137 |
|
| 138 |
# 4. Global Feature Importance
|
|
@@ -162,7 +162,7 @@ def main():
|
|
| 162 |
color=cyan, fontweight='bold', va='center', fontsize=11)
|
| 163 |
|
| 164 |
plt.tight_layout()
|
| 165 |
-
plt.savefig(os.path.join(args.output_dir, "feature_importance.
|
| 166 |
plt.close()
|
| 167 |
|
| 168 |
print(f"Proofs generated successfully in {args.output_dir}")
|
|
|
|
| 91 |
|
| 92 |
ax.legend([f'AUC = {roc_auc:.3f}'], loc="lower right", facecolor="#1e293b", edgecolor="#334155", labelcolor="white", fontsize=12)
|
| 93 |
plt.tight_layout()
|
| 94 |
+
plt.savefig(os.path.join(args.output_dir, "roc_curve.svg"), format="svg", transparent=True, bbox_inches='tight')
|
| 95 |
plt.close()
|
| 96 |
|
| 97 |
# 2. Precision-Recall Curve
|
|
|
|
| 111 |
|
| 112 |
ax.legend([f'AUC = {pr_auc:.3f}'], loc="lower left", facecolor="#1e293b", edgecolor="#334155", labelcolor="white", fontsize=12)
|
| 113 |
plt.tight_layout()
|
| 114 |
+
plt.savefig(os.path.join(args.output_dir, "pr_curve.svg"), format="svg", transparent=True, bbox_inches='tight')
|
| 115 |
plt.close()
|
| 116 |
|
| 117 |
# 3. Confusion Matrix
|
|
|
|
| 132 |
ax.set_yticklabels(['Not Win', 'Win'], color='#94a3b8', fontsize=12, rotation=0)
|
| 133 |
|
| 134 |
plt.tight_layout()
|
| 135 |
+
plt.savefig(os.path.join(args.output_dir, "confusion_matrix.svg"), format="svg", transparent=True, bbox_inches='tight')
|
| 136 |
plt.close()
|
| 137 |
|
| 138 |
# 4. Global Feature Importance
|
|
|
|
| 162 |
color=cyan, fontweight='bold', va='center', fontsize=11)
|
| 163 |
|
| 164 |
plt.tight_layout()
|
| 165 |
+
plt.savefig(os.path.join(args.output_dir, "feature_importance.svg"), format="svg", transparent=True, bbox_inches='tight')
|
| 166 |
plt.close()
|
| 167 |
|
| 168 |
print(f"Proofs generated successfully in {args.output_dir}")
|