Spaces:
Sleeping
Sleeping
Upload 25 files
Browse files- .gitattributes +4 -0
- IPL_Match_Simulation_Phase3.ipynb +1216 -0
- IPL_Predictions.ipynb +0 -0
- IPL_Project_Summary.docx +0 -0
- IPL_Score_Prediction.ipynb +0 -0
- README.md +77 -0
- app.py +169 -0
- bilstm_score_predictor.h5 +3 -0
- cnn_score_predictor.h5 +3 -0
- deliveries.csv +3 -0
- gru_match_simulation_commentary.csv +73 -0
- gru_match_simulation_overwise.csv +21 -0
- gru_match_simulation_plot.gif +3 -0
- gru_match_summary.txt +9 -0
- gru_rw_predictor.keras +3 -0
- gru_score_predictor.h5 +3 -0
- gru_score_predictor.keras +0 -0
- lstm_score_predictor.h5 +3 -0
- match_momentum_dashboard.gif +3 -0
- match_simulator.py +53 -0
- matches.csv +0 -0
- requirements.txt +7 -0
- scaler_input.save +0 -0
- scaler_output.save +0 -0
- scaler_rw_input.save +0 -0
- scaler_rw_output.save +0 -0
.gitattributes
CHANGED
@@ -33,3 +33,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
deliveries.csv filter=lfs diff=lfs merge=lfs -text
|
37 |
+
gru_match_simulation_plot.gif filter=lfs diff=lfs merge=lfs -text
|
38 |
+
gru_rw_predictor.keras filter=lfs diff=lfs merge=lfs -text
|
39 |
+
match_momentum_dashboard.gif filter=lfs diff=lfs merge=lfs -text
|
IPL_Match_Simulation_Phase3.ipynb
ADDED
@@ -0,0 +1,1216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"metadata": {
|
7 |
+
"colab": {
|
8 |
+
"base_uri": "https://localhost:8080/",
|
9 |
+
"height": 224
|
10 |
+
},
|
11 |
+
"executionInfo": {
|
12 |
+
"elapsed": 24689,
|
13 |
+
"status": "ok",
|
14 |
+
"timestamp": 1744101251163,
|
15 |
+
"user": {
|
16 |
+
"displayName": "Dinesh Kumar",
|
17 |
+
"userId": "18299454607260962281"
|
18 |
+
},
|
19 |
+
"user_tz": -330
|
20 |
+
},
|
21 |
+
"id": "Ni_Q3LdXWC-q",
|
22 |
+
"outputId": "5f3fff46-29a3-41ac-c79f-9ca052214953"
|
23 |
+
},
|
24 |
+
"outputs": [
|
25 |
+
{
|
26 |
+
"ename": "ModuleNotFoundError",
|
27 |
+
"evalue": "No module named 'google.colab'",
|
28 |
+
"output_type": "error",
|
29 |
+
"traceback": [
|
30 |
+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
31 |
+
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
|
32 |
+
"Cell \u001b[1;32mIn[1], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Mount Google Drive\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mgoogle\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcolab\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m drive\n\u001b[0;32m 3\u001b[0m drive\u001b[38;5;241m.\u001b[39mmount(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m/content/drive\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m 4\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mpandas\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mpd\u001b[39;00m\n",
|
33 |
+
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'google.colab'"
|
34 |
+
]
|
35 |
+
}
|
36 |
+
],
|
37 |
+
"source": [
|
38 |
+
"# Mount Google Drive\n",
|
39 |
+
"from google.colab import drive\n",
|
40 |
+
"drive.mount('/content/drive')\n",
|
41 |
+
"import pandas as pd\n",
|
42 |
+
"\n",
|
43 |
+
"# Load the match + commentary data\n",
|
44 |
+
"csv_path = '/content/drive/MyDrive/Colab Notebooks/IPLPrediction/gru_match_simulation_commentary.csv'\n",
|
45 |
+
"df = pd.read_csv(csv_path)\n",
|
46 |
+
"\n",
|
47 |
+
"# Add DELTA columns for comparison between overs\n",
|
48 |
+
"df['Runs_This_Over'] = df['Cumulative Runs'].diff().fillna(df['Cumulative Runs'])\n",
|
49 |
+
"df['Score_Delta'] = df['Predicted Final Score'].diff().fillna(df['Predicted Final Score'])\n",
|
50 |
+
"df['Win_Prob_Change'] = df['Win Probability (%)'].diff().fillna(df['Win Probability (%)'])\n",
|
51 |
+
"\n",
|
52 |
+
"# Display result\n",
|
53 |
+
"df.head()\n"
|
54 |
+
]
|
55 |
+
},
|
56 |
+
{
|
57 |
+
"cell_type": "code",
|
58 |
+
"execution_count": null,
|
59 |
+
"metadata": {
|
60 |
+
"colab": {
|
61 |
+
"base_uri": "https://localhost:8080/"
|
62 |
+
},
|
63 |
+
"executionInfo": {
|
64 |
+
"elapsed": 57,
|
65 |
+
"status": "ok",
|
66 |
+
"timestamp": 1744099400163,
|
67 |
+
"user": {
|
68 |
+
"displayName": "Dinesh Kumar",
|
69 |
+
"userId": "18299454607260962281"
|
70 |
+
},
|
71 |
+
"user_tz": -330
|
72 |
+
},
|
73 |
+
"id": "oizD-WjjbM1V",
|
74 |
+
"outputId": "d6303264-2d78-4b3a-a7d5-2cf2d5c5ec35"
|
75 |
+
},
|
76 |
+
"outputs": [],
|
77 |
+
"source": [
|
78 |
+
"# 💥 Highest run overs\n",
|
79 |
+
"top_run_overs = df.sort_values(by='Runs_This_Over', ascending=False).head(3)\n",
|
80 |
+
"\n",
|
81 |
+
"# 🎯 Biggest predicted score jump\n",
|
82 |
+
"top_score_jump = df.sort_values(by='Score_Delta', ascending=False).head(3)\n",
|
83 |
+
"\n",
|
84 |
+
"# 🔻 Biggest drop in win probability\n",
|
85 |
+
"biggest_win_prob_drop = df.sort_values(by='Win_Prob_Change').head(3)\n",
|
86 |
+
"\n",
|
87 |
+
"# 🔼 Biggest increase in win probability\n",
|
88 |
+
"biggest_win_prob_rise = df.sort_values(by='Win_Prob_Change', ascending=False).head(3)\n",
|
89 |
+
"\n",
|
90 |
+
"# Display each\n",
|
91 |
+
"print(\"💥 Top 3 High-Scoring Overs:\")\n",
|
92 |
+
"print(top_run_overs[['Over', 'Runs_This_Over', 'Commentary']], end=\"\\n\\n\")\n",
|
93 |
+
"\n",
|
94 |
+
"print(\"🎯 Top 3 Predicted Score Jumps:\")\n",
|
95 |
+
"print(top_score_jump[['Over', 'Score_Delta', 'Commentary']], end=\"\\n\\n\")\n",
|
96 |
+
"\n",
|
97 |
+
"print(\"🔻 Top 3 Win Probability Drops:\")\n",
|
98 |
+
"print(biggest_win_prob_drop[['Over', 'Win_Prob_Change', 'Commentary']], end=\"\\n\\n\")\n",
|
99 |
+
"\n",
|
100 |
+
"print(\"🔼 Top 3 Win Probability Gains:\")\n",
|
101 |
+
"print(biggest_win_prob_rise[['Over', 'Win_Prob_Change', 'Commentary']])\n"
|
102 |
+
]
|
103 |
+
},
|
104 |
+
{
|
105 |
+
"cell_type": "code",
|
106 |
+
"execution_count": null,
|
107 |
+
"metadata": {
|
108 |
+
"colab": {
|
109 |
+
"base_uri": "https://localhost:8080/"
|
110 |
+
},
|
111 |
+
"executionInfo": {
|
112 |
+
"elapsed": 5058,
|
113 |
+
"status": "ok",
|
114 |
+
"timestamp": 1744101274146,
|
115 |
+
"user": {
|
116 |
+
"displayName": "Dinesh Kumar",
|
117 |
+
"userId": "18299454607260962281"
|
118 |
+
},
|
119 |
+
"user_tz": -330
|
120 |
+
},
|
121 |
+
"id": "7zlfOX9pbMzU",
|
122 |
+
"outputId": "5e8a9048-60cf-43a4-c8e8-a3c712da238a"
|
123 |
+
},
|
124 |
+
"outputs": [],
|
125 |
+
"source": [
|
126 |
+
"from openai import OpenAI\n",
|
127 |
+
"import os\n",
|
128 |
+
"\n",
|
129 |
+
"# Set your API key securely\n",
|
130 |
+
"os.environ[\"OPENAI_API_KEY\"] = \"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\" # 🔐 Use your actual key here\n",
|
131 |
+
"client = OpenAI(api_key=os.getenv(\"OPENAI_API_KEY\"))\n",
|
132 |
+
"\n",
|
133 |
+
"# Construct the summary prompt from insights\n",
|
134 |
+
"summary_prompt = \"\"\"\n",
|
135 |
+
"You're a cricket commentator. Generate an IPL-style summary of the match based on these insights:\n",
|
136 |
+
"\n",
|
137 |
+
"- The first 3 overs saw very little movement (low runs, 0% win probability).\n",
|
138 |
+
"- Over 5 to Over 7 showed good progress — higher runs and confidence.\n",
|
139 |
+
"- Over 19 was a massive momentum swing — highest runs, max predicted score jump, and win probability jump (22%).\n",
|
140 |
+
"- Over 20 ended with a predicted score of 154 and a win probability of 43%.\n",
|
141 |
+
"\n",
|
142 |
+
"Write the commentary in a high-energy, sharp, and story-like tone. Mention momentum shift, turning points, and crowd reactions.\n",
|
143 |
+
"\"\"\"\n",
|
144 |
+
"\n",
|
145 |
+
"# Get GPT response\n",
|
146 |
+
"# Re-run GPT summary generation with more tokens\n",
|
147 |
+
"response = client.chat.completions.create(\n",
|
148 |
+
" model=\"gpt-3.5-turbo\",\n",
|
149 |
+
" messages=[{\"role\": \"user\", \"content\": summary_prompt}],\n",
|
150 |
+
" temperature=0.9,\n",
|
151 |
+
" max_tokens=350 # ✅ Increased to avoid truncation\n",
|
152 |
+
")\n",
|
153 |
+
"\n",
|
154 |
+
"match_summary = response.choices[0].message.content\n",
|
155 |
+
"print(\"🏏 Full Match Summary:\\n\")\n",
|
156 |
+
"print(match_summary)"
|
157 |
+
]
|
158 |
+
},
|
159 |
+
{
|
160 |
+
"cell_type": "code",
|
161 |
+
"execution_count": null,
|
162 |
+
"metadata": {
|
163 |
+
"colab": {
|
164 |
+
"base_uri": "https://localhost:8080/"
|
165 |
+
},
|
166 |
+
"executionInfo": {
|
167 |
+
"elapsed": 284,
|
168 |
+
"status": "ok",
|
169 |
+
"timestamp": 1744101284093,
|
170 |
+
"user": {
|
171 |
+
"displayName": "Dinesh Kumar",
|
172 |
+
"userId": "18299454607260962281"
|
173 |
+
},
|
174 |
+
"user_tz": -330
|
175 |
+
},
|
176 |
+
"id": "-M-DEfnCbMwv",
|
177 |
+
"outputId": "01a1ef6c-cdcd-464f-d557-a1b2526704de"
|
178 |
+
},
|
179 |
+
"outputs": [],
|
180 |
+
"source": [
|
181 |
+
"# Save as text file\n",
|
182 |
+
"summary_path_txt = '/content/drive/MyDrive/Colab Notebooks/IPLPrediction/gru_match_summary.txt'\n",
|
183 |
+
"\n",
|
184 |
+
"with open(summary_path_txt, 'w') as f:\n",
|
185 |
+
" f.write(match_summary)\n",
|
186 |
+
"\n",
|
187 |
+
"print(f\"✅ Full match summary saved to: {summary_path_txt}\")\n"
|
188 |
+
]
|
189 |
+
},
|
190 |
+
{
|
191 |
+
"cell_type": "code",
|
192 |
+
"execution_count": null,
|
193 |
+
"metadata": {
|
194 |
+
"colab": {
|
195 |
+
"base_uri": "https://localhost:8080/",
|
196 |
+
"height": 734
|
197 |
+
},
|
198 |
+
"executionInfo": {
|
199 |
+
"elapsed": 1927,
|
200 |
+
"status": "ok",
|
201 |
+
"timestamp": 1744101288885,
|
202 |
+
"user": {
|
203 |
+
"displayName": "Dinesh Kumar",
|
204 |
+
"userId": "18299454607260962281"
|
205 |
+
},
|
206 |
+
"user_tz": -330
|
207 |
+
},
|
208 |
+
"id": "NoH11T4obMnf",
|
209 |
+
"outputId": "26391ad0-a59a-48c1-b4a9-e48226753c26"
|
210 |
+
},
|
211 |
+
"outputs": [],
|
212 |
+
"source": [
|
213 |
+
"import pandas as pd\n",
|
214 |
+
"import matplotlib.pyplot as plt\n",
|
215 |
+
"\n",
|
216 |
+
"# Load commentary data (already saved earlier)\n",
|
217 |
+
"file_path = '/content/drive/MyDrive/Colab Notebooks/IPLPrediction/gru_match_simulation_commentary.csv'\n",
|
218 |
+
"df = pd.read_csv(file_path)\n",
|
219 |
+
"\n",
|
220 |
+
"# Prepare values\n",
|
221 |
+
"overs = df['Over']\n",
|
222 |
+
"runs_this_over = df['Cumulative Runs'].diff().fillna(df['Cumulative Runs'])\n",
|
223 |
+
"win_prob = df['Win Probability (%)']\n",
|
224 |
+
"\n",
|
225 |
+
"# Create plot\n",
|
226 |
+
"fig, ax1 = plt.subplots(figsize=(14, 6))\n",
|
227 |
+
"\n",
|
228 |
+
"# 🟦 Bar: Runs per over\n",
|
229 |
+
"bars = ax1.bar(overs, runs_this_over, color='dodgerblue', label='Runs This Over')\n",
|
230 |
+
"ax1.set_xlabel(\"Over\", fontsize=12)\n",
|
231 |
+
"ax1.set_ylabel(\"Runs Scored\", color='dodgerblue', fontsize=12)\n",
|
232 |
+
"ax1.tick_params(axis='y', labelcolor='dodgerblue')\n",
|
233 |
+
"ax1.set_xticks(range(1, 21))\n",
|
234 |
+
"\n",
|
235 |
+
"# 🟧 Line: Win Probability %\n",
|
236 |
+
"ax2 = ax1.twinx()\n",
|
237 |
+
"ax2.plot(overs, win_prob, color='orange', linewidth=2.5, label='Win Probability (%)')\n",
|
238 |
+
"ax2.set_ylabel(\"Win Probability (%)\", color='orange', fontsize=12)\n",
|
239 |
+
"ax2.tick_params(axis='y', labelcolor='orange')\n",
|
240 |
+
"\n",
|
241 |
+
"# 🎯 Title and Layout\n",
|
242 |
+
"plt.title(\"🏏 Match Momentum Dashboard – Runs vs Win Probability\", fontsize=15, fontweight='bold')\n",
|
243 |
+
"fig.tight_layout()\n",
|
244 |
+
"\n",
|
245 |
+
"# Save output\n",
|
246 |
+
"momentum_plot_path = \"/content/drive/MyDrive/Colab Notebooks/IPLPrediction/match_momentum_dashboard.png\"\n",
|
247 |
+
"plt.savefig(momentum_plot_path, dpi=300)\n",
|
248 |
+
"plt.show()\n",
|
249 |
+
"\n",
|
250 |
+
"print(f\"✅ Momentum dashboard saved to: {momentum_plot_path}\")\n"
|
251 |
+
]
|
252 |
+
},
|
253 |
+
{
|
254 |
+
"cell_type": "code",
|
255 |
+
"execution_count": null,
|
256 |
+
"metadata": {
|
257 |
+
"colab": {
|
258 |
+
"base_uri": "https://localhost:8080/"
|
259 |
+
},
|
260 |
+
"executionInfo": {
|
261 |
+
"elapsed": 6907,
|
262 |
+
"status": "ok",
|
263 |
+
"timestamp": 1744101439165,
|
264 |
+
"user": {
|
265 |
+
"displayName": "Dinesh Kumar",
|
266 |
+
"userId": "18299454607260962281"
|
267 |
+
},
|
268 |
+
"user_tz": -330
|
269 |
+
},
|
270 |
+
"id": "GoZr1Knoi3sf",
|
271 |
+
"outputId": "f7774c23-585d-4ac2-808c-da79fbc52ab4"
|
272 |
+
},
|
273 |
+
"outputs": [],
|
274 |
+
"source": [
|
275 |
+
"!pip install streamlit"
|
276 |
+
]
|
277 |
+
},
|
278 |
+
{
|
279 |
+
"cell_type": "code",
|
280 |
+
"execution_count": null,
|
281 |
+
"metadata": {
|
282 |
+
"colab": {
|
283 |
+
"base_uri": "https://localhost:8080/"
|
284 |
+
},
|
285 |
+
"executionInfo": {
|
286 |
+
"elapsed": 5762,
|
287 |
+
"status": "ok",
|
288 |
+
"timestamp": 1744101743444,
|
289 |
+
"user": {
|
290 |
+
"displayName": "Dinesh Kumar",
|
291 |
+
"userId": "18299454607260962281"
|
292 |
+
},
|
293 |
+
"user_tz": -330
|
294 |
+
},
|
295 |
+
"id": "Ew5xg6xxizSM",
|
296 |
+
"outputId": "9655ba3b-e7b5-49a4-b5ea-a4580ad8c081"
|
297 |
+
},
|
298 |
+
"outputs": [],
|
299 |
+
"source": [
|
300 |
+
"!pip uninstall matplotlib -y\n",
|
301 |
+
"!pip install matplotlib --upgrade --force-reinstall\n"
|
302 |
+
]
|
303 |
+
},
|
304 |
+
{
|
305 |
+
"cell_type": "code",
|
306 |
+
"execution_count": null,
|
307 |
+
"metadata": {},
|
308 |
+
"outputs": [],
|
309 |
+
"source": [
|
310 |
+
"!pip install matplotlib"
|
311 |
+
]
|
312 |
+
},
|
313 |
+
{
|
314 |
+
"cell_type": "code",
|
315 |
+
"execution_count": null,
|
316 |
+
"metadata": {},
|
317 |
+
"outputs": [],
|
318 |
+
"source": [
|
319 |
+
"!pip install scipy==1.13.0 scikit-learn==1.4.1.post1 pillow==10.2.0"
|
320 |
+
]
|
321 |
+
},
|
322 |
+
{
|
323 |
+
"cell_type": "code",
|
324 |
+
"execution_count": 3,
|
325 |
+
"metadata": {},
|
326 |
+
"outputs": [],
|
327 |
+
"source": [
|
328 |
+
"import numpy as np\n",
|
329 |
+
"import joblib\n",
|
330 |
+
"from tensorflow.keras.models import load_model\n",
|
331 |
+
"\n",
|
332 |
+
"def simulate_gru_final_score(current_runs, current_overs, wickets, gru_model_path, run_scaler_path, score_scaler_path):\n",
|
333 |
+
" \"\"\"\n",
|
334 |
+
" Simulate final score from current match state using trained GRU model.\n",
|
335 |
+
"\n",
|
336 |
+
" Parameters:\n",
|
337 |
+
" - current_runs: list of cumulative runs till current over (length = current_overs)\n",
|
338 |
+
" - current_overs: int (number of completed overs)\n",
|
339 |
+
" - wickets: int (optional, not used in prediction directly)\n",
|
340 |
+
" - gru_model_path: path to trained GRU .keras model\n",
|
341 |
+
" - run_scaler_path: fitted MinMaxScaler for input sequence (joblib path)\n",
|
342 |
+
" - score_scaler_path: fitted MinMaxScaler for output (joblib path)\n",
|
343 |
+
"\n",
|
344 |
+
" Returns:\n",
|
345 |
+
" - predicted_final_score (float)\n",
|
346 |
+
" \"\"\"\n",
|
347 |
+
" # Load scalers\n",
|
348 |
+
" input_scaler = joblib.load(run_scaler_path)\n",
|
349 |
+
" output_scaler = joblib.load(score_scaler_path)\n",
|
350 |
+
"\n",
|
351 |
+
" # Load GRU model\n",
|
352 |
+
" model = load_model(gru_model_path, compile=False)\n",
|
353 |
+
"\n",
|
354 |
+
" # Pad sequence to 20 overs\n",
|
355 |
+
" seq = np.array(current_runs).reshape(-1, 1)\n",
|
356 |
+
" padded_seq = np.pad(seq, ((0, 20 - len(seq)), (0, 0)), mode='constant')\n",
|
357 |
+
"\n",
|
358 |
+
" # Scale input\n",
|
359 |
+
" scaled_input = input_scaler.transform(padded_seq).reshape(1, 20, 1)\n",
|
360 |
+
"\n",
|
361 |
+
" # Predict\n",
|
362 |
+
" pred_scaled = model.predict(scaled_input, verbose=0)\n",
|
363 |
+
" predicted_final_score = output_scaler.inverse_transform(pred_scaled)[0][0]\n",
|
364 |
+
"\n",
|
365 |
+
" return round(predicted_final_score, 2)\n"
|
366 |
+
]
|
367 |
+
},
|
368 |
+
{
|
369 |
+
"cell_type": "code",
|
370 |
+
"execution_count": 4,
|
371 |
+
"metadata": {},
|
372 |
+
"outputs": [
|
373 |
+
{
|
374 |
+
"name": "stderr",
|
375 |
+
"output_type": "stream",
|
376 |
+
"text": [
|
377 |
+
"WARNING:absl:The `save_format` argument is deprecated in Keras 3. We recommend removing this argument as it can be inferred from the file path. Received: save_format=keras\n"
|
378 |
+
]
|
379 |
+
}
|
380 |
+
],
|
381 |
+
"source": [
|
382 |
+
"from tensorflow.keras.models import load_model\n",
|
383 |
+
"\n",
|
384 |
+
"# Load the trained .h5 model\n",
|
385 |
+
"model = load_model(\"gru_score_predictor.h5\", compile=False)\n",
|
386 |
+
"\n",
|
387 |
+
"# Save in .keras format\n",
|
388 |
+
"model.save(\"gru_score_predictor.keras\", save_format=\"keras\")\n"
|
389 |
+
]
|
390 |
+
},
|
391 |
+
{
|
392 |
+
"cell_type": "code",
|
393 |
+
"execution_count": 2,
|
394 |
+
"metadata": {},
|
395 |
+
"outputs": [
|
396 |
+
{
|
397 |
+
"data": {
|
398 |
+
"text/plain": [
|
399 |
+
"['scaler_output.save']"
|
400 |
+
]
|
401 |
+
},
|
402 |
+
"execution_count": 2,
|
403 |
+
"metadata": {},
|
404 |
+
"output_type": "execute_result"
|
405 |
+
}
|
406 |
+
],
|
407 |
+
"source": [
|
408 |
+
"import joblib\n",
|
409 |
+
"import numpy as np\n",
|
410 |
+
"from sklearn.preprocessing import MinMaxScaler\n",
|
411 |
+
"\n",
|
412 |
+
"# Simulate training data (same structure as used earlier)\n",
|
413 |
+
"cumulative_runs = np.random.randint(0, 200, size=(400, 1)) # mimic overwise cumulative runs\n",
|
414 |
+
"final_scores = np.random.randint(100, 220, size=(400, 1)) # mimic final score ranges\n",
|
415 |
+
"\n",
|
416 |
+
"# Create and fit scalers\n",
|
417 |
+
"scaler_input = MinMaxScaler().fit(cumulative_runs)\n",
|
418 |
+
"scaler_output = MinMaxScaler().fit(final_scores)\n",
|
419 |
+
"\n",
|
420 |
+
"# Save scalers for future use\n",
|
421 |
+
"joblib.dump(scaler_input, 'scaler_input.save')\n",
|
422 |
+
"joblib.dump(scaler_output, 'scaler_output.save')\n"
|
423 |
+
]
|
424 |
+
},
|
425 |
+
{
|
426 |
+
"cell_type": "code",
|
427 |
+
"execution_count": 1,
|
428 |
+
"metadata": {},
|
429 |
+
"outputs": [
|
430 |
+
{
|
431 |
+
"name": "stderr",
|
432 |
+
"output_type": "stream",
|
433 |
+
"text": [
|
434 |
+
"C:\\Users\\Dine24\\anaconda3\\Lib\\site-packages\\keras\\src\\layers\\rnn\\rnn.py:200: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.\n",
|
435 |
+
" super().__init__(**kwargs)\n"
|
436 |
+
]
|
437 |
+
},
|
438 |
+
{
|
439 |
+
"data": {
|
440 |
+
"text/plain": [
|
441 |
+
"0.0034383272286504507"
|
442 |
+
]
|
443 |
+
},
|
444 |
+
"execution_count": 1,
|
445 |
+
"metadata": {},
|
446 |
+
"output_type": "execute_result"
|
447 |
+
}
|
448 |
+
],
|
449 |
+
"source": [
|
450 |
+
"# Re-execute after environment reset\n",
|
451 |
+
"import numpy as np\n",
|
452 |
+
"import pandas as pd\n",
|
453 |
+
"from sklearn.preprocessing import MinMaxScaler\n",
|
454 |
+
"from tensorflow.keras.models import Sequential\n",
|
455 |
+
"from tensorflow.keras.layers import GRU, Dense\n",
|
456 |
+
"from tensorflow.keras.callbacks import EarlyStopping\n",
|
457 |
+
"import joblib\n",
|
458 |
+
"import os\n",
|
459 |
+
"\n",
|
460 |
+
"# Step 1: Simulate sample training data (Runs + Wickets as input, Final Score as output)\n",
|
461 |
+
"np.random.seed(42)\n",
|
462 |
+
"\n",
|
463 |
+
"# Generate 500 samples\n",
|
464 |
+
"samples = 500\n",
|
465 |
+
"overs = 20\n",
|
466 |
+
"\n",
|
467 |
+
"# Random per-over runs (0 to 20)\n",
|
468 |
+
"runs_per_over = np.random.randint(0, 21, size=(samples, overs))\n",
|
469 |
+
"\n",
|
470 |
+
"# Random per-over wickets (0 to 2)\n",
|
471 |
+
"wickets_per_over = np.random.randint(0, 3, size=(samples, overs))\n",
|
472 |
+
"\n",
|
473 |
+
"# Cumulative input: concatenate cumulative runs and cumulative wickets\n",
|
474 |
+
"cumulative_runs = np.cumsum(runs_per_over, axis=1)\n",
|
475 |
+
"cumulative_wickets = np.cumsum(wickets_per_over, axis=1)\n",
|
476 |
+
"\n",
|
477 |
+
"# Combine features\n",
|
478 |
+
"X_combined = np.stack((cumulative_runs, cumulative_wickets), axis=2) # shape = (samples, 20, 2)\n",
|
479 |
+
"\n",
|
480 |
+
"# Generate final scores (simulate realistic final score with some noise)\n",
|
481 |
+
"final_scores = cumulative_runs[:, -1] + np.random.normal(loc=5.0, scale=10.0, size=(samples,))\n",
|
482 |
+
"final_scores = final_scores.reshape(-1, 1)\n",
|
483 |
+
"\n",
|
484 |
+
"# Step 2: Normalize\n",
|
485 |
+
"input_scaler = MinMaxScaler()\n",
|
486 |
+
"output_scaler = MinMaxScaler()\n",
|
487 |
+
"\n",
|
488 |
+
"X_scaled = input_scaler.fit_transform(X_combined.reshape(-1, 2)).reshape(samples, overs, 2)\n",
|
489 |
+
"y_scaled = output_scaler.fit_transform(final_scores)\n",
|
490 |
+
"\n",
|
491 |
+
"# Step 3: Build GRU model\n",
|
492 |
+
"model = Sequential()\n",
|
493 |
+
"model.add(GRU(64, input_shape=(20, 2), return_sequences=False))\n",
|
494 |
+
"model.add(Dense(1))\n",
|
495 |
+
"model.compile(optimizer='adam', loss='mse')\n",
|
496 |
+
"\n",
|
497 |
+
"# Step 4: Train\n",
|
498 |
+
"early_stop = EarlyStopping(monitor='val_loss', patience=5, restore_best_weights=True)\n",
|
499 |
+
"history = model.fit(X_scaled, y_scaled, epochs=50, batch_size=32, validation_split=0.2, callbacks=[early_stop], verbose=0)\n",
|
500 |
+
"\n",
|
501 |
+
"# Step 5: Save model and scalers\n",
|
502 |
+
"os.makedirs(\"trained_model\", exist_ok=True)\n",
|
503 |
+
"model.save(\"trained_model/gru_runs_wickets.keras\")\n",
|
504 |
+
"joblib.dump(input_scaler, \"trained_model/scaler_input_rw.save\")\n",
|
505 |
+
"joblib.dump(output_scaler, \"trained_model/scaler_output_rw.save\")\n",
|
506 |
+
"\n",
|
507 |
+
"# Return final loss to confirm successful training\n",
|
508 |
+
"final_loss = history.history['val_loss'][-1]\n",
|
509 |
+
"final_loss\n"
|
510 |
+
]
|
511 |
+
},
|
512 |
+
{
|
513 |
+
"cell_type": "code",
|
514 |
+
"execution_count": null,
|
515 |
+
"metadata": {
|
516 |
+
"colab": {
|
517 |
+
"base_uri": "https://localhost:8080/"
|
518 |
+
},
|
519 |
+
"id": "ql4r1e5hkcG1",
|
520 |
+
"outputId": "4c067f05-a996-4c2d-b265-3124b6ed99e1"
|
521 |
+
},
|
522 |
+
"outputs": [],
|
523 |
+
"source": [
|
524 |
+
"!streamlit run app.py\n"
|
525 |
+
]
|
526 |
+
},
|
527 |
+
{
|
528 |
+
"cell_type": "code",
|
529 |
+
"execution_count": null,
|
530 |
+
"metadata": {},
|
531 |
+
"outputs": [],
|
532 |
+
"source": [
|
533 |
+
"!streamlit run match_simulator.py\n"
|
534 |
+
]
|
535 |
+
},
|
536 |
+
{
|
537 |
+
"cell_type": "code",
|
538 |
+
"execution_count": 1,
|
539 |
+
"metadata": {},
|
540 |
+
"outputs": [
|
541 |
+
{
|
542 |
+
"name": "stdout",
|
543 |
+
"output_type": "stream",
|
544 |
+
"text": [
|
545 |
+
"Requirement already satisfied: ace_tools in c:\\users\\dine24\\anaconda3\\lib\\site-packages (0.0)\n"
|
546 |
+
]
|
547 |
+
},
|
548 |
+
{
|
549 |
+
"name": "stderr",
|
550 |
+
"output_type": "stream",
|
551 |
+
"text": [
|
552 |
+
"WARNING: Ignoring invalid distribution ~onttools (C:\\Users\\Dine24\\anaconda3\\Lib\\site-packages)\n",
|
553 |
+
"WARNING: Ignoring invalid distribution ~onttools (C:\\Users\\Dine24\\anaconda3\\Lib\\site-packages)\n",
|
554 |
+
"WARNING: Ignoring invalid distribution ~onttools (C:\\Users\\Dine24\\anaconda3\\Lib\\site-packages)\n"
|
555 |
+
]
|
556 |
+
}
|
557 |
+
],
|
558 |
+
"source": [
|
559 |
+
"!pip install ace_tools"
|
560 |
+
]
|
561 |
+
},
|
562 |
+
{
|
563 |
+
"cell_type": "code",
|
564 |
+
"execution_count": null,
|
565 |
+
"metadata": {},
|
566 |
+
"outputs": [],
|
567 |
+
"source": [
|
568 |
+
"!streamlit run \"C:/Users/Dine24/Python Course/IPL_Cricket/trained_model/match_simulator_rw.py\""
|
569 |
+
]
|
570 |
+
},
|
571 |
+
{
|
572 |
+
"cell_type": "code",
|
573 |
+
"execution_count": 5,
|
574 |
+
"metadata": {},
|
575 |
+
"outputs": [
|
576 |
+
{
|
577 |
+
"name": "stderr",
|
578 |
+
"output_type": "stream",
|
579 |
+
"text": [
|
580 |
+
"C:\\Users\\Dine24\\anaconda3\\Lib\\site-packages\\keras\\src\\layers\\rnn\\rnn.py:200: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.\n",
|
581 |
+
" super().__init__(**kwargs)\n"
|
582 |
+
]
|
583 |
+
},
|
584 |
+
{
|
585 |
+
"data": {
|
586 |
+
"text/plain": [
|
587 |
+
"198.30263"
|
588 |
+
]
|
589 |
+
},
|
590 |
+
"execution_count": 5,
|
591 |
+
"metadata": {},
|
592 |
+
"output_type": "execute_result"
|
593 |
+
}
|
594 |
+
],
|
595 |
+
"source": [
|
596 |
+
"import numpy as np\n",
|
597 |
+
"import pandas as pd\n",
|
598 |
+
"from tensorflow.keras.models import Sequential\n",
|
599 |
+
"from tensorflow.keras.layers import GRU, Dense\n",
|
600 |
+
"from sklearn.preprocessing import MinMaxScaler\n",
|
601 |
+
"import joblib\n",
|
602 |
+
"\n",
|
603 |
+
"# Simulate training data (runs + wickets as input, final score as output)\n",
|
604 |
+
"np.random.seed(42)\n",
|
605 |
+
"num_samples = 500\n",
|
606 |
+
"\n",
|
607 |
+
"# Generate random over-wise data for 20 overs\n",
|
608 |
+
"runs_data = np.random.randint(0, 21, size=(num_samples, 20)) # 0-20 runs per over\n",
|
609 |
+
"wickets_data = np.random.binomial(1, 0.3, size=(num_samples, 20)) # 0 or 1 wickets per over\n",
|
610 |
+
"\n",
|
611 |
+
"# Input shape: [samples, 20 overs, 2 features]\n",
|
612 |
+
"X = np.stack((runs_data, wickets_data), axis=2)\n",
|
613 |
+
"\n",
|
614 |
+
"# Output: final scores with some variation based on runs and wickets\n",
|
615 |
+
"final_scores = runs_data.sum(axis=1) + np.random.normal(0, 5, size=num_samples) - (wickets_data.sum(axis=1) * 2)\n",
|
616 |
+
"y = final_scores.reshape(-1, 1)\n",
|
617 |
+
"\n",
|
618 |
+
"# Normalize inputs and outputs\n",
|
619 |
+
"scaler_input = MinMaxScaler()\n",
|
620 |
+
"X_reshaped = X.reshape(-1, 2)\n",
|
621 |
+
"X_scaled = scaler_input.fit_transform(X_reshaped).reshape(num_samples, 20, 2)\n",
|
622 |
+
"\n",
|
623 |
+
"scaler_output = MinMaxScaler()\n",
|
624 |
+
"y_scaled = scaler_output.fit_transform(y)\n",
|
625 |
+
"\n",
|
626 |
+
"# Define GRU model\n",
|
627 |
+
"model = Sequential([\n",
|
628 |
+
" GRU(64, input_shape=(20, 2), return_sequences=False),\n",
|
629 |
+
" Dense(1)\n",
|
630 |
+
"])\n",
|
631 |
+
"model.compile(optimizer='adam', loss='mse')\n",
|
632 |
+
"model.fit(X_scaled, y_scaled, epochs=10, batch_size=32, verbose=0)\n",
|
633 |
+
"\n",
|
634 |
+
"# Save model and scalers\n",
|
635 |
+
"model.save(\"match_live_predictor/gru_score_predictor_rw.keras\")\n",
|
636 |
+
"joblib.dump(scaler_input, \"scaler_rw_input.save\")\n",
|
637 |
+
"joblib.dump(scaler_output, \"scaler_rw_output.save\")\n",
|
638 |
+
"\n",
|
639 |
+
"# Predict on a new random sample for validation\n",
|
640 |
+
"sample_index = 0\n",
|
641 |
+
"sample_input = X_scaled[sample_index:sample_index+1]\n",
|
642 |
+
"pred_scaled = model.predict(sample_input, verbose=0)\n",
|
643 |
+
"predicted_score = scaler_output.inverse_transform(pred_scaled)[0][0]\n",
|
644 |
+
"\n",
|
645 |
+
"predicted_score\n"
|
646 |
+
]
|
647 |
+
},
|
648 |
+
{
|
649 |
+
"cell_type": "code",
|
650 |
+
"execution_count": 1,
|
651 |
+
"metadata": {},
|
652 |
+
"outputs": [
|
653 |
+
{
|
654 |
+
"name": "stdout",
|
655 |
+
"output_type": "stream",
|
656 |
+
"text": [
|
657 |
+
"✅ Scalers saved successfully!\n"
|
658 |
+
]
|
659 |
+
}
|
660 |
+
],
|
661 |
+
"source": [
|
662 |
+
"# scaler_preparation_rw.py\n",
|
663 |
+
"import numpy as np\n",
|
664 |
+
"import joblib\n",
|
665 |
+
"from sklearn.preprocessing import MinMaxScaler\n",
|
666 |
+
"\n",
|
667 |
+
"# Simulated dummy data for fitting scalers\n",
|
668 |
+
"runs_input = np.random.randint(0, 220, size=(400, 2)) # 2 features: runs + wickets\n",
|
669 |
+
"final_scores = np.random.randint(100, 250, size=(400, 1))\n",
|
670 |
+
"\n",
|
671 |
+
"# Create and fit scalers\n",
|
672 |
+
"scaler_input_rw = MinMaxScaler().fit(runs_input)\n",
|
673 |
+
"scaler_output_rw = MinMaxScaler().fit(final_scores)\n",
|
674 |
+
"\n",
|
675 |
+
"# Save scalers\n",
|
676 |
+
"joblib.dump(scaler_input_rw, 'match_live_predictor/scaler_input_rw.save')\n",
|
677 |
+
"joblib.dump(scaler_output_rw, 'match_live_predictor/scaler_output_rw.save')\n",
|
678 |
+
"\n",
|
679 |
+
"print(\"✅ Scalers saved successfully!\")\n"
|
680 |
+
]
|
681 |
+
},
|
682 |
+
{
|
683 |
+
"cell_type": "code",
|
684 |
+
"execution_count": 1,
|
685 |
+
"metadata": {},
|
686 |
+
"outputs": [
|
687 |
+
{
|
688 |
+
"name": "stdout",
|
689 |
+
"output_type": "stream",
|
690 |
+
"text": [
|
691 |
+
"Epoch 1/50\n",
|
692 |
+
"\n",
|
693 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m40s\u001b[0m 1s/step - loss: 0.1794\n",
|
694 |
+
"\u001b[1m12/32\u001b[0m \u001b[32m=======\u001b[0m\u001b[37m=============\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.1057\n",
|
695 |
+
"\u001b[1m24/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0790\n",
|
696 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 5ms/step - loss: 0.0690\n",
|
697 |
+
"Epoch 2/50\n",
|
698 |
+
"\n",
|
699 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 26ms/step - loss: 0.0300\n",
|
700 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0237 \n",
|
701 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0231\n",
|
702 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0226\n",
|
703 |
+
"Epoch 3/50\n",
|
704 |
+
"\n",
|
705 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 25ms/step - loss: 0.0166\n",
|
706 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0191 \n",
|
707 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0193\n",
|
708 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0192\n",
|
709 |
+
"Epoch 4/50\n",
|
710 |
+
"\n",
|
711 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 25ms/step - loss: 0.0129\n",
|
712 |
+
"\u001b[1m14/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0187 \n",
|
713 |
+
"\u001b[1m26/32\u001b[0m \u001b[32m================\u001b[0m\u001b[37m====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0177\n",
|
714 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0173\n",
|
715 |
+
"Epoch 5/50\n",
|
716 |
+
"\n",
|
717 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 25ms/step - loss: 0.0137\n",
|
718 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0134 \n",
|
719 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0130\n",
|
720 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0128\n",
|
721 |
+
"Epoch 6/50\n",
|
722 |
+
"\n",
|
723 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 24ms/step - loss: 0.0071\n",
|
724 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0091 \n",
|
725 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0089\n",
|
726 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0088\n",
|
727 |
+
"Epoch 7/50\n",
|
728 |
+
"\n",
|
729 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 25ms/step - loss: 0.0048\n",
|
730 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0064 \n",
|
731 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0072\n",
|
732 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0074\n",
|
733 |
+
"Epoch 8/50\n",
|
734 |
+
"\n",
|
735 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 27ms/step - loss: 0.0090\n",
|
736 |
+
"\u001b[1m12/32\u001b[0m \u001b[32m=======\u001b[0m\u001b[37m=============\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0091 \n",
|
737 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0093\n",
|
738 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0094\n",
|
739 |
+
"Epoch 9/50\n",
|
740 |
+
"\n",
|
741 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 24ms/step - loss: 0.0090\n",
|
742 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0073 \n",
|
743 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0072\n",
|
744 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0072\n",
|
745 |
+
"Epoch 10/50\n",
|
746 |
+
"\n",
|
747 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 24ms/step - loss: 0.0089\n",
|
748 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0069 \n",
|
749 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0070\n",
|
750 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0071\n",
|
751 |
+
"Epoch 11/50\n",
|
752 |
+
"\n",
|
753 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 26ms/step - loss: 0.0095\n",
|
754 |
+
"\u001b[1m14/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0139 \n",
|
755 |
+
"\u001b[1m26/32\u001b[0m \u001b[32m================\u001b[0m\u001b[37m====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0128\n",
|
756 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0123\n",
|
757 |
+
"Epoch 12/50\n",
|
758 |
+
"\n",
|
759 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 27ms/step - loss: 0.0049\n",
|
760 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0088 \n",
|
761 |
+
"\u001b[1m26/32\u001b[0m \u001b[32m================\u001b[0m\u001b[37m====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0083\n",
|
762 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0080\n",
|
763 |
+
"Epoch 13/50\n",
|
764 |
+
"\n",
|
765 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 23ms/step - loss: 0.0098\n",
|
766 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0074 \n",
|
767 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 4ms/step - loss: 0.0070\n",
|
768 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 5ms/step - loss: 0.0069\n",
|
769 |
+
"Epoch 14/50\n",
|
770 |
+
"\n",
|
771 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 38ms/step - loss: 0.0067\n",
|
772 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0090\n",
|
773 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0085\n",
|
774 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0081\n",
|
775 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0079\n",
|
776 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0077\n",
|
777 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0075\n",
|
778 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0074\n",
|
779 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 17ms/step - loss: 0.0074\n",
|
780 |
+
"Epoch 15/50\n",
|
781 |
+
"\n",
|
782 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 39ms/step - loss: 0.0061\n",
|
783 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0051\n",
|
784 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0052\n",
|
785 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0055\n",
|
786 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0058\n",
|
787 |
+
"\u001b[1m20/32\u001b[0m \u001b[32m============\u001b[0m\u001b[37m========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0059\n",
|
788 |
+
"\u001b[1m24/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0061\n",
|
789 |
+
"\u001b[1m28/32\u001b[0m \u001b[32m=================\u001b[0m\u001b[37m===\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0062\n",
|
790 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0063\n",
|
791 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0063\n",
|
792 |
+
"Epoch 16/50\n",
|
793 |
+
"\n",
|
794 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 38ms/step - loss: 0.0059\n",
|
795 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0061\n",
|
796 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0062\n",
|
797 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0062\n",
|
798 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0064\n",
|
799 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0064\n",
|
800 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0064\n",
|
801 |
+
"\u001b[1m30/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0065\n",
|
802 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0065\n",
|
803 |
+
"Epoch 17/50\n",
|
804 |
+
"\n",
|
805 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 61ms/step - loss: 0.0091\n",
|
806 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0082\n",
|
807 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0081\n",
|
808 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0079\n",
|
809 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0076\n",
|
810 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0073\n",
|
811 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0072\n",
|
812 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 14ms/step - loss: 0.0071\n",
|
813 |
+
"Epoch 18/50\n",
|
814 |
+
"\n",
|
815 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 35ms/step - loss: 0.0056\n",
|
816 |
+
"\u001b[1m 6/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0070\n",
|
817 |
+
"\u001b[1m10/32\u001b[0m \u001b[32m======\u001b[0m\u001b[37m==============\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0070\n",
|
818 |
+
"\u001b[1m14/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0071\n",
|
819 |
+
"\u001b[1m18/32\u001b[0m \u001b[32m===========\u001b[0m\u001b[37m=========\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0071\n",
|
820 |
+
"\u001b[1m22/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0071\n",
|
821 |
+
"\u001b[1m26/32\u001b[0m \u001b[32m================\u001b[0m\u001b[37m====\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0071\n",
|
822 |
+
"\u001b[1m30/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0071\n",
|
823 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0071\n",
|
824 |
+
"Epoch 19/50\n",
|
825 |
+
"\n",
|
826 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 63ms/step - loss: 0.0039\n",
|
827 |
+
"\u001b[1m 6/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0072\n",
|
828 |
+
"\u001b[1m10/32\u001b[0m \u001b[32m======\u001b[0m\u001b[37m==============\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0076\n",
|
829 |
+
"\u001b[1m14/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0076\n",
|
830 |
+
"\u001b[1m18/32\u001b[0m \u001b[32m===========\u001b[0m\u001b[37m=========\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0075\n",
|
831 |
+
"\u001b[1m22/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0075\n",
|
832 |
+
"\u001b[1m26/32\u001b[0m \u001b[32m================\u001b[0m\u001b[37m====\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0074\n",
|
833 |
+
"\u001b[1m30/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0073\n",
|
834 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 15ms/step - loss: 0.0072\n",
|
835 |
+
"Epoch 20/50\n",
|
836 |
+
"\n",
|
837 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 45ms/step - loss: 0.0049\n",
|
838 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0054\n",
|
839 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0063\n",
|
840 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0066\n",
|
841 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0068\n",
|
842 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0070\n",
|
843 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0071\n",
|
844 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0071\n",
|
845 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 15ms/step - loss: 0.0071\n",
|
846 |
+
"Epoch 21/50\n",
|
847 |
+
"\n",
|
848 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m0s\u001b[0m 31ms/step - loss: 0.0041\n",
|
849 |
+
"\u001b[1m 6/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0059\n",
|
850 |
+
"\u001b[1m10/32\u001b[0m \u001b[32m======\u001b[0m\u001b[37m==============\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0060\n",
|
851 |
+
"\u001b[1m14/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0061\n",
|
852 |
+
"\u001b[1m18/32\u001b[0m \u001b[32m===========\u001b[0m\u001b[37m=========\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0061\n",
|
853 |
+
"\u001b[1m22/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0060\n",
|
854 |
+
"\u001b[1m26/32\u001b[0m \u001b[32m================\u001b[0m\u001b[37m====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0061\n",
|
855 |
+
"\u001b[1m30/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0062\n",
|
856 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0062\n",
|
857 |
+
"Epoch 22/50\n",
|
858 |
+
"\n",
|
859 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 59ms/step - loss: 0.0121\n",
|
860 |
+
"\u001b[1m 6/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0076\n",
|
861 |
+
"\u001b[1m10/32\u001b[0m \u001b[32m======\u001b[0m\u001b[37m==============\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0077\n",
|
862 |
+
"\u001b[1m14/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0077\n",
|
863 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0078\n",
|
864 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0078\n",
|
865 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0078\n",
|
866 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0078\n",
|
867 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0078\n",
|
868 |
+
"Epoch 23/50\n",
|
869 |
+
"\n",
|
870 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 64ms/step - loss: 0.0083\n",
|
871 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0076\n",
|
872 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0072\n",
|
873 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0071\n",
|
874 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0073\n",
|
875 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0073\n",
|
876 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0073\n",
|
877 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0073\n",
|
878 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0073\n",
|
879 |
+
"Epoch 24/50\n",
|
880 |
+
"\n",
|
881 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m2s\u001b[0m 84ms/step - loss: 0.0107\n",
|
882 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0076\n",
|
883 |
+
"\u001b[1m 8/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0074\n",
|
884 |
+
"\u001b[1m12/32\u001b[0m \u001b[32m=======\u001b[0m\u001b[37m=============\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0072\n",
|
885 |
+
"\u001b[1m16/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0071\n",
|
886 |
+
"\u001b[1m20/32\u001b[0m \u001b[32m============\u001b[0m\u001b[37m========\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0070\n",
|
887 |
+
"\u001b[1m24/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0070\n",
|
888 |
+
"\u001b[1m28/32\u001b[0m \u001b[32m=================\u001b[0m\u001b[37m===\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0069\n",
|
889 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0069\n",
|
890 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0069\n",
|
891 |
+
"Epoch 25/50\n",
|
892 |
+
"\n",
|
893 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 53ms/step - loss: 0.0113\n",
|
894 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0110\n",
|
895 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0105\n",
|
896 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0100\n",
|
897 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0096\n",
|
898 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0093\n",
|
899 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0090\n",
|
900 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0087\n",
|
901 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 15ms/step - loss: 0.0085\n",
|
902 |
+
"Epoch 26/50\n",
|
903 |
+
"\n",
|
904 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 38ms/step - loss: 0.0050\n",
|
905 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0070\n",
|
906 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0073\n",
|
907 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0074\n",
|
908 |
+
"\u001b[1m19/32\u001b[0m \u001b[32m===========\u001b[0m\u001b[37m=========\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0073\n",
|
909 |
+
"\u001b[1m28/32\u001b[0m \u001b[32m=================\u001b[0m\u001b[37m===\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0072\n",
|
910 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0071\n",
|
911 |
+
"Epoch 27/50\n",
|
912 |
+
"\n",
|
913 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 37ms/step - loss: 0.0115\n",
|
914 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0100\n",
|
915 |
+
"\u001b[1m10/32\u001b[0m \u001b[32m======\u001b[0m\u001b[37m==============\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0087\n",
|
916 |
+
"\u001b[1m16/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0081\n",
|
917 |
+
"\u001b[1m22/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0078\n",
|
918 |
+
"\u001b[1m28/32\u001b[0m \u001b[32m=================\u001b[0m\u001b[37m===\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0075\n",
|
919 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0074\n",
|
920 |
+
"Epoch 28/50\n",
|
921 |
+
"\n",
|
922 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 49ms/step - loss: 0.0046\n",
|
923 |
+
"\u001b[1m 8/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - loss: 0.0065 \n",
|
924 |
+
"\u001b[1m14/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - loss: 0.0065\n",
|
925 |
+
"\u001b[1m23/32\u001b[0m \u001b[32m==============\u001b[0m\u001b[37m======\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - loss: 0.0067\n",
|
926 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - loss: 0.0068\n",
|
927 |
+
"Epoch 29/50\n",
|
928 |
+
"\n",
|
929 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 51ms/step - loss: 0.0080\n",
|
930 |
+
"\u001b[1m 6/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0070\n",
|
931 |
+
"\u001b[1m12/32\u001b[0m \u001b[32m=======\u001b[0m\u001b[37m=============\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0071\n",
|
932 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0071\n",
|
933 |
+
"\u001b[1m22/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0071\n",
|
934 |
+
"\u001b[1m31/32\u001b[0m \u001b[32m===================\u001b[0m\u001b[37m=\u001b[0m \u001b[1m0s\u001b[0m 9ms/step - loss: 0.0071 \n",
|
935 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0071\n",
|
936 |
+
"Epoch 30/50\n",
|
937 |
+
"\n",
|
938 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 44ms/step - loss: 0.0055\n",
|
939 |
+
"\u001b[1m 6/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0059\n",
|
940 |
+
"\u001b[1m11/32\u001b[0m \u001b[32m======\u001b[0m\u001b[37m==============\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0057\n",
|
941 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0059\n",
|
942 |
+
"\u001b[1m23/32\u001b[0m \u001b[32m==============\u001b[0m\u001b[37m======\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0059\n",
|
943 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0060\n",
|
944 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0061\n",
|
945 |
+
"Epoch 31/50\n",
|
946 |
+
"\n",
|
947 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 47ms/step - loss: 0.0066\n",
|
948 |
+
"\u001b[1m 6/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0070\n",
|
949 |
+
"\u001b[1m12/32\u001b[0m \u001b[32m=======\u001b[0m\u001b[37m=============\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0076\n",
|
950 |
+
"\u001b[1m18/32\u001b[0m \u001b[32m===========\u001b[0m\u001b[37m=========\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0074\n",
|
951 |
+
"\u001b[1m22/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0073\n",
|
952 |
+
"\u001b[1m26/32\u001b[0m \u001b[32m================\u001b[0m\u001b[37m====\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0072\n",
|
953 |
+
"\u001b[1m30/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0071\n",
|
954 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0071\n",
|
955 |
+
"Epoch 32/50\n",
|
956 |
+
"\n",
|
957 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 64ms/step - loss: 0.0041\n",
|
958 |
+
"\u001b[1m 6/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0055\n",
|
959 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 9ms/step - loss: 0.0061 \n",
|
960 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0062\n",
|
961 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0063\n",
|
962 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0063\n",
|
963 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0064\n",
|
964 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 14ms/step - loss: 0.0064\n",
|
965 |
+
"Epoch 33/50\n",
|
966 |
+
"\n",
|
967 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 39ms/step - loss: 0.0060\n",
|
968 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0064\n",
|
969 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0067\n",
|
970 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0071\n",
|
971 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0071\n",
|
972 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0071\n",
|
973 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0070\n",
|
974 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0070\n",
|
975 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0070\n",
|
976 |
+
"Epoch 34/50\n",
|
977 |
+
"\n",
|
978 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 51ms/step - loss: 0.0038\n",
|
979 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0057\n",
|
980 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0063\n",
|
981 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0064\n",
|
982 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0064\n",
|
983 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0065\n",
|
984 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0065\n",
|
985 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0066\n",
|
986 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0066\n",
|
987 |
+
"Epoch 35/50\n",
|
988 |
+
"\n",
|
989 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 53ms/step - loss: 0.0058\n",
|
990 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0063\n",
|
991 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0062\n",
|
992 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0061\n",
|
993 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0061\n",
|
994 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0061\n",
|
995 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0061\n",
|
996 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0062\n",
|
997 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0062\n",
|
998 |
+
"Epoch 36/50\n",
|
999 |
+
"\n",
|
1000 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 53ms/step - loss: 0.0124\n",
|
1001 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0090\n",
|
1002 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0083\n",
|
1003 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0080\n",
|
1004 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0078\n",
|
1005 |
+
"\u001b[1m20/32\u001b[0m \u001b[32m============\u001b[0m\u001b[37m========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0077\n",
|
1006 |
+
"\u001b[1m24/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0076\n",
|
1007 |
+
"\u001b[1m28/32\u001b[0m \u001b[32m=================\u001b[0m\u001b[37m===\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0075\n",
|
1008 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0074\n",
|
1009 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0074\n",
|
1010 |
+
"Epoch 37/50\n",
|
1011 |
+
"\n",
|
1012 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 37ms/step - loss: 0.0065\n",
|
1013 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0063\n",
|
1014 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0061\n",
|
1015 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0059\n",
|
1016 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0059\n",
|
1017 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0060\n",
|
1018 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0061\n",
|
1019 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0061\n",
|
1020 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 17ms/step - loss: 0.0062\n",
|
1021 |
+
"Epoch 38/50\n",
|
1022 |
+
"\n",
|
1023 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 34ms/step - loss: 0.0079\n",
|
1024 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0067\n",
|
1025 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0067\n",
|
1026 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0066\n",
|
1027 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0065\n",
|
1028 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0064\n",
|
1029 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0064\n",
|
1030 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0063\n",
|
1031 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 15ms/step - loss: 0.0063\n",
|
1032 |
+
"Epoch 39/50\n",
|
1033 |
+
"\n",
|
1034 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 46ms/step - loss: 0.0058\n",
|
1035 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0063\n",
|
1036 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0062\n",
|
1037 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0062\n",
|
1038 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0061\n",
|
1039 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0062\n",
|
1040 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0063\n",
|
1041 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0064\n",
|
1042 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0064\n",
|
1043 |
+
"Epoch 40/50\n",
|
1044 |
+
"\n",
|
1045 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 62ms/step - loss: 0.0093\n",
|
1046 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0088\n",
|
1047 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0077\n",
|
1048 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0074\n",
|
1049 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0072\n",
|
1050 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0071\n",
|
1051 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0071\n",
|
1052 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0071\n",
|
1053 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0070\n",
|
1054 |
+
"Epoch 41/50\n",
|
1055 |
+
"\n",
|
1056 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 62ms/step - loss: 0.0059\n",
|
1057 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0064\n",
|
1058 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0067\n",
|
1059 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0070\n",
|
1060 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0071\n",
|
1061 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0070\n",
|
1062 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0070\n",
|
1063 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0070\n",
|
1064 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0070\n",
|
1065 |
+
"Epoch 42/50\n",
|
1066 |
+
"\n",
|
1067 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 61ms/step - loss: 0.0047\n",
|
1068 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0055\n",
|
1069 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0057\n",
|
1070 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0058\n",
|
1071 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0060\n",
|
1072 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0061\n",
|
1073 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0062\n",
|
1074 |
+
"\u001b[1m30/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0063\n",
|
1075 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 15ms/step - loss: 0.0064\n",
|
1076 |
+
"Epoch 43/50\n",
|
1077 |
+
"\n",
|
1078 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 47ms/step - loss: 0.0056\n",
|
1079 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0053\n",
|
1080 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0054\n",
|
1081 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0055\n",
|
1082 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0056\n",
|
1083 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 16ms/step - loss: 0.0058\n",
|
1084 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0059\n",
|
1085 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0060\n",
|
1086 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0061\n",
|
1087 |
+
"Epoch 44/50\n",
|
1088 |
+
"\n",
|
1089 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 57ms/step - loss: 0.0050\n",
|
1090 |
+
"\u001b[1m 8/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - loss: 0.0065 \n",
|
1091 |
+
"\u001b[1m15/32\u001b[0m \u001b[32m=========\u001b[0m\u001b[37m===========\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - loss: 0.0069\n",
|
1092 |
+
"\u001b[1m22/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - loss: 0.0070\n",
|
1093 |
+
"\u001b[1m31/32\u001b[0m \u001b[32m===================\u001b[0m\u001b[37m=\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - loss: 0.0070\n",
|
1094 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - loss: 0.0070\n",
|
1095 |
+
"Epoch 45/50\n",
|
1096 |
+
"\n",
|
1097 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 64ms/step - loss: 0.0067\n",
|
1098 |
+
"\u001b[1m 8/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - loss: 0.0061 \n",
|
1099 |
+
"\u001b[1m18/32\u001b[0m \u001b[32m===========\u001b[0m\u001b[37m=========\u001b[0m \u001b[1m0s\u001b[0m 6ms/step - loss: 0.0062\n",
|
1100 |
+
"\u001b[1m27/32\u001b[0m \u001b[32m================\u001b[0m\u001b[37m====\u001b[0m \u001b[1m0s\u001b[0m 6ms/step - loss: 0.0063\n",
|
1101 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - loss: 0.0063\n",
|
1102 |
+
"Epoch 46/50\n",
|
1103 |
+
"\n",
|
1104 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 37ms/step - loss: 0.0030\n",
|
1105 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0041\n",
|
1106 |
+
"\u001b[1m11/32\u001b[0m \u001b[32m======\u001b[0m\u001b[37m==============\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0045\n",
|
1107 |
+
"\u001b[1m16/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0047\n",
|
1108 |
+
"\u001b[1m20/32\u001b[0m \u001b[32m============\u001b[0m\u001b[37m========\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0050\n",
|
1109 |
+
"\u001b[1m24/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0052\n",
|
1110 |
+
"\u001b[1m28/32\u001b[0m \u001b[32m=================\u001b[0m\u001b[37m===\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0054\n",
|
1111 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0055\n",
|
1112 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0056\n",
|
1113 |
+
"Epoch 47/50\n",
|
1114 |
+
"\n",
|
1115 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 41ms/step - loss: 0.0048\n",
|
1116 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0062\n",
|
1117 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0069\n",
|
1118 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0072\n",
|
1119 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0074\n",
|
1120 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0075\n",
|
1121 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0076\n",
|
1122 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0077\n",
|
1123 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0077\n",
|
1124 |
+
"Epoch 48/50\n",
|
1125 |
+
"\n",
|
1126 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 39ms/step - loss: 0.0039\n",
|
1127 |
+
"\u001b[1m 5/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0064\n",
|
1128 |
+
"\u001b[1m 9/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0067\n",
|
1129 |
+
"\u001b[1m13/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0069\n",
|
1130 |
+
"\u001b[1m17/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0070\n",
|
1131 |
+
"\u001b[1m21/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0070\n",
|
1132 |
+
"\u001b[1m25/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0069\n",
|
1133 |
+
"\u001b[1m29/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0069\n",
|
1134 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 15ms/step - loss: 0.0069\n",
|
1135 |
+
"Epoch 49/50\n",
|
1136 |
+
"\n",
|
1137 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 36ms/step - loss: 0.0036\n",
|
1138 |
+
"\u001b[1m 8/32\u001b[0m \u001b[32m=====\u001b[0m\u001b[37m===============\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - loss: 0.0058 \n",
|
1139 |
+
"\u001b[1m12/32\u001b[0m \u001b[32m=======\u001b[0m\u001b[37m=============\u001b[0m \u001b[1m0s\u001b[0m 10ms/step - loss: 0.0060\n",
|
1140 |
+
"\u001b[1m16/32\u001b[0m \u001b[32m==========\u001b[0m\u001b[37m==========\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0061\n",
|
1141 |
+
"\u001b[1m20/32\u001b[0m \u001b[32m============\u001b[0m\u001b[37m========\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0061\n",
|
1142 |
+
"\u001b[1m24/32\u001b[0m \u001b[32m===============\u001b[0m\u001b[37m=====\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0061\n",
|
1143 |
+
"\u001b[1m31/32\u001b[0m \u001b[32m===================\u001b[0m\u001b[37m=\u001b[0m \u001b[1m0s\u001b[0m 11ms/step - loss: 0.0062\n",
|
1144 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0063\n",
|
1145 |
+
"Epoch 50/50\n",
|
1146 |
+
"\n",
|
1147 |
+
"\u001b[1m 1/32\u001b[0m \u001b[37m====================\u001b[0m \u001b[1m1s\u001b[0m 36ms/step - loss: 0.0047\n",
|
1148 |
+
"\u001b[1m 6/32\u001b[0m \u001b[32m===\u001b[0m\u001b[37m=================\u001b[0m \u001b[1m0s\u001b[0m 12ms/step - loss: 0.0052\n",
|
1149 |
+
"\u001b[1m10/32\u001b[0m \u001b[32m======\u001b[0m\u001b[37m==============\u001b[0m \u001b[1m0s\u001b[0m 13ms/step - loss: 0.0054\n",
|
1150 |
+
"\u001b[1m14/32\u001b[0m \u001b[32m========\u001b[0m\u001b[37m============\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0056\n",
|
1151 |
+
"\u001b[1m18/32\u001b[0m \u001b[32m===========\u001b[0m\u001b[37m=========\u001b[0m \u001b[1m0s\u001b[0m 14ms/step - loss: 0.0057\n",
|
1152 |
+
"\u001b[1m22/32\u001b[0m \u001b[32m=============\u001b[0m\u001b[37m=======\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0058\n",
|
1153 |
+
"\u001b[1m26/32\u001b[0m \u001b[32m================\u001b[0m\u001b[37m====\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0059\n",
|
1154 |
+
"\u001b[1m30/32\u001b[0m \u001b[32m==================\u001b[0m\u001b[37m==\u001b[0m \u001b[1m0s\u001b[0m 15ms/step - loss: 0.0060\n",
|
1155 |
+
"\u001b[1m32/32\u001b[0m \u001b[32m====================\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 16ms/step - loss: 0.0061\n",
|
1156 |
+
"GRU model retrained and saved successfully!\n"
|
1157 |
+
]
|
1158 |
+
},
|
1159 |
+
{
|
1160 |
+
"name": "stderr",
|
1161 |
+
"output_type": "stream",
|
1162 |
+
"text": [
|
1163 |
+
"2025-04-09 11:37:28.632025: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n",
|
1164 |
+
"2025-04-09 11:37:29.328822: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n",
|
1165 |
+
"2025-04-09 11:37:31.986338: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
|
1166 |
+
"To enable the following instructions: SSE3 SSE4.1 SSE4.2 AVX AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n"
|
1167 |
+
]
|
1168 |
+
}
|
1169 |
+
],
|
1170 |
+
"source": [
|
1171 |
+
"!python \"C:/Users/Dine24/Python Course/IPL_Cricket/match_live_predictor/train_gru_rw_model.py\"\n"
|
1172 |
+
]
|
1173 |
+
},
|
1174 |
+
{
|
1175 |
+
"cell_type": "code",
|
1176 |
+
"execution_count": null,
|
1177 |
+
"metadata": {},
|
1178 |
+
"outputs": [],
|
1179 |
+
"source": [
|
1180 |
+
"!streamlit run \"C:/Users/Dine24/Python Course/IPL_Cricket/match_live_predictor/live_predictor.py\""
|
1181 |
+
]
|
1182 |
+
},
|
1183 |
+
{
|
1184 |
+
"cell_type": "code",
|
1185 |
+
"execution_count": null,
|
1186 |
+
"metadata": {},
|
1187 |
+
"outputs": [],
|
1188 |
+
"source": []
|
1189 |
+
}
|
1190 |
+
],
|
1191 |
+
"metadata": {
|
1192 |
+
"colab": {
|
1193 |
+
"authorship_tag": "ABX9TyMWBYJ+0zFgkHMyKR8dqetW",
|
1194 |
+
"provenance": []
|
1195 |
+
},
|
1196 |
+
"kernelspec": {
|
1197 |
+
"display_name": "Python 3 (ipykernel)",
|
1198 |
+
"language": "python",
|
1199 |
+
"name": "python3"
|
1200 |
+
},
|
1201 |
+
"language_info": {
|
1202 |
+
"codemirror_mode": {
|
1203 |
+
"name": "ipython",
|
1204 |
+
"version": 3
|
1205 |
+
},
|
1206 |
+
"file_extension": ".py",
|
1207 |
+
"mimetype": "text/x-python",
|
1208 |
+
"name": "python",
|
1209 |
+
"nbconvert_exporter": "python",
|
1210 |
+
"pygments_lexer": "ipython3",
|
1211 |
+
"version": "3.12.7"
|
1212 |
+
}
|
1213 |
+
},
|
1214 |
+
"nbformat": 4,
|
1215 |
+
"nbformat_minor": 4
|
1216 |
+
}
|
IPL_Predictions.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
IPL_Project_Summary.docx
ADDED
Binary file (37.4 kB). View file
|
|
IPL_Score_Prediction.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
README.md
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
\-\-- title: \"🏏 IPL Match Predictor & Simulator\" emoji: \"🏏\"
|
2 |
+
colorFrom: \"yellow\" colorTo: \"blue\" sdk: \"streamlit\" sdk_version:
|
3 |
+
\"1.30.0\" app_file: \"app.py\" pinned: false license: \"mit\" tags: -
|
4 |
+
cricket - ipl - deep-learning - streamlit - gru - prediction -
|
5 |
+
sports - commentary \-\--
|
6 |
+
|
7 |
+
\# 🏏 IPL Match Predictor & Live Simulation App
|
8 |
+
|
9 |
+
Welcome to the \*\*IPL Match Predictor\*\* -- a powerful and interactive
|
10 |
+
Streamlit-based application that simulates and predicts IPL match
|
11 |
+
outcomes using machine learning, deep learning, and Generative AI
|
12 |
+
commentary.
|
13 |
+
|
14 |
+
\-\--
|
15 |
+
|
16 |
+
\## 🚀 Key Features
|
17 |
+
|
18 |
+
\### 🎯 1. IPL Score Prediction Dashboard (GRU-Based) - Predicts final
|
19 |
+
match score using a GRU deep learning model. - Inputs: Over-wise runs
|
20 |
+
and optional wickets (20 overs). - Model trained on synthetic match data
|
21 |
+
to mimic real T20 dynamics.
|
22 |
+
|
23 |
+
\### 🧠 2. GPT Commentary Generator (RAG-based, Optional) - Generate
|
24 |
+
multi-turn AI commentary based on match progression. - Integrates
|
25 |
+
GPT-3.5 (OpenAI) with retrieval-based chunked summaries. \*(Optional
|
26 |
+
deployment upgrade)\*
|
27 |
+
|
28 |
+
\### 🧮 3. Match Scenario Simulator - Simulate custom match scenarios
|
29 |
+
based on user-input cumulative scores. - Get final score predictions
|
30 |
+
even with mid-match inputs.
|
31 |
+
|
32 |
+
\### 📊 4. IPL Match Simulation + Points Table Logic - Team vs Team
|
33 |
+
match generation with venue and status (Completed/In
|
34 |
+
Progress/Scheduled). - Dynamic scorecard visualization with runs,
|
35 |
+
wickets, and predicted outcomes.
|
36 |
+
|
37 |
+
\### 📈 5. Live Match Predictor - Simulate full match: generates random
|
38 |
+
over-wise runs + wickets. - Visualizes match progression and predicts
|
39 |
+
final score with model confidence.
|
40 |
+
|
41 |
+
\-\--
|
42 |
+
|
43 |
+
\## 📁 Project Structure
|
44 |
+
|
45 |
+
final_app/ │ ├── app.py \# ✅ Unified Streamlit app ├── requirements.txt
|
46 |
+
\# ✅ Dependencies for Hugging Face ├── trained_model/ \# ✅ GRU-based
|
47 |
+
models + scalers ├── match_live_predictor/ \# ✅ Live match predictor
|
48 |
+
files ├── match_simulator.py \# Scenario-based simulator ├── \*.h5 /
|
49 |
+
.keras \# DL models (GRU, BiLSTM, CNN, LSTM) ├── scaler\_.save \#
|
50 |
+
Input/output scalers ├── \*.csv \# Match data for commentary, points,
|
51 |
+
visuals ├── \*.gif \# Dashboard animations └── \*.ipynb \# Phase
|
52 |
+
notebooks and analysis
|
53 |
+
|
54 |
+
\-\--
|
55 |
+
|
56 |
+
\## 🔧 Requirements
|
57 |
+
|
58 |
+
Install dependencies using:
|
59 |
+
|
60 |
+
\`\`\`bash pip install -r requirements.txt
|
61 |
+
|
62 |
+
Model Info Model: GRU-based sequence predictor
|
63 |
+
|
64 |
+
Input: 20 timesteps (Runs, Wickets)
|
65 |
+
|
66 |
+
Output: Scaled prediction of final score
|
67 |
+
|
68 |
+
Scaler: MinMaxScaler fitted on input & target
|
69 |
+
|
70 |
+
GPT Commentary (Optional) To enable RAG-based GPT-3.5 commentary:
|
71 |
+
|
72 |
+
Set your OPENAI_API_KEY in Hugging Face secrets.
|
73 |
+
|
74 |
+
Add commentary loader and chunker for match summaries.
|
75 |
+
|
76 |
+
🧑💻 Built By 👨💻 Dinesh Kumar \| Powered by Streamlit, TensorFlow, NumPy,
|
77 |
+
Hugging Face, and Ope
|
app.py
ADDED
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
import numpy as np
|
4 |
+
import datetime
|
5 |
+
import os
|
6 |
+
import matplotlib.pyplot as plt
|
7 |
+
from tensorflow.keras.models import load_model
|
8 |
+
import joblib
|
9 |
+
|
10 |
+
# ===============================
|
11 |
+
# Sidebar Navigation
|
12 |
+
# ===============================
|
13 |
+
st.set_page_config(page_title="🏏 IPL Unified Predictor App", layout="wide")
|
14 |
+
selected_tab = st.sidebar.selectbox("🏆 Select Module", [
|
15 |
+
"Dashboard",
|
16 |
+
"Commentary",
|
17 |
+
"Scenario Simulator",
|
18 |
+
"Match Simulator",
|
19 |
+
"Live Match Predictor"
|
20 |
+
])
|
21 |
+
|
22 |
+
# ===============================
|
23 |
+
# 1. Dashboard Intro
|
24 |
+
# ===============================
|
25 |
+
if selected_tab == "Dashboard":
|
26 |
+
st.title("📊 IPL Unified Prediction & Simulation Dashboard")
|
27 |
+
st.markdown("""
|
28 |
+
Welcome to the complete IPL analytics suite. This unified app supports:
|
29 |
+
- 🎯 Score Prediction using GRU
|
30 |
+
- 🧠 GPT-3.5 Commentary
|
31 |
+
- 🎲 Match Scenario Simulator
|
32 |
+
- 📈 Real-time Momentum & Points Table
|
33 |
+
- 🧪 Live Match Score Prediction
|
34 |
+
|
35 |
+
Use the sidebar to navigate through modules.
|
36 |
+
""")
|
37 |
+
st.image("match_momentum_dashboard.gif", use_column_width=True)
|
38 |
+
|
39 |
+
# ===============================
|
40 |
+
# 2. Commentary Dashboard
|
41 |
+
# ===============================
|
42 |
+
elif selected_tab == "Commentary":
|
43 |
+
st.title("🧠 Score Prediction & GPT Commentary")
|
44 |
+
try:
|
45 |
+
df = pd.read_csv("gru_match_simulation_commentary.csv")
|
46 |
+
st.dataframe(df)
|
47 |
+
st.markdown("""
|
48 |
+
**Commentary Summary:**
|
49 |
+
> The team started steadily, losing early wickets in the powerplay. However, they built partnerships during middle overs and accelerated towards the end with a flurry of boundaries.
|
50 |
+
""")
|
51 |
+
st.image("gru_match_simulation_plot.gif", caption="Score + Commentary Summary")
|
52 |
+
except:
|
53 |
+
st.warning("Upload commentary file or check dataset path.")
|
54 |
+
|
55 |
+
# ===============================
|
56 |
+
# 3. Scenario Simulator
|
57 |
+
# ===============================
|
58 |
+
elif selected_tab == "Scenario Simulator":
|
59 |
+
st.title("🎯 Match Scenario Score Predictor")
|
60 |
+
st.markdown("Enter cumulative runs over 20 overs to predict the final score.")
|
61 |
+
|
62 |
+
current_over = st.slider("Select Overs Completed", 1, 20, 10)
|
63 |
+
runs_input = []
|
64 |
+
|
65 |
+
for i in range(current_over):
|
66 |
+
run = st.number_input(f"Runs after Over {i+1}", min_value=0, step=1, key=f"r_{i}")
|
67 |
+
runs_input.append(run)
|
68 |
+
|
69 |
+
if st.button("Predict Score"):
|
70 |
+
if len(runs_input) == current_over:
|
71 |
+
padded = runs_input + [0]*(20 - len(runs_input))
|
72 |
+
arr = np.array(padded).reshape(-1, 1)
|
73 |
+
model = load_model("gru_score_predictor.keras", compile=False)
|
74 |
+
scaler_input = joblib.load("scaler_input.save")
|
75 |
+
scaler_output = joblib.load("scaler_output.save")
|
76 |
+
|
77 |
+
scaled = scaler_input.transform(arr).reshape(1, 20, 1)
|
78 |
+
pred = model.predict(scaled)
|
79 |
+
predicted_score = scaler_output.inverse_transform(pred)[0][0]
|
80 |
+
|
81 |
+
st.success(f"🏏 Predicted Final Score: {predicted_score:.2f} runs")
|
82 |
+
|
83 |
+
# ===============================
|
84 |
+
# 4. Match Simulator + Points Table
|
85 |
+
# ===============================
|
86 |
+
elif selected_tab == "Match Simulator":
|
87 |
+
st.title("🏟️ IPL Match Simulator + Points Table")
|
88 |
+
teams = ["CSK", "MI", "RCB", "GT", "RR", "LSG", "KKR", "SRH"]
|
89 |
+
match_results = []
|
90 |
+
points = {team: 0 for team in teams}
|
91 |
+
|
92 |
+
for i in range(10):
|
93 |
+
t1, t2 = np.random.choice(teams, 2, replace=False)
|
94 |
+
winner = np.random.choice([t1, t2])
|
95 |
+
points[winner] += 2
|
96 |
+
match_results.append((t1, t2, winner))
|
97 |
+
|
98 |
+
df_matches = pd.DataFrame(match_results, columns=["Team A", "Team B", "Winner"])
|
99 |
+
df_points = pd.DataFrame(sorted(points.items(), key=lambda x: x[1], reverse=True), columns=["Team", "Points"])
|
100 |
+
|
101 |
+
st.subheader("📝 Simulated Match Results")
|
102 |
+
st.dataframe(df_matches)
|
103 |
+
|
104 |
+
st.subheader("📊 Points Table")
|
105 |
+
st.dataframe(df_points)
|
106 |
+
|
107 |
+
# ===============================
|
108 |
+
# 5. Live Match Predictor (Runs + Wickets)
|
109 |
+
# ===============================
|
110 |
+
elif selected_tab == "Live Match Predictor":
|
111 |
+
st.title("📡 IPL Live Match Predictor")
|
112 |
+
|
113 |
+
col1, col2, col3 = st.columns(3)
|
114 |
+
with col1:
|
115 |
+
team_a = st.selectbox("Team A", ["MI", "RCB", "CSK", "GT"])
|
116 |
+
with col2:
|
117 |
+
team_b = st.selectbox("Team B", ["MI", "RCB", "CSK", "GT"])
|
118 |
+
with col3:
|
119 |
+
venue = st.selectbox("Venue", ["Wankhede", "Chinnaswamy", "Chepauk"])
|
120 |
+
|
121 |
+
date = st.date_input("Match Date", datetime.date.today())
|
122 |
+
status = st.radio("Match Status", ["In Progress", "Completed", "Scheduled"])
|
123 |
+
|
124 |
+
if st.button("Generate & Predict"):
|
125 |
+
runs = np.random.randint(0, 21, 20)
|
126 |
+
wickets = np.random.binomial(1, 0.3, 20)
|
127 |
+
|
128 |
+
df = pd.DataFrame({
|
129 |
+
"Over": list(range(1, 21)),
|
130 |
+
"Runs_This_Over": runs,
|
131 |
+
"Cumulative_Runs": np.cumsum(runs),
|
132 |
+
"Wickets_This_Over": wickets,
|
133 |
+
"Cumulative_Wickets": np.cumsum(wickets)
|
134 |
+
})
|
135 |
+
|
136 |
+
st.success(f"Match: {team_a} vs {team_b} at {venue} on {date}")
|
137 |
+
st.dataframe(df)
|
138 |
+
|
139 |
+
# Prediction logic
|
140 |
+
model = load_model("gru_score_predictor_rw.keras", compile=False)
|
141 |
+
scaler_input = joblib.load("scaler_rw_input.save")
|
142 |
+
scaler_output = joblib.load("scaler_rw_output.save")
|
143 |
+
|
144 |
+
padded_input = np.pad(df[["Runs_This_Over", "Wickets_This_Over"]].values,
|
145 |
+
((0, 20 - df.shape[0]), (0, 0)), mode='constant')
|
146 |
+
scaled_input = scaler_input.transform(padded_input).reshape(1, 20, 2)
|
147 |
+
pred_scaled = model.predict(scaled_input)
|
148 |
+
predicted_score = scaler_output.inverse_transform(pred_scaled)[0][0]
|
149 |
+
|
150 |
+
st.success(f"🎯 Predicted Final Score: {predicted_score:.2f} runs")
|
151 |
+
|
152 |
+
fig, ax1 = plt.subplots()
|
153 |
+
ax1.plot(df["Over"], df["Cumulative_Runs"], marker='o', color='green', label='Runs')
|
154 |
+
ax1.set_xlabel("Over")
|
155 |
+
ax1.set_ylabel("Runs", color='green')
|
156 |
+
ax2 = ax1.twinx()
|
157 |
+
ax2.bar(df["Over"], df["Wickets_This_Over"], alpha=0.4, color='red', label='Wickets')
|
158 |
+
ax2.set_ylabel("Wickets", color='red')
|
159 |
+
plt.axhline(y=predicted_score, color='blue', linestyle='--', label='Predicted Score')
|
160 |
+
fig.legend(loc='upper left')
|
161 |
+
st.pyplot(fig)
|
162 |
+
|
163 |
+
# ===============================
|
164 |
+
# Footer
|
165 |
+
# ===============================
|
166 |
+
st.markdown("""
|
167 |
+
---
|
168 |
+
👨💻 Built by Dinesh Kumar | Powered by Streamlit, NumPy, Matplotlib, TensorFlow
|
169 |
+
""")
|
bilstm_score_predictor.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:82fce64177ae743f3a2a7dbc22425ebd864c9eb1230819521e5fc5bb9a14dd49
|
3 |
+
size 442456
|
cnn_score_predictor.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d6de05ffd9f16e4350a5ca61630b2984382a6944fc4a7bc32399cf5cd65c0ac2
|
3 |
+
size 40736
|
deliveries.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:142236ea52950795dab266d4aa392c7645bd1a0db4704f0b8058afd96e24e2c2
|
3 |
+
size 27019953
|
gru_match_simulation_commentary.csv
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Over,Cumulative Runs,Predicted Final Score,Win Probability (%),Commentary
|
2 |
+
1,1,2,0,"And here we go, ladies and gentlemen! The first over of the match has been bowled and just 1 run on the board. It's a slow start but hey, it's all about building momentum, right?
|
3 |
+
|
4 |
+
The predicted final score at this rate is 2 runs, so we definitely need to see some big hits soon. The win probability currently stands at 0%, but hey, it's early days!
|
5 |
+
|
6 |
+
The team seems to be under a bit of pressure to get those runs flowing"
|
7 |
+
2,6,6,0,"And we're off to a cracking start here at the IPL! Two overs down and the team has managed to put up a total of 6 runs on the board. It's early days yet, but they're definitely looking to set a solid foundation for a big score.
|
8 |
+
|
9 |
+
The win probability may be at 0% right now, but don't count them out just yet! The pressure is on, but this team is no stranger to pulling off extraordinary comebacks. They just need to keep their"
|
10 |
+
3,16,16,0,"And we've reached the end of the 3rd over here at the IPL, folks! The runs are coming in steadily for the team, but they'll need to pick up the pace if they want to set a challenging total.
|
11 |
+
|
12 |
+
At this rate, the predicted final score is looking like 16, and the win probability is currently at 0%. The pressure is definitely on for the batting side to up their game and start scoring some boundaries.
|
13 |
+
|
14 |
+
It's still early days in this match, but"
|
15 |
+
4,19,19,0,"""Welcome back to the thrilling action here at the stadium! We're four overs in and the team has put up a total of 19 runs on the board. It's a slow start but there's plenty of cricket left to play. Can they pick up the pace and set a competitive target?
|
16 |
+
|
17 |
+
The team is currently on track for a predicted final score of 19, but they better watch out because the opposition is bringing the heat! With a win probability of 0%, the pressure is on"
|
18 |
+
5,34,34,0,"Welcome back to the IPL action folks! We're 5 overs down and the score is at 34 runs. The team is looking solid at the moment but they need to keep the momentum going to reach their predicted final score of 34.
|
19 |
+
|
20 |
+
The batsmen are showing some great form out there, hitting boundaries left, right, and center. The fielding team is feeling the pressure as they struggle to break this partnership.
|
21 |
+
|
22 |
+
With a win probability of 0%, the team needs to keep pushing forward"
|
23 |
+
6,45,45,0,"Ladies and gentlemen, what a thrilling match we have here today at the IPL! After 6 overs, the team has scored 45 runs and they are looking absolutely unstoppable! The batsmen are on fire and the runs are flowing like a river.
|
24 |
+
|
25 |
+
With a predicted final score of 45, this team is definitely on track for a massive total. The opposition better watch out because these batters mean business!
|
26 |
+
|
27 |
+
As for the win probability, it's currently sitting at 0% for the opposition"
|
28 |
+
7,59,59,0,"Welcome back to the electrifying action of the IPL! We've just completed 7 overs and the runs are flowing like water here. The team has put up a solid 59 runs on the board and they are looking to set a big target for the opposition.
|
29 |
+
|
30 |
+
The batsmen are playing with flair and confidence, smashing boundaries left, right, and center. The crowd is on their feet, cheering every run scored. It's an absolute treat to watch!
|
31 |
+
|
32 |
+
With the current run rate, the predicted"
|
33 |
+
8,65,65,0,"Ladies and gentlemen, what a rollercoaster of a match we have here today at the IPL! After 8 overs, the team has managed to score a total of 65 runs. They are on track to set a solid target for their opponents, but let's not get ahead of ourselves just yet!
|
34 |
+
|
35 |
+
The batsmen are looking confident out there, playing their shots with precision and power. The bowlers, on the other hand, are feeling the pressure as they try to break through this"
|
36 |
+
9,74,74,0,"Ladies and gentlemen, we are witnessing an absolute cracker of a match here at the IPL! After 9 overs, the team has managed to score 74 runs on the board. The batsmen are showcasing some incredible shots and the crowd is going wild!
|
37 |
+
|
38 |
+
But hold on, folks, the win probability is currently at 0%! The pressure is on for the team to maintain their momentum and push towards a big total. Can they keep up the pace and set a challenging target for the opposition"
|
39 |
+
10,82,82,0,"Ladies and gentlemen, we are witnessing a nail-biting match here at the IPL! After 10 overs, the team has managed to score 82 runs, but wait, the win probability is currently at 0% - talk about pressure!
|
40 |
+
|
41 |
+
The batsmen are on fire, hitting boundaries left and right, but can they keep up this momentum? The bowlers are giving it their all, not making it easy for the opposition. It's a seesaw battle out there on the pitch!
|
42 |
+
|
43 |
+
"
|
44 |
+
11,92,92,0,"Ladies and gentlemen, we are witnessing an absolute cracker of a match here at the IPL! With 11 overs completed, the batting team has managed to amass 92 runs on the board. They are looking sharp and energetic out there on the field.
|
45 |
+
|
46 |
+
But hold on, the win probability is currently at 0%! The pressure is on for the batting side to keep up the momentum and push for a big total. Every run from here on out will be crucial in determining the outcome of"
|
47 |
+
12,97,97,0,"Ladies and gentlemen, buckle up your seatbelts because we are in for a rollercoaster ride here at the IPL today! The batsmen are swinging for the fences, the bowlers are sweating bullets, and the crowd is on the edge of their seats.
|
48 |
+
|
49 |
+
After 12 overs, the team has managed to rack up 97 runs on the board. What a display of power hitting and finesse! But hold on to your hats folks, because the predicted final score is also 97"
|
50 |
+
13,106,106,1,"""Welcome back to the IPL madness, folks! We're into the 13th over and we've got a total of 106 runs on the board. The team is currently on track, showing some solid batting skills out there on the pitch. But let's not get too comfortable just yet, the win probability is at a mere 1% - so the pressure is definitely on to keep up the momentum and push for more runs. This match is far from over, and anything can happen in"
|
51 |
+
14,107,107,1,"Well folks, we're into the business end of this match and things are looking grim for the batting side! With 14 overs completed, they've only managed to put up a measly 107 runs on the board. The predicted final score is also 107, so it looks like they're right on track...but for what, I'm not so sure!
|
52 |
+
|
53 |
+
The win probability is a mere 1%, so it's safe to say that the pressure is on for these batsmen to start"
|
54 |
+
15,116,116,2,"What a match we have here today folks! With 15 overs completed, the team has managed to score 116 runs. The energy on the field is electric, but the win probability stands at a mere 2%. It's safe to say they are definitely the underdogs in this match.
|
55 |
+
|
56 |
+
The team is under immense pressure to perform in these final overs if they want to have any chance of pulling off a miracle. The bowlers are on fire, the fielders are sharp, but can they"
|
57 |
+
16,117,117,2,"Ladies and gentlemen, we are witnessing a nail-biting match here at the IPL! With 16 overs completed, the team has managed to score 117 runs. The predicted final score is also 117, but with a win probability of just 2%, they sure have their work cut out for them!
|
58 |
+
|
59 |
+
The team is definitely under pressure here, folks. They need to up their game if they want to turn this around and secure a victory. The bowlers are bringing the heat, and"
|
60 |
+
17,123,123,3,"Ladies and gentlemen, we are witnessing a thrilling match here at the IPL! With 17 overs completed, the team has managed to score 123 runs. The predicted final score is 123 - can they keep up the momentum or will the pressure get to them?
|
61 |
+
|
62 |
+
At a win probability of just 3%, this team is definitely the underdog in this match. But as we all know, cricket is a game of uncertainties and anything can happen!
|
63 |
+
|
64 |
+
The players are giving it their all out there"
|
65 |
+
18,128,128,5,"Welcome back to the IPL extravaganza, folks! We're witnessing a nail-biting encounter here as the overs are ticking away and the runs are piling up. The current score stands at 128 after 18 overs, and it looks like the team is on track to reach a predicted final score of... 128.
|
66 |
+
|
67 |
+
But wait, hold on to your seats because the win probability is at a mere 5%! The pressure is on, folks, the pressure is on! Will they"
|
68 |
+
19,147,147,27,"Ladies and gentlemen, what a nail-biter we have on our hands here at the IPL! The team has completed 19 overs and they have managed to score 147 runs. The predicted final score is also 147, talk about neck and neck!
|
69 |
+
|
70 |
+
But hold onto your hats folks, because the win probability is at a mere 27%! The pressure is on, the tension is palpable, and the players are feeling the heat. Will they be able to hold their nerve and pull off"
|
71 |
+
20,153,154,43,"Well folks, we're halfway through the game and it's been an absolute rollercoaster of a match so far! The team has managed to put up a total of 153 runs on the board after completing 20 overs. With a predicted final score of 154, they're definitely on track to set a competitive target for the opposition.
|
72 |
+
|
73 |
+
But hold on tight, because the win probability currently stands at 43%, so it's all to play for in the second half of this innings. The"
|
gru_match_simulation_overwise.csv
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Over,Cumulative_Runs,Predicted_Final_Score,Win_Probability (%)
|
2 |
+
1,1,2,0
|
3 |
+
2,6,6,0
|
4 |
+
3,16,16,0
|
5 |
+
4,19,19,0
|
6 |
+
5,34,34,0
|
7 |
+
6,45,45,0
|
8 |
+
7,59,59,0
|
9 |
+
8,65,65,0
|
10 |
+
9,74,74,0
|
11 |
+
10,82,82,0
|
12 |
+
11,92,92,0
|
13 |
+
12,97,97,0
|
14 |
+
13,106,106,1
|
15 |
+
14,107,107,1
|
16 |
+
15,116,116,2
|
17 |
+
16,117,117,2
|
18 |
+
17,123,123,3
|
19 |
+
18,128,128,5
|
20 |
+
19,147,147,27
|
21 |
+
20,153,154,43
|
gru_match_simulation_plot.gif
ADDED
![]() |
Git LFS Details
|
gru_match_summary.txt
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
What a rollercoaster of a match we've witnessed here today at the IPL! The first 3 overs were as slow as a tortoise in quicksand, with very little movement, low runs, and a 0% win probability. The crowd was getting restless, wondering if they were in for a snooze fest.
|
2 |
+
|
3 |
+
But hold on to your hats, folks, because from Over 5 to Over 7, we saw some real action! The runs started flowing, the confidence was building, and the energy in the stadium was electric. It was like a switch had been flicked, and the players were suddenly on fire.
|
4 |
+
|
5 |
+
And then came Over 19 - what a massive momentum swing we saw there! The highest runs of the match, a max predicted score jump, and a win probability jump of 22%. The crowd went wild, the excitement was palpable, and you could feel the tension in the air.
|
6 |
+
|
7 |
+
As we headed into Over 20, the predicted score stood at 154, and the win probability had shot up to 43%. The pressure was on, the tension was high, and the fans were on the edge of their seats. Every ball was a potential turning point, every run crucial in this nail-biting finish.
|
8 |
+
|
9 |
+
And there it is, folks! The final ball has been bowled, and what a match it has been. The momentum shifts, the turning points, and the crowd reactions have kept us all on the edge of our seats. This is what IPL cricket is all about - unpredictable, electrifying, and utterly thrilling till the very end!
|
gru_rw_predictor.keras
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f2f9c578f295ecca8604d304e35a8455e63a0ca7281e6928c5f3f3532345024e
|
3 |
+
size 181606
|
gru_score_predictor.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ce15d5e1b7c2b4b89afee7640bf8b0d56a756ae94407617eeccb41c670102ff0
|
3 |
+
size 181416
|
gru_score_predictor.keras
ADDED
Binary file (69.2 kB). View file
|
|
lstm_score_predictor.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f6049bc0f2193ff16169eae953667777ba5f38189a25e27d631760cb88278869
|
3 |
+
size 228008
|
match_momentum_dashboard.gif
ADDED
![]() |
Git LFS Details
|
match_simulator.py
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import numpy as np
|
3 |
+
import joblib
|
4 |
+
from tensorflow.keras.models import load_model
|
5 |
+
|
6 |
+
# Set Streamlit configuration
|
7 |
+
st.set_page_config(page_title="🏏 Match Scenario Simulator")
|
8 |
+
st.title("🏏 Match Scenario Simulator")
|
9 |
+
|
10 |
+
# Load model and scalers
|
11 |
+
try:
|
12 |
+
gru_model = load_model("gru_score_predictor.keras", compile=False)
|
13 |
+
scaler_input = joblib.load("scaler_input.save")
|
14 |
+
scaler_output = joblib.load("scaler_output.save")
|
15 |
+
except Exception as e:
|
16 |
+
st.error(f"Model or scaler files not found: {e}")
|
17 |
+
st.stop()
|
18 |
+
|
19 |
+
# User Input Section
|
20 |
+
st.subheader("📝 Input Current Match Situation")
|
21 |
+
st.markdown("🔢 Enter **runs scored per over**, not cumulative. For example:\n- Over 1: 6\n- Over 2: 9\n- Over 3: 0")
|
22 |
+
|
23 |
+
# Number of completed overs
|
24 |
+
current_over = st.slider("Select Over Completed (1 to 20)", 1, 20, 10)
|
25 |
+
|
26 |
+
# Input per-over runs
|
27 |
+
runs_input = []
|
28 |
+
for i in range(current_over):
|
29 |
+
run = st.number_input(f"Runs in Over {i+1}", min_value=0, max_value=36, step=1, key=f"run_{i}")
|
30 |
+
runs_input.append(run)
|
31 |
+
|
32 |
+
# Predict button
|
33 |
+
if st.button("Predict Final Score"):
|
34 |
+
if len(runs_input) == current_over:
|
35 |
+
try:
|
36 |
+
# Convert to cumulative for model
|
37 |
+
cumulative_runs = np.cumsum(runs_input).tolist()
|
38 |
+
padded_runs = cumulative_runs + [0]*(20 - len(cumulative_runs))
|
39 |
+
padded_array = np.array(padded_runs).reshape(-1, 1)
|
40 |
+
|
41 |
+
# Scale & reshape
|
42 |
+
scaled_input = scaler_input.transform(padded_array)
|
43 |
+
model_input = scaled_input.reshape(1, 20, 1)
|
44 |
+
|
45 |
+
# Predict
|
46 |
+
pred_scaled = gru_model.predict(model_input, verbose=0)
|
47 |
+
predicted_score = scaler_output.inverse_transform(pred_scaled)[0][0]
|
48 |
+
|
49 |
+
st.success(f"🎯 Predicted Final Score: {predicted_score:.2f} runs")
|
50 |
+
except Exception as e:
|
51 |
+
st.error(f"❌ Prediction error: {e}")
|
52 |
+
else:
|
53 |
+
st.warning("⚠️ Please enter runs for all overs.")
|
matches.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
requirements.txt
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
numpy
|
3 |
+
pandas
|
4 |
+
scikit-learn
|
5 |
+
tensorflow
|
6 |
+
matplotlib
|
7 |
+
openai # If using GPT-3.5 commentary
|
scaler_input.save
ADDED
Binary file (725 Bytes). View file
|
|
scaler_output.save
ADDED
Binary file (725 Bytes). View file
|
|
scaler_rw_input.save
ADDED
Binary file (749 Bytes). View file
|
|
scaler_rw_output.save
ADDED
Binary file (725 Bytes). View file
|
|