nenzilea commited on
Commit
2bbf9a5
·
verified ·
1 Parent(s): 818d16f

Upload 7 files

Browse files

Updated numpy version and minor error fixes

README.md CHANGED
@@ -7,6 +7,7 @@ sdk: streamlit
7
  sdk_version: 1.57.0
8
  app_file: app.py
9
  pinned: false
 
10
  ---
11
 
12
  # F1 Grid-to-Flag Predictor
 
7
  sdk_version: 1.57.0
8
  app_file: app.py
9
  pinned: false
10
+ python_version: "3.12"
11
  ---
12
 
13
  # F1 Grid-to-Flag Predictor
app.py CHANGED
@@ -91,7 +91,7 @@ CIRCUIT_DISPLAY = {
91
 
92
  @st.cache_resource
93
  def load_model():
94
- with open(MODELS_DIR / "best_model.pkl", "rb") as f:
95
  model = pickle.load(f)
96
  with open(MODELS_DIR / "metadata.json") as f:
97
  metadata = json.load(f)
@@ -457,7 +457,7 @@ try:
457
  except FileNotFoundError:
458
  st.error(
459
  "Model or data files not found. "
460
- "Make sure `models/best_model.pkl`, `models/metadata.json`, and "
461
  "`data/processed/f1_features.csv` exist."
462
  )
463
  st.stop()
 
91
 
92
  @st.cache_resource
93
  def load_model():
94
+ with open(MODELS_DIR / "f1_prediction_model.pkl", "rb") as f:
95
  model = pickle.load(f)
96
  with open(MODELS_DIR / "metadata.json") as f:
97
  metadata = json.load(f)
 
457
  except FileNotFoundError:
458
  st.error(
459
  "Model or data files not found. "
460
+ "Make sure `models/f1_prediction_model.pkl`, `models/metadata.json`, and "
461
  "`data/processed/f1_features.csv` exist."
462
  )
463
  st.stop()
f1_features.csv CHANGED
The diff for this file is too large to render. See raw diff
 
models/f1_prediction_model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af88a2a09463b762eeb21a7b23b167aba8073535b23d2867881fa614c5c3b7ab
3
+ size 27851552
models/metadata.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "best_model_name": "GradBoost (n=200)",
3
  "feature_columns": [
4
  "grid_position",
5
  "driver_id_enc",
@@ -48,58 +48,58 @@
48
  "results": {
49
  "RF (n=300)": {
50
  "val_2024": {
51
- "accuracy": 0.5574,
52
- "f1_weighted": 0.5473
53
  },
54
  "test_2025": {
55
- "accuracy": 0.5762,
56
- "f1_weighted": 0.5454
57
  }
58
  },
59
  "XGBoost (n=300)": {
60
  "val_2024": {
61
- "accuracy": 0.4489,
62
- "f1_weighted": 0.4662
63
  },
64
  "test_2025": {
65
- "accuracy": 0.5052,
66
- "f1_weighted": 0.5118
67
  }
68
  },
69
  "GradBoost (n=200)": {
70
  "val_2024": {
71
- "accuracy": 0.5616,
72
- "f1_weighted": 0.5706
73
  },
74
  "test_2025": {
75
- "accuracy": 0.5303,
76
- "f1_weighted": 0.5311
77
  }
78
  }
79
  },
80
  "best_model_final": {
81
  "val_2024": {
82
  "baseline": {
83
- "accuracy": 0.5616,
84
- "f1_weighted": 0.5706,
85
- "f1_macro": 0.5159
86
  },
87
  "threshold": {
88
- "accuracy": 0.5616,
89
- "f1_weighted": 0.5706,
90
- "f1_macro": 0.5159
91
  }
92
  },
93
  "test_2025": {
94
  "baseline": {
95
- "accuracy": 0.5303,
96
- "f1_weighted": 0.5311,
97
- "f1_macro": 0.498
98
  },
99
  "threshold": {
100
- "accuracy": 0.5303,
101
- "f1_weighted": 0.5311,
102
- "f1_macro": 0.498
103
  }
104
  }
105
  }
 
1
  {
2
+ "best_model_name": "RF (n=300)",
3
  "feature_columns": [
4
  "grid_position",
5
  "driver_id_enc",
 
48
  "results": {
49
  "RF (n=300)": {
50
  "val_2024": {
51
+ "accuracy": 0.5658,
52
+ "f1_weighted": 0.5517
53
  },
54
  "test_2025": {
55
+ "accuracy": 0.5658,
56
+ "f1_weighted": 0.5396
57
  }
58
  },
59
  "XGBoost (n=300)": {
60
  "val_2024": {
61
+ "accuracy": 0.428,
62
+ "f1_weighted": 0.4468
63
  },
64
  "test_2025": {
65
+ "accuracy": 0.5094,
66
+ "f1_weighted": 0.515
67
  }
68
  },
69
  "GradBoost (n=200)": {
70
  "val_2024": {
71
+ "accuracy": 0.4885,
72
+ "f1_weighted": 0.5039
73
  },
74
  "test_2025": {
75
+ "accuracy": 0.5115,
76
+ "f1_weighted": 0.5177
77
  }
78
  }
79
  },
80
  "best_model_final": {
81
  "val_2024": {
82
  "baseline": {
83
+ "accuracy": 0.5658,
84
+ "f1_weighted": 0.5517,
85
+ "f1_macro": 0.4656
86
  },
87
  "threshold": {
88
+ "accuracy": 0.5658,
89
+ "f1_weighted": 0.5517,
90
+ "f1_macro": 0.4656
91
  }
92
  },
93
  "test_2025": {
94
  "baseline": {
95
+ "accuracy": 0.5658,
96
+ "f1_weighted": 0.5396,
97
+ "f1_macro": 0.4872
98
  },
99
  "threshold": {
100
+ "accuracy": 0.5658,
101
+ "f1_weighted": 0.5396,
102
+ "f1_macro": 0.4872
103
  }
104
  }
105
  }
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  pandas>=2.0.0
2
- numpy>=1.26.0
3
- scikit-learn>=1.4.0
4
  openai>=1.30.0
5
  streamlit>=1.57.0
 
1
  pandas>=2.0.0
2
+ numpy==1.26.2
3
+ scikit-learn==1.8.0
4
  openai>=1.30.0
5
  streamlit>=1.57.0