viruthik commited on
Commit
2ff1bb4
·
1 Parent(s): bafeb68

Upload 9 files

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ 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
+ train_data.csv filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI, Form, Request
2
+ from fastapi.responses import HTMLResponse
3
+ from fastapi.staticfiles import StaticFiles
4
+ from fastapi.templating import Jinja2Templates
5
+ import numpy as np
6
+ import pandas as pd
7
+ from pydantic import BaseModel
8
+ from statsmodels.tsa.deterministic import DeterministicProcess
9
+ from sklearn.linear_model import LinearRegression
10
+ from datetime import datetime, timedelta
11
+ import matplotlib.pyplot as plt
12
+ import io
13
+ import base64
14
+
15
+ app = FastAPI()
16
+
17
+ app.mount("/static", StaticFiles(directory="static"), name="static")
18
+ templates = Jinja2Templates(directory="templates")
19
+
20
+ class DateRangeInput(BaseModel):
21
+ start_date: str
22
+ end_date: str
23
+
24
+ @app.get("/", response_class=HTMLResponse)
25
+ async def get_predict_form(request: Request):
26
+ return templates.TemplateResponse("predict_form.html", {"request": request})
27
+
28
+ @app.post("/predict/")
29
+ async def predict_sales(start_date: str = Form(...), end_date: str = Form(...)):
30
+ start_date = datetime.strptime(start_date, '%Y-%m-%d')
31
+ end_date = datetime.strptime(end_date, '%Y-%m-%d')
32
+
33
+ train_df = pd.read_csv(r'E:\retail\train_data.csv', parse_dates=['date'])
34
+ store_sales = train_df.copy()
35
+ store_sales = store_sales.set_index('date').to_period('D')
36
+ store_sales = store_sales.set_index(['state', 'category_of_product'], append=True)
37
+ average_sales = store_sales.groupby('date').mean()['sales']
38
+
39
+ dp = DeterministicProcess(
40
+ index=average_sales.index,
41
+ constant=False,
42
+ order=3,
43
+ drop=True
44
+ )
45
+ X = dp.in_sample()
46
+
47
+ # Generate the out-of-sample index for the specified date range
48
+ X_fore = dp.out_of_sample(steps=len(pd.date_range(start=start_date, end=end_date)))
49
+ X_fore.index = pd.date_range(start=start_date, end=end_date)
50
+
51
+ y = average_sales.copy()
52
+ model = LinearRegression()
53
+ model.fit(X, y)
54
+
55
+ y_fore = pd.Series(model.predict(X_fore), index=X_fore.index)
56
+
57
+ # Filter the predicted values within the specified date range
58
+ X_fore = X_fore[(X_fore.index >= start_date) & (X_fore.index <= end_date)]
59
+ y_fore = y_fore[(y_fore.index >= start_date) & (y_fore.index <= end_date)]
60
+
61
+ # Prepare data for bar chart
62
+ dates = [pred_date.strftime('%Y-%m-%d') for pred_date in X_fore.index]
63
+ predicted_sales = y_fore.tolist()
64
+
65
+ # Create and save the bar chart with improved layout
66
+ plt.figure(figsize=(10, 6))
67
+ plt.bar(dates, predicted_sales)
68
+ step_size = max(1, len(dates) // 10)
69
+ plt.xticks(np.arange(0, len(dates), step_size), dates[::step_size], rotation=45, ha="right")
70
+ plt.tight_layout()
71
+
72
+ buffer = io.BytesIO()
73
+ plt.savefig(buffer, format="png")
74
+ plt.close()
75
+
76
+ buffer.seek(0)
77
+ image_base64 = base64.b64encode(buffer.read()).decode()
78
+
79
+ # Prepare response including the bar chart image
80
+ response = {
81
+ "predictions": [
82
+ {
83
+ "date": dates[i],
84
+ "predicted_sales": predicted_sales[i]
85
+ }
86
+ for i in range(len(dates))
87
+ ],
88
+ "chart_image": f"data:image/png;base64,{image_base64}"
89
+ }
90
+
91
+ return response
92
+
93
+ if __name__ == "__main__":
94
+ import uvicorn
95
+
96
+ uvicorn.run(app, host="127.0.0.1", port=8000)
chart.png ADDED
date_to_week_id_map.csv ADDED
@@ -0,0 +1,822 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ date,week_id
2
+ 2012-01-01,49
3
+ 2012-01-02,49
4
+ 2012-01-03,49
5
+ 2012-01-04,49
6
+ 2012-01-05,49
7
+ 2012-01-06,49
8
+ 2012-01-07,50
9
+ 2012-01-08,50
10
+ 2012-01-09,50
11
+ 2012-01-10,50
12
+ 2012-01-11,50
13
+ 2012-01-12,50
14
+ 2012-01-13,50
15
+ 2012-01-14,51
16
+ 2012-01-15,51
17
+ 2012-01-16,51
18
+ 2012-01-17,51
19
+ 2012-01-18,51
20
+ 2012-01-19,51
21
+ 2012-01-20,51
22
+ 2012-01-21,52
23
+ 2012-01-22,52
24
+ 2012-01-23,52
25
+ 2012-01-24,52
26
+ 2012-01-25,52
27
+ 2012-01-26,52
28
+ 2012-01-27,52
29
+ 2012-01-28,53
30
+ 2012-01-29,53
31
+ 2012-01-30,53
32
+ 2012-01-31,53
33
+ 2012-02-01,53
34
+ 2012-02-02,53
35
+ 2012-02-03,53
36
+ 2012-02-04,54
37
+ 2012-02-05,54
38
+ 2012-02-06,54
39
+ 2012-02-07,54
40
+ 2012-02-08,54
41
+ 2012-02-09,54
42
+ 2012-02-10,54
43
+ 2012-02-11,55
44
+ 2012-02-12,55
45
+ 2012-02-13,55
46
+ 2012-02-14,55
47
+ 2012-02-15,55
48
+ 2012-02-16,55
49
+ 2012-02-17,55
50
+ 2012-02-18,56
51
+ 2012-02-19,56
52
+ 2012-02-20,56
53
+ 2012-02-21,56
54
+ 2012-02-22,56
55
+ 2012-02-23,56
56
+ 2012-02-24,56
57
+ 2012-02-25,57
58
+ 2012-02-26,57
59
+ 2012-02-27,57
60
+ 2012-02-28,57
61
+ 2012-02-29,57
62
+ 2012-03-01,57
63
+ 2012-03-02,57
64
+ 2012-03-03,58
65
+ 2012-03-04,58
66
+ 2012-03-05,58
67
+ 2012-03-06,58
68
+ 2012-03-07,58
69
+ 2012-03-08,58
70
+ 2012-03-09,58
71
+ 2012-03-10,59
72
+ 2012-03-11,59
73
+ 2012-03-12,59
74
+ 2012-03-13,59
75
+ 2012-03-14,59
76
+ 2012-03-15,59
77
+ 2012-03-16,59
78
+ 2012-03-17,60
79
+ 2012-03-18,60
80
+ 2012-03-19,60
81
+ 2012-03-20,60
82
+ 2012-03-21,60
83
+ 2012-03-22,60
84
+ 2012-03-23,60
85
+ 2012-03-24,61
86
+ 2012-03-25,61
87
+ 2012-03-26,61
88
+ 2012-03-27,61
89
+ 2012-03-28,61
90
+ 2012-03-29,61
91
+ 2012-03-30,61
92
+ 2012-03-31,62
93
+ 2012-04-01,62
94
+ 2012-04-02,62
95
+ 2012-04-03,62
96
+ 2012-04-04,62
97
+ 2012-04-05,62
98
+ 2012-04-06,62
99
+ 2012-04-07,63
100
+ 2012-04-08,63
101
+ 2012-04-09,63
102
+ 2012-04-10,63
103
+ 2012-04-11,63
104
+ 2012-04-12,63
105
+ 2012-04-13,63
106
+ 2012-04-14,64
107
+ 2012-04-15,64
108
+ 2012-04-16,64
109
+ 2012-04-17,64
110
+ 2012-04-18,64
111
+ 2012-04-19,64
112
+ 2012-04-20,64
113
+ 2012-04-21,65
114
+ 2012-04-22,65
115
+ 2012-04-23,65
116
+ 2012-04-24,65
117
+ 2012-04-25,65
118
+ 2012-04-26,65
119
+ 2012-04-27,65
120
+ 2012-04-28,66
121
+ 2012-04-29,66
122
+ 2012-04-30,66
123
+ 2012-05-01,66
124
+ 2012-05-02,66
125
+ 2012-05-03,66
126
+ 2012-05-04,66
127
+ 2012-05-05,67
128
+ 2012-05-06,67
129
+ 2012-05-07,67
130
+ 2012-05-08,67
131
+ 2012-05-09,67
132
+ 2012-05-10,67
133
+ 2012-05-11,67
134
+ 2012-05-12,68
135
+ 2012-05-13,68
136
+ 2012-05-14,68
137
+ 2012-05-15,68
138
+ 2012-05-16,68
139
+ 2012-05-17,68
140
+ 2012-05-18,68
141
+ 2012-05-19,69
142
+ 2012-05-20,69
143
+ 2012-05-21,69
144
+ 2012-05-22,69
145
+ 2012-05-23,69
146
+ 2012-05-24,69
147
+ 2012-05-25,69
148
+ 2012-05-26,70
149
+ 2012-05-27,70
150
+ 2012-05-28,70
151
+ 2012-05-29,70
152
+ 2012-05-30,70
153
+ 2012-05-31,70
154
+ 2012-06-01,70
155
+ 2012-06-02,71
156
+ 2012-06-03,71
157
+ 2012-06-04,71
158
+ 2012-06-05,71
159
+ 2012-06-06,71
160
+ 2012-06-07,71
161
+ 2012-06-08,71
162
+ 2012-06-09,72
163
+ 2012-06-10,72
164
+ 2012-06-11,72
165
+ 2012-06-12,72
166
+ 2012-06-13,72
167
+ 2012-06-14,72
168
+ 2012-06-15,72
169
+ 2012-06-16,73
170
+ 2012-06-17,73
171
+ 2012-06-18,73
172
+ 2012-06-19,73
173
+ 2012-06-20,73
174
+ 2012-06-21,73
175
+ 2012-06-22,73
176
+ 2012-06-23,74
177
+ 2012-06-24,74
178
+ 2012-06-25,74
179
+ 2012-06-26,74
180
+ 2012-06-27,74
181
+ 2012-06-28,74
182
+ 2012-06-29,74
183
+ 2012-06-30,75
184
+ 2012-07-01,75
185
+ 2012-07-02,75
186
+ 2012-07-03,75
187
+ 2012-07-04,75
188
+ 2012-07-05,75
189
+ 2012-07-06,75
190
+ 2012-07-07,76
191
+ 2012-07-08,76
192
+ 2012-07-09,76
193
+ 2012-07-10,76
194
+ 2012-07-11,76
195
+ 2012-07-12,76
196
+ 2012-07-13,76
197
+ 2012-07-14,77
198
+ 2012-07-15,77
199
+ 2012-07-16,77
200
+ 2012-07-17,77
201
+ 2012-07-18,77
202
+ 2012-07-19,77
203
+ 2012-07-20,77
204
+ 2012-07-21,78
205
+ 2012-07-22,78
206
+ 2012-07-23,78
207
+ 2012-07-24,78
208
+ 2012-07-25,78
209
+ 2012-07-26,78
210
+ 2012-07-27,78
211
+ 2012-07-28,79
212
+ 2012-07-29,79
213
+ 2012-07-30,79
214
+ 2012-07-31,79
215
+ 2012-08-01,79
216
+ 2012-08-02,79
217
+ 2012-08-03,79
218
+ 2012-08-04,80
219
+ 2012-08-05,80
220
+ 2012-08-06,80
221
+ 2012-08-07,80
222
+ 2012-08-08,80
223
+ 2012-08-09,80
224
+ 2012-08-10,80
225
+ 2012-08-11,81
226
+ 2012-08-12,81
227
+ 2012-08-13,81
228
+ 2012-08-14,81
229
+ 2012-08-15,81
230
+ 2012-08-16,81
231
+ 2012-08-17,81
232
+ 2012-08-18,82
233
+ 2012-08-19,82
234
+ 2012-08-20,82
235
+ 2012-08-21,82
236
+ 2012-08-22,82
237
+ 2012-08-23,82
238
+ 2012-08-24,82
239
+ 2012-08-25,83
240
+ 2012-08-26,83
241
+ 2012-08-27,83
242
+ 2012-08-28,83
243
+ 2012-08-29,83
244
+ 2012-08-30,83
245
+ 2012-08-31,83
246
+ 2012-09-01,84
247
+ 2012-09-02,84
248
+ 2012-09-03,84
249
+ 2012-09-04,84
250
+ 2012-09-05,84
251
+ 2012-09-06,84
252
+ 2012-09-07,84
253
+ 2012-09-08,85
254
+ 2012-09-09,85
255
+ 2012-09-10,85
256
+ 2012-09-11,85
257
+ 2012-09-12,85
258
+ 2012-09-13,85
259
+ 2012-09-14,85
260
+ 2012-09-15,86
261
+ 2012-09-16,86
262
+ 2012-09-17,86
263
+ 2012-09-18,86
264
+ 2012-09-19,86
265
+ 2012-09-20,86
266
+ 2012-09-21,86
267
+ 2012-09-22,87
268
+ 2012-09-23,87
269
+ 2012-09-24,87
270
+ 2012-09-25,87
271
+ 2012-09-26,87
272
+ 2012-09-27,87
273
+ 2012-09-28,87
274
+ 2012-09-29,88
275
+ 2012-09-30,88
276
+ 2012-10-01,88
277
+ 2012-10-02,88
278
+ 2012-10-03,88
279
+ 2012-10-04,88
280
+ 2012-10-05,88
281
+ 2012-10-06,89
282
+ 2012-10-07,89
283
+ 2012-10-08,89
284
+ 2012-10-09,89
285
+ 2012-10-10,89
286
+ 2012-10-11,89
287
+ 2012-10-12,89
288
+ 2012-10-13,90
289
+ 2012-10-14,90
290
+ 2012-10-15,90
291
+ 2012-10-16,90
292
+ 2012-10-17,90
293
+ 2012-10-18,90
294
+ 2012-10-19,90
295
+ 2012-10-20,91
296
+ 2012-10-21,91
297
+ 2012-10-22,91
298
+ 2012-10-23,91
299
+ 2012-10-24,91
300
+ 2012-10-25,91
301
+ 2012-10-26,91
302
+ 2012-10-27,92
303
+ 2012-10-28,92
304
+ 2012-10-29,92
305
+ 2012-10-30,92
306
+ 2012-10-31,92
307
+ 2012-11-01,92
308
+ 2012-11-02,92
309
+ 2012-11-03,93
310
+ 2012-11-04,93
311
+ 2012-11-05,93
312
+ 2012-11-06,93
313
+ 2012-11-07,93
314
+ 2012-11-08,93
315
+ 2012-11-09,93
316
+ 2012-11-10,94
317
+ 2012-11-11,94
318
+ 2012-11-12,94
319
+ 2012-11-13,94
320
+ 2012-11-14,94
321
+ 2012-11-15,94
322
+ 2012-11-16,94
323
+ 2012-11-17,95
324
+ 2012-11-18,95
325
+ 2012-11-19,95
326
+ 2012-11-20,95
327
+ 2012-11-21,95
328
+ 2012-11-22,95
329
+ 2012-11-23,95
330
+ 2012-11-24,96
331
+ 2012-11-25,96
332
+ 2012-11-26,96
333
+ 2012-11-27,96
334
+ 2012-11-28,96
335
+ 2012-11-29,96
336
+ 2012-11-30,96
337
+ 2012-12-01,97
338
+ 2012-12-02,97
339
+ 2012-12-03,97
340
+ 2012-12-04,97
341
+ 2012-12-05,97
342
+ 2012-12-06,97
343
+ 2012-12-07,97
344
+ 2012-12-08,98
345
+ 2012-12-09,98
346
+ 2012-12-10,98
347
+ 2012-12-11,98
348
+ 2012-12-12,98
349
+ 2012-12-13,98
350
+ 2012-12-14,98
351
+ 2012-12-15,99
352
+ 2012-12-16,99
353
+ 2012-12-17,99
354
+ 2012-12-18,99
355
+ 2012-12-19,99
356
+ 2012-12-20,99
357
+ 2012-12-21,99
358
+ 2012-12-22,100
359
+ 2012-12-23,100
360
+ 2012-12-24,100
361
+ 2012-12-25,100
362
+ 2012-12-26,100
363
+ 2012-12-27,100
364
+ 2012-12-28,100
365
+ 2012-12-29,101
366
+ 2012-12-30,101
367
+ 2012-12-31,101
368
+ 2013-01-01,101
369
+ 2013-01-02,101
370
+ 2013-01-03,101
371
+ 2013-01-04,101
372
+ 2013-01-05,102
373
+ 2013-01-06,102
374
+ 2013-01-07,102
375
+ 2013-01-08,102
376
+ 2013-01-09,102
377
+ 2013-01-10,102
378
+ 2013-01-11,102
379
+ 2013-01-12,103
380
+ 2013-01-13,103
381
+ 2013-01-14,103
382
+ 2013-01-15,103
383
+ 2013-01-16,103
384
+ 2013-01-17,103
385
+ 2013-01-18,103
386
+ 2013-01-19,104
387
+ 2013-01-20,104
388
+ 2013-01-21,104
389
+ 2013-01-22,104
390
+ 2013-01-23,104
391
+ 2013-01-24,104
392
+ 2013-01-25,104
393
+ 2013-01-26,105
394
+ 2013-01-27,105
395
+ 2013-01-28,105
396
+ 2013-01-29,105
397
+ 2013-01-30,105
398
+ 2013-01-31,105
399
+ 2013-02-01,105
400
+ 2013-02-02,106
401
+ 2013-02-03,106
402
+ 2013-02-04,106
403
+ 2013-02-05,106
404
+ 2013-02-06,106
405
+ 2013-02-07,106
406
+ 2013-02-08,106
407
+ 2013-02-09,107
408
+ 2013-02-10,107
409
+ 2013-02-11,107
410
+ 2013-02-12,107
411
+ 2013-02-13,107
412
+ 2013-02-14,107
413
+ 2013-02-15,107
414
+ 2013-02-16,108
415
+ 2013-02-17,108
416
+ 2013-02-18,108
417
+ 2013-02-19,108
418
+ 2013-02-20,108
419
+ 2013-02-21,108
420
+ 2013-02-22,108
421
+ 2013-02-23,109
422
+ 2013-02-24,109
423
+ 2013-02-25,109
424
+ 2013-02-26,109
425
+ 2013-02-27,109
426
+ 2013-02-28,109
427
+ 2013-03-01,109
428
+ 2013-03-02,110
429
+ 2013-03-03,110
430
+ 2013-03-04,110
431
+ 2013-03-05,110
432
+ 2013-03-06,110
433
+ 2013-03-07,110
434
+ 2013-03-08,110
435
+ 2013-03-09,111
436
+ 2013-03-10,111
437
+ 2013-03-11,111
438
+ 2013-03-12,111
439
+ 2013-03-13,111
440
+ 2013-03-14,111
441
+ 2013-03-15,111
442
+ 2013-03-16,112
443
+ 2013-03-17,112
444
+ 2013-03-18,112
445
+ 2013-03-19,112
446
+ 2013-03-20,112
447
+ 2013-03-21,112
448
+ 2013-03-22,112
449
+ 2013-03-23,113
450
+ 2013-03-24,113
451
+ 2013-03-25,113
452
+ 2013-03-26,113
453
+ 2013-03-27,113
454
+ 2013-03-28,113
455
+ 2013-03-29,113
456
+ 2013-03-30,114
457
+ 2013-03-31,114
458
+ 2013-04-01,114
459
+ 2013-04-02,114
460
+ 2013-04-03,114
461
+ 2013-04-04,114
462
+ 2013-04-05,114
463
+ 2013-04-06,115
464
+ 2013-04-07,115
465
+ 2013-04-08,115
466
+ 2013-04-09,115
467
+ 2013-04-10,115
468
+ 2013-04-11,115
469
+ 2013-04-12,115
470
+ 2013-04-13,116
471
+ 2013-04-14,116
472
+ 2013-04-15,116
473
+ 2013-04-16,116
474
+ 2013-04-17,116
475
+ 2013-04-18,116
476
+ 2013-04-19,116
477
+ 2013-04-20,117
478
+ 2013-04-21,117
479
+ 2013-04-22,117
480
+ 2013-04-23,117
481
+ 2013-04-24,117
482
+ 2013-04-25,117
483
+ 2013-04-26,117
484
+ 2013-04-27,118
485
+ 2013-04-28,118
486
+ 2013-04-29,118
487
+ 2013-04-30,118
488
+ 2013-05-01,118
489
+ 2013-05-02,118
490
+ 2013-05-03,118
491
+ 2013-05-04,119
492
+ 2013-05-05,119
493
+ 2013-05-06,119
494
+ 2013-05-07,119
495
+ 2013-05-08,119
496
+ 2013-05-09,119
497
+ 2013-05-10,119
498
+ 2013-05-11,120
499
+ 2013-05-12,120
500
+ 2013-05-13,120
501
+ 2013-05-14,120
502
+ 2013-05-15,120
503
+ 2013-05-16,120
504
+ 2013-05-17,120
505
+ 2013-05-18,121
506
+ 2013-05-19,121
507
+ 2013-05-20,121
508
+ 2013-05-21,121
509
+ 2013-05-22,121
510
+ 2013-05-23,121
511
+ 2013-05-24,121
512
+ 2013-05-25,122
513
+ 2013-05-26,122
514
+ 2013-05-27,122
515
+ 2013-05-28,122
516
+ 2013-05-29,122
517
+ 2013-05-30,122
518
+ 2013-05-31,122
519
+ 2013-06-01,123
520
+ 2013-06-02,123
521
+ 2013-06-03,123
522
+ 2013-06-04,123
523
+ 2013-06-05,123
524
+ 2013-06-06,123
525
+ 2013-06-07,123
526
+ 2013-06-08,124
527
+ 2013-06-09,124
528
+ 2013-06-10,124
529
+ 2013-06-11,124
530
+ 2013-06-12,124
531
+ 2013-06-13,124
532
+ 2013-06-14,124
533
+ 2013-06-15,125
534
+ 2013-06-16,125
535
+ 2013-06-17,125
536
+ 2013-06-18,125
537
+ 2013-06-19,125
538
+ 2013-06-20,125
539
+ 2013-06-21,125
540
+ 2013-06-22,126
541
+ 2013-06-23,126
542
+ 2013-06-24,126
543
+ 2013-06-25,126
544
+ 2013-06-26,126
545
+ 2013-06-27,126
546
+ 2013-06-28,126
547
+ 2013-06-29,127
548
+ 2013-06-30,127
549
+ 2013-07-01,127
550
+ 2013-07-02,127
551
+ 2013-07-03,127
552
+ 2013-07-04,127
553
+ 2013-07-05,127
554
+ 2013-07-06,128
555
+ 2013-07-07,128
556
+ 2013-07-08,128
557
+ 2013-07-09,128
558
+ 2013-07-10,128
559
+ 2013-07-11,128
560
+ 2013-07-12,128
561
+ 2013-07-13,129
562
+ 2013-07-14,129
563
+ 2013-07-15,129
564
+ 2013-07-16,129
565
+ 2013-07-17,129
566
+ 2013-07-18,129
567
+ 2013-07-19,129
568
+ 2013-07-20,130
569
+ 2013-07-21,130
570
+ 2013-07-22,130
571
+ 2013-07-23,130
572
+ 2013-07-24,130
573
+ 2013-07-25,130
574
+ 2013-07-26,130
575
+ 2013-07-27,131
576
+ 2013-07-28,131
577
+ 2013-07-29,131
578
+ 2013-07-30,131
579
+ 2013-07-31,131
580
+ 2013-08-01,131
581
+ 2013-08-02,131
582
+ 2013-08-03,132
583
+ 2013-08-04,132
584
+ 2013-08-05,132
585
+ 2013-08-06,132
586
+ 2013-08-07,132
587
+ 2013-08-08,132
588
+ 2013-08-09,132
589
+ 2013-08-10,133
590
+ 2013-08-11,133
591
+ 2013-08-12,133
592
+ 2013-08-13,133
593
+ 2013-08-14,133
594
+ 2013-08-15,133
595
+ 2013-08-16,133
596
+ 2013-08-17,134
597
+ 2013-08-18,134
598
+ 2013-08-19,134
599
+ 2013-08-20,134
600
+ 2013-08-21,134
601
+ 2013-08-22,134
602
+ 2013-08-23,134
603
+ 2013-08-24,135
604
+ 2013-08-25,135
605
+ 2013-08-26,135
606
+ 2013-08-27,135
607
+ 2013-08-28,135
608
+ 2013-08-29,135
609
+ 2013-08-30,135
610
+ 2013-08-31,136
611
+ 2013-09-01,136
612
+ 2013-09-02,136
613
+ 2013-09-03,136
614
+ 2013-09-04,136
615
+ 2013-09-05,136
616
+ 2013-09-06,136
617
+ 2013-09-07,137
618
+ 2013-09-08,137
619
+ 2013-09-09,137
620
+ 2013-09-10,137
621
+ 2013-09-11,137
622
+ 2013-09-12,137
623
+ 2013-09-13,137
624
+ 2013-09-14,138
625
+ 2013-09-15,138
626
+ 2013-09-16,138
627
+ 2013-09-17,138
628
+ 2013-09-18,138
629
+ 2013-09-19,138
630
+ 2013-09-20,138
631
+ 2013-09-21,139
632
+ 2013-09-22,139
633
+ 2013-09-23,139
634
+ 2013-09-24,139
635
+ 2013-09-25,139
636
+ 2013-09-26,139
637
+ 2013-09-27,139
638
+ 2013-09-28,140
639
+ 2013-09-29,140
640
+ 2013-09-30,140
641
+ 2013-10-01,140
642
+ 2013-10-02,140
643
+ 2013-10-03,140
644
+ 2013-10-04,140
645
+ 2013-10-05,141
646
+ 2013-10-06,141
647
+ 2013-10-07,141
648
+ 2013-10-08,141
649
+ 2013-10-09,141
650
+ 2013-10-10,141
651
+ 2013-10-11,141
652
+ 2013-10-12,142
653
+ 2013-10-13,142
654
+ 2013-10-14,142
655
+ 2013-10-15,142
656
+ 2013-10-16,142
657
+ 2013-10-17,142
658
+ 2013-10-18,142
659
+ 2013-10-19,143
660
+ 2013-10-20,143
661
+ 2013-10-21,143
662
+ 2013-10-22,143
663
+ 2013-10-23,143
664
+ 2013-10-24,143
665
+ 2013-10-25,143
666
+ 2013-10-26,144
667
+ 2013-10-27,144
668
+ 2013-10-28,144
669
+ 2013-10-29,144
670
+ 2013-10-30,144
671
+ 2013-10-31,144
672
+ 2013-11-01,144
673
+ 2013-11-02,145
674
+ 2013-11-03,145
675
+ 2013-11-04,145
676
+ 2013-11-05,145
677
+ 2013-11-06,145
678
+ 2013-11-07,145
679
+ 2013-11-08,145
680
+ 2013-11-09,146
681
+ 2013-11-10,146
682
+ 2013-11-11,146
683
+ 2013-11-12,146
684
+ 2013-11-13,146
685
+ 2013-11-14,146
686
+ 2013-11-15,146
687
+ 2013-11-16,147
688
+ 2013-11-17,147
689
+ 2013-11-18,147
690
+ 2013-11-19,147
691
+ 2013-11-20,147
692
+ 2013-11-21,147
693
+ 2013-11-22,147
694
+ 2013-11-23,148
695
+ 2013-11-24,148
696
+ 2013-11-25,148
697
+ 2013-11-26,148
698
+ 2013-11-27,148
699
+ 2013-11-28,148
700
+ 2013-11-29,148
701
+ 2013-11-30,149
702
+ 2013-12-01,149
703
+ 2013-12-02,149
704
+ 2013-12-03,149
705
+ 2013-12-04,149
706
+ 2013-12-05,149
707
+ 2013-12-06,149
708
+ 2013-12-07,150
709
+ 2013-12-08,150
710
+ 2013-12-09,150
711
+ 2013-12-10,150
712
+ 2013-12-11,150
713
+ 2013-12-12,150
714
+ 2013-12-13,150
715
+ 2013-12-14,151
716
+ 2013-12-15,151
717
+ 2013-12-16,151
718
+ 2013-12-17,151
719
+ 2013-12-18,151
720
+ 2013-12-19,151
721
+ 2013-12-20,151
722
+ 2013-12-21,152
723
+ 2013-12-22,152
724
+ 2013-12-23,152
725
+ 2013-12-24,152
726
+ 2013-12-25,152
727
+ 2013-12-26,152
728
+ 2013-12-27,152
729
+ 2013-12-28,153
730
+ 2013-12-29,153
731
+ 2013-12-30,153
732
+ 2013-12-31,153
733
+ 2014-01-01,153
734
+ 2014-01-02,153
735
+ 2014-01-03,153
736
+ 2014-01-04,154
737
+ 2014-01-05,154
738
+ 2014-01-06,154
739
+ 2014-01-07,154
740
+ 2014-01-08,154
741
+ 2014-01-09,154
742
+ 2014-01-10,154
743
+ 2014-01-11,155
744
+ 2014-01-12,155
745
+ 2014-01-13,155
746
+ 2014-01-14,155
747
+ 2014-01-15,155
748
+ 2014-01-16,155
749
+ 2014-01-17,155
750
+ 2014-01-18,156
751
+ 2014-01-19,156
752
+ 2014-01-20,156
753
+ 2014-01-21,156
754
+ 2014-01-22,156
755
+ 2014-01-23,156
756
+ 2014-01-24,156
757
+ 2014-01-25,157
758
+ 2014-01-26,157
759
+ 2014-01-27,157
760
+ 2014-01-28,157
761
+ 2014-01-29,157
762
+ 2014-01-30,157
763
+ 2014-01-31,157
764
+ 2014-02-01,158
765
+ 2014-02-02,158
766
+ 2014-02-03,158
767
+ 2014-02-04,158
768
+ 2014-02-05,158
769
+ 2014-02-06,158
770
+ 2014-02-07,158
771
+ 2014-02-08,159
772
+ 2014-02-09,159
773
+ 2014-02-10,159
774
+ 2014-02-11,159
775
+ 2014-02-12,159
776
+ 2014-02-13,159
777
+ 2014-02-14,159
778
+ 2014-02-15,160
779
+ 2014-02-16,160
780
+ 2014-02-17,160
781
+ 2014-02-18,160
782
+ 2014-02-19,160
783
+ 2014-02-20,160
784
+ 2014-02-21,160
785
+ 2014-02-22,161
786
+ 2014-02-23,161
787
+ 2014-02-24,161
788
+ 2014-02-25,161
789
+ 2014-02-26,161
790
+ 2014-02-27,161
791
+ 2014-02-28,161
792
+ 2014-03-01,162
793
+ 2014-03-02,162
794
+ 2014-03-03,162
795
+ 2014-03-04,162
796
+ 2014-03-05,162
797
+ 2014-03-06,162
798
+ 2014-03-07,162
799
+ 2014-03-08,163
800
+ 2014-03-09,163
801
+ 2014-03-10,163
802
+ 2014-03-11,163
803
+ 2014-03-12,163
804
+ 2014-03-13,163
805
+ 2014-03-14,163
806
+ 2014-03-15,164
807
+ 2014-03-16,164
808
+ 2014-03-17,164
809
+ 2014-03-18,164
810
+ 2014-03-19,164
811
+ 2014-03-20,164
812
+ 2014-03-21,164
813
+ 2014-03-22,165
814
+ 2014-03-23,165
815
+ 2014-03-24,165
816
+ 2014-03-25,165
817
+ 2014-03-26,165
818
+ 2014-03-27,165
819
+ 2014-03-28,165
820
+ 2014-03-29,166
821
+ 2014-03-30,166
822
+ 2014-03-31,166
product_prices.csv ADDED
The diff for this file is too large to render. See raw diff
 
sample_submission.csv ADDED
The diff for this file is too large to render. See raw diff
 
static/style.css ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body {
2
+ font-family: Arial, sans-serif;
3
+ margin: 20px;
4
+ }
5
+
6
+ h1 {
7
+ margin-bottom: 20px;
8
+ }
9
+
10
+ form {
11
+ margin-bottom: 20px;
12
+ }
13
+
14
+ #chart-container img {
15
+ max-width: 100%;
16
+ }
templates/predict_form.html ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Predict Sales</title>
5
+ <link rel="stylesheet" href="{{ url_for('static', path='style.css') }}">
6
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr@4.6.9/dist/flatpickr.min.css">
7
+ <script src="https://cdn.jsdelivr.net/npm/flatpickr@4.6.9/dist/flatpickr.min.js"></script>
8
+ </head>
9
+ <body>
10
+ <h1>Predict Sales</h1>
11
+ <form id="date-form" action="/predict/" method="post">
12
+ <label for="start_date">Start Date:</label>
13
+ <input type="text" id="start_date" name="start_date" required><br><br>
14
+
15
+ <label for="end_date">End Date:</label>
16
+ <input type="text" id="end_date" name="end_date" required><br><br>
17
+
18
+ <button type="submit">Predict</button>
19
+ </form>
20
+
21
+ <div id="chart-container">
22
+ {% if chart_image %}
23
+ <img src="{{ chart_image }}" alt="Predicted Sales Chart">
24
+ {% endif %}
25
+ </div>
26
+
27
+ <script>
28
+ flatpickr("#start_date", {
29
+ dateFormat: "Y-m-d"
30
+ });
31
+
32
+ flatpickr("#end_date", {
33
+ dateFormat: "Y-m-d"
34
+ });
35
+ </script>
36
+ </body>
37
+ </html>
test_data.csv ADDED
The diff for this file is too large to render. See raw diff
 
train_data.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5b48cf42807c08d92c272c90c33558ac8a73bcc18723689fbc3854fca46de9b
3
+ size 22223196