-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfinal_pred.py
2414 lines (2014 loc) · 92.5 KB
/
final_pred.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#importing packages to read the csv files
import pandas as pd
import numpy as np
import math
#reading the csv files
default_quantity_data_A=pd.read_csv('DEFAULT_A.csv')
default_quantity_data_B=pd.read_csv('DEFAULT_B.csv')
default_quantity_data_C=pd.read_csv('DEFAULT_C.csv')
pizza_data=pd.read_csv('pizza.csv')
burger_data=pd.read_csv('Burger.csv')
non_veg_thali_data=pd.read_csv('Non_veg_thali.csv')
veg_thali_data=pd.read_csv('veg_thali.csv')
dosa_data=pd.read_csv('Dosa.csv')
sandwich_data=pd.read_csv('Sandwich.csv')
pav_bhaji_data=pd.read_csv('Pav_bhaji.csv')
misal_data=pd.read_csv('Misal.csv')
idli_data=pd.read_csv('idli.csv')
kichdi_data=pd.read_csv('kichdi.csv')
#importing the encoding library to convert string values to numeric values
from sklearn.preprocessing import LabelEncoder
labelencoder_X=LabelEncoder()
#importing the decision tree model
from sklearn.tree import DecisionTreeRegressor
regressor = DecisionTreeRegressor(random_state = 0)
#importing the train test split
from sklearn.model_selection import train_test_split
#analysis for restaurant A
#pizza analysis for restaurant A
group_data_pizza_A=pizza_data.groupby("Restaurant")
pizza_for_rest_A=group_data_pizza_A.get_group('A')
weekday_input_pizza_A=pizza_for_rest_A[['Weekday']]
weekday_input_pizza_A=weekday_input_pizza_A.apply(labelencoder_X.fit_transform)
pizza_out=pizza_for_rest_A[['Pizza']]
X_train_pizza_A,X_test_pizza_A,Y_train_pizza_A,Y_test_pizza_A = train_test_split(weekday_input_pizza_A,pizza_out,test_size=0.2,random_state=0)
regressor.fit(X_train_pizza_A, Y_train_pizza_A)
'''
The label enocoding for pizza is as follows
Monday-1
Tuesday-5
Wednesday-6
Thursday-4
Friday-0
Saturday-2
Sunday-3
'''
pizza_pred_A_Monday = int(regressor.predict([[1]]))
pizza_pred_A_Tuesday = int(regressor.predict([[5]]))
pizza_pred_A_Wednesday = int(regressor.predict([[6]]))
pizza_pred_A_Thursday = int(regressor.predict([[4]]))
pizza_pred_A_Friday = int(regressor.predict([[0]]))
pizza_pred_A_Saturday = int(regressor.predict([[1]]))
pizza_pred_A_Sunday = int(regressor.predict([[3]]))
#reading the default csv file
weekly_pizza_pred_A= pizza_pred_A_Monday+pizza_pred_A_Tuesday+pizza_pred_A_Wednesday+pizza_pred_A_Thursday+pizza_pred_A_Friday+pizza_pred_A_Saturday+pizza_pred_A_Sunday
default_quantity_data_A_pizza=default_quantity_data_A.iloc[0,].values
pizza_A_list=default_quantity_data_A_pizza.tolist()
pizza_A_list=pizza_A_list[1:]
pizza_A_tomato=pizza_A_list[0]*weekly_pizza_pred_A
pizza_A_onion=pizza_A_list[1]*weekly_pizza_pred_A
pizza_A_capsicum=pizza_A_list[2]*weekly_pizza_pred_A
pizza_A_bread=pizza_A_list[3]*weekly_pizza_pred_A
pizza_A_dough=pizza_A_list[4]*weekly_pizza_pred_A
pizza_A_chicken=pizza_A_list[5]*weekly_pizza_pred_A
pizza_A_cheese=pizza_A_list[6]*weekly_pizza_pred_A
pizza_A_corn=pizza_A_list[7]*weekly_pizza_pred_A
pizza_A_rava=pizza_A_list[8]*weekly_pizza_pred_A
pizza_A_sabudana=pizza_A_list[9]*weekly_pizza_pred_A
pizza_A_masala=pizza_A_list[10]*weekly_pizza_pred_A
pizza_A_vegetables=pizza_A_list[11]*weekly_pizza_pred_A
pizza_A_dal=pizza_A_list[12]*weekly_pizza_pred_A
pizza_A_flour=pizza_A_list[13]*weekly_pizza_pred_A
pizza_A_rice=pizza_A_list[14]*weekly_pizza_pred_A
pizza_A_papad=pizza_A_list[15]*weekly_pizza_pred_A
pizza_A_butter=pizza_A_list[16]*weekly_pizza_pred_A
#Burger Analysis for restaurant A
group_data_burger_A=burger_data.groupby("Restaurant")
burger_for_rest_A=group_data_burger_A.get_group('A')
weekday_input_burger_A=burger_for_rest_A[['Weekday']]
weekday_input_burger_A=weekday_input_burger_A.apply(labelencoder_X.fit_transform)
burger_out=burger_for_rest_A[['Burger']]
X_train_burger_A,X_test_burger_A,Y_train_burger_A,Y_test_burger_A = train_test_split(weekday_input_burger_A,burger_out,test_size=0.2,random_state=0)
regressor.fit(X_train_burger_A, Y_train_burger_A)
burger_sum=0
for i in range(0,7):
burger_predict_sum=regressor.predict([[i]])
burger_sum=burger_sum+burger_predict_sum
burger_sum=int(burger_sum)
default_quantity_data_A_burger=default_quantity_data_A.iloc[1,].values
burger_A_list=default_quantity_data_A_burger.tolist()
burger_A_list=burger_A_list[1:]
burger_A_tomato=burger_A_list[0]*burger_sum
burger_A_onion=burger_A_list[1]*burger_sum
burger_A_capsicum=burger_A_list[2]*burger_sum
burger_A_bread=burger_A_list[3]*burger_sum
burger_A_dough=burger_A_list[4]*burger_sum
burger_A_chicken=burger_A_list[5]*burger_sum
burger_A_cheese=burger_A_list[6]*burger_sum
burger_A_corn=burger_A_list[7]*burger_sum
burger_A_rava=burger_A_list[8]*burger_sum
burger_A_sabudana=burger_A_list[9]*burger_sum
burger_A_masala=burger_A_list[10]*burger_sum
burger_A_vegetables=burger_A_list[11]*burger_sum
burger_A_dal=burger_A_list[12]*burger_sum
burger_A_flour=burger_A_list[13]*burger_sum
burger_A_rice=burger_A_list[14]*burger_sum
burger_A_papad=burger_A_list[15]*burger_sum
burger_A_butter=burger_A_list[16]*burger_sum
#Non veg thali prediction for resturant A
group_data_nonveg_A=non_veg_thali_data.groupby("Restaurant")
nonveg_for_rest_A=group_data_nonveg_A.get_group('A')
weekday_input_nonveg_A=nonveg_for_rest_A[['Weekday']]
weekday_input_nonveg_A=weekday_input_nonveg_A.apply(labelencoder_X.fit_transform)
nonveg_out=nonveg_for_rest_A[['Non Veg Thali']]
X_train_nonveg_A,X_test_nonveg_A,Y_train_nonveg_A,Y_test_nonveg_A = train_test_split(weekday_input_nonveg_A,nonveg_out,test_size=0.2,random_state=0)
regressor.fit(X_train_nonveg_A, Y_train_nonveg_A)
nonveg_sum=0
for i in range(0,7):
nonveg_predict_sum=regressor.predict([[i]])
nonveg_sum=nonveg_sum+nonveg_predict_sum
nonveg_sum=int(nonveg_sum)
default_quantity_data_A_nonveg=default_quantity_data_A.iloc[2,].values
nonveg_A_list=default_quantity_data_A_nonveg.tolist()
nonveg_A_list=nonveg_A_list[1:]
nonveg_A_tomato=nonveg_A_list[0]*nonveg_sum
nonveg_A_onion=nonveg_A_list[1]*nonveg_sum
nonveg_A_capsicum=nonveg_A_list[2]*nonveg_sum
nonveg_A_bread=nonveg_A_list[3]*nonveg_sum
nonveg_A_dough=nonveg_A_list[4]*nonveg_sum
nonveg_A_chicken=nonveg_A_list[5]*nonveg_sum
nonveg_A_cheese=nonveg_A_list[6]*nonveg_sum
nonveg_A_corn=nonveg_A_list[7]*nonveg_sum
nonveg_A_rava=nonveg_A_list[8]*nonveg_sum
nonveg_A_sabudana=nonveg_A_list[9]*nonveg_sum
nonveg_A_masala=nonveg_A_list[10]*nonveg_sum
nonveg_A_vegetables=nonveg_A_list[11]*nonveg_sum
nonveg_A_dal=nonveg_A_list[12]*nonveg_sum
nonveg_A_flour=nonveg_A_list[13]*nonveg_sum
nonveg_A_rice=nonveg_A_list[14]*nonveg_sum
nonveg_A_papad=nonveg_A_list[15]*nonveg_sum
nonveg_A_butter=nonveg_A_list[16]*nonveg_sum
#Veg Thali analysis for restauarant A
group_data_veg_A=veg_thali_data.groupby("Restaurant")
veg_for_rest_A=group_data_veg_A.get_group('A')
weekday_input_veg_A=veg_for_rest_A[['Weekday']]
weekday_input_veg_A=weekday_input_veg_A.apply(labelencoder_X.fit_transform)
veg_out=veg_for_rest_A[['Veg Thali']]
X_train_veg_A,X_test_veg_A,Y_train_veg_A,Y_test_veg_A = train_test_split(weekday_input_veg_A,veg_out,test_size=0.2,random_state=0)
regressor.fit(X_train_veg_A, Y_train_veg_A)
veg_sum=0
for i in range(0,7):
veg_predict_sum=regressor.predict([[i]])
veg_sum=veg_sum+veg_predict_sum
veg_sum=int(veg_sum)
default_quantity_data_A_veg=default_quantity_data_A.iloc[3,].values
veg_A_list=default_quantity_data_A_veg.tolist()
veg_A_list=veg_A_list[1:]
veg_A_tomato=veg_A_list[0]*veg_sum
veg_A_onion=veg_A_list[1]*veg_sum
veg_A_capsicum=veg_A_list[2]*veg_sum
veg_A_bread=veg_A_list[3]*veg_sum
veg_A_dough=veg_A_list[4]*veg_sum
veg_A_chicken=veg_A_list[5]*veg_sum
veg_A_cheese=veg_A_list[6]*veg_sum
veg_A_corn=veg_A_list[7]*veg_sum
veg_A_rava=veg_A_list[8]*veg_sum
veg_A_sabudana=veg_A_list[9]*veg_sum
veg_A_masala=veg_A_list[10]*veg_sum
veg_A_vegetables=veg_A_list[11]*veg_sum
veg_A_dal=veg_A_list[12]*veg_sum
veg_A_flour=veg_A_list[13]*veg_sum
veg_A_rice=veg_A_list[14]*veg_sum
veg_A_papad=veg_A_list[15]*veg_sum
veg_A_butter=veg_A_list[16]*veg_sum
#Dosa analysis for restauarant A
group_data_dosa_A=dosa_data.groupby("Restaurant")
dosa_for_rest_A=group_data_dosa_A.get_group('A')
weekday_input_dosa_A=dosa_for_rest_A[['Weekday']]
weekday_input_dosa_A=weekday_input_dosa_A.apply(labelencoder_X.fit_transform)
dosa_out=dosa_for_rest_A[['Dosa']]
X_train_dosa_A,X_test_dosa_A,Y_train_dosa_A,Y_test_dosa_A = train_test_split(weekday_input_dosa_A,dosa_out,test_size=0.2,random_state=0)
regressor.fit(X_train_dosa_A, Y_train_dosa_A)
dosa_sum=0
for i in range(0,7):
dosa_predict_sum=regressor.predict([[i]])
dosa_sum=dosa_sum+dosa_predict_sum
dosa_sum=int(dosa_sum)
default_quantity_data_A_dosa=default_quantity_data_A.iloc[4,].values
dosa_A_list=default_quantity_data_A_dosa.tolist()
dosa_A_list=dosa_A_list[1:]
dosa_A_tomato=dosa_A_list[0]*dosa_sum
dosa_A_onion=dosa_A_list[1]*dosa_sum
dosa_A_capsicum=dosa_A_list[2]*dosa_sum
dosa_A_bread=dosa_A_list[3]*dosa_sum
dosa_A_dough=dosa_A_list[4]*dosa_sum
dosa_A_chicken=dosa_A_list[5]*dosa_sum
dosa_A_cheese=dosa_A_list[6]*dosa_sum
dosa_A_corn=dosa_A_list[7]*dosa_sum
dosa_A_rava=dosa_A_list[8]*dosa_sum
dosa_A_sabudana=dosa_A_list[9]*dosa_sum
dosa_A_masala=dosa_A_list[10]*dosa_sum
dosa_A_vegetables=dosa_A_list[11]*dosa_sum
dosa_A_dal=dosa_A_list[12]*dosa_sum
dosa_A_flour=dosa_A_list[13]*dosa_sum
dosa_A_rice=dosa_A_list[14]*dosa_sum
dosa_A_papad=dosa_A_list[15]*dosa_sum
dosa_A_butter=dosa_A_list[16]*dosa_sum
#Sandwich analysis for restaurant A
group_data_sandwich_A=sandwich_data.groupby("Restaurant")
sandwich_for_rest_A=group_data_sandwich_A.get_group('A')
weekday_input_sandwich_A=sandwich_for_rest_A[['Weekday']]
weekday_input_sandwich_A=weekday_input_sandwich_A.apply(labelencoder_X.fit_transform)
sandwich_out=sandwich_for_rest_A[['Sandwich']]
X_train_sandwich_A,X_test_sandwich_A,Y_train_sandwich_A,Y_test_sandwich_A = train_test_split(weekday_input_sandwich_A,sandwich_out,test_size=0.2,random_state=0)
regressor.fit(X_train_sandwich_A, Y_train_sandwich_A)
sandwich_sum=0
for i in range(0,7):
sandwich_predict_sum=regressor.predict([[i]])
sandwich_sum=sandwich_sum+sandwich_predict_sum
sandwich_sum=int(sandwich_sum)
default_quantity_data_A_sandwich=default_quantity_data_A.iloc[5,].values
sandwich_A_list=default_quantity_data_A_sandwich.tolist()
sandwich_A_list=sandwich_A_list[1:]
sandwich_A_tomato=sandwich_A_list[0]*sandwich_sum
sandwich_A_onion=sandwich_A_list[1]*sandwich_sum
sandwich_A_capsicum=sandwich_A_list[2]*sandwich_sum
sandwich_A_bread=sandwich_A_list[3]*sandwich_sum
sandwich_A_dough=sandwich_A_list[4]*sandwich_sum
sandwich_A_chicken=sandwich_A_list[5]*sandwich_sum
sandwich_A_cheese=sandwich_A_list[6]*sandwich_sum
sandwich_A_corn=sandwich_A_list[7]*sandwich_sum
sandwich_A_rava=sandwich_A_list[8]*sandwich_sum
sandwich_A_sabudana=sandwich_A_list[9]*sandwich_sum
sandwich_A_masala=sandwich_A_list[10]*sandwich_sum
sandwich_A_vegetables=sandwich_A_list[11]*sandwich_sum
sandwich_A_dal=sandwich_A_list[12]*sandwich_sum
sandwich_A_flour=sandwich_A_list[13]*sandwich_sum
sandwich_A_rice=sandwich_A_list[14]*sandwich_sum
sandwich_A_papad=sandwich_A_list[15]*sandwich_sum
sandwich_A_butter=sandwich_A_list[16]*sandwich_sum
#Pav Bhaji analysis for restaurant A
group_data_pavbhaji_A=pav_bhaji_data.groupby("Restaurant")
pavbhaji_for_rest_A=group_data_pavbhaji_A.get_group('A')
weekday_input_pavbhaji_A=pavbhaji_for_rest_A[['Weekday']]
weekday_input_pavbhaji_A=weekday_input_pavbhaji_A.apply(labelencoder_X.fit_transform)
pavbhaji_out=pavbhaji_for_rest_A[['Pav Bhaji']]
X_train_pavbhaji_A,X_test_pavbhaji_A,Y_train_pavbhaji_A,Y_test_pavbhaji_A = train_test_split(weekday_input_pavbhaji_A,pavbhaji_out,test_size=0.2,random_state=0)
regressor.fit(X_train_pavbhaji_A, Y_train_pavbhaji_A)
pavbhaji_sum=0
for i in range(0,7):
pavbhaji_predict_sum=regressor.predict([[i]])
pavbhaji_sum=pavbhaji_sum+pavbhaji_predict_sum
pavbhaji_sum=int(pavbhaji_sum)
default_quantity_data_A_pavbhaji=default_quantity_data_A.iloc[6,].values
pavbhaji_A_list=default_quantity_data_A_pavbhaji.tolist()
pavbhaji_A_list=pavbhaji_A_list[1:]
pavbhaji_A_tomato=pavbhaji_A_list[0]*pavbhaji_sum
pavbhaji_A_onion=pavbhaji_A_list[1]*pavbhaji_sum
pavbhaji_A_capsicum=pavbhaji_A_list[2]*pavbhaji_sum
pavbhaji_A_bread=pavbhaji_A_list[3]*pavbhaji_sum
pavbhaji_A_dough=pavbhaji_A_list[4]*pavbhaji_sum
pavbhaji_A_chicken=pavbhaji_A_list[5]*pavbhaji_sum
pavbhaji_A_cheese=pavbhaji_A_list[6]*pavbhaji_sum
pavbhaji_A_corn=pavbhaji_A_list[7]*pavbhaji_sum
pavbhaji_A_rava=pavbhaji_A_list[8]*pavbhaji_sum
pavbhaji_A_sabudana=pavbhaji_A_list[9]*pavbhaji_sum
pavbhaji_A_masala=pavbhaji_A_list[10]*pavbhaji_sum
pavbhaji_A_vegetables=pavbhaji_A_list[11]*pavbhaji_sum
pavbhaji_A_dal=pavbhaji_A_list[12]*pavbhaji_sum
pavbhaji_A_flour=pavbhaji_A_list[13]*pavbhaji_sum
pavbhaji_A_rice=pavbhaji_A_list[14]*pavbhaji_sum
pavbhaji_A_papad=pavbhaji_A_list[15]*pavbhaji_sum
pavbhaji_A_butter=pavbhaji_A_list[16]*pavbhaji_sum
#Misal analysis for restaurant A
group_data_misal_A=misal_data.groupby("Restaurant")
misal_for_rest_A=group_data_misal_A.get_group('A')
weekday_input_misal_A=misal_for_rest_A[['Weekday']]
weekday_input_misal_A=weekday_input_misal_A.apply(labelencoder_X.fit_transform)
misal_out=misal_for_rest_A[['Misal']]
X_train_misal_A,X_test_misal_A,Y_train_misal_A,Y_test_misal_A = train_test_split(weekday_input_misal_A,misal_out,test_size=0.2,random_state=0)
regressor.fit(X_train_misal_A, Y_train_misal_A)
misal_sum=0
for i in range(0,7):
misal_predict_sum=regressor.predict([[i]])
misal_sum=misal_sum+misal_predict_sum
misal_sum=int(misal_sum)
default_quantity_data_A_misal=default_quantity_data_A.iloc[7,].values
misal_A_list=default_quantity_data_A_misal.tolist()
misal_A_list=misal_A_list[1:]
misal_A_tomato=misal_A_list[0]*misal_sum
misal_A_onion=misal_A_list[1]*misal_sum
misal_A_capsicum=misal_A_list[2]*misal_sum
misal_A_bread=misal_A_list[3]*misal_sum
misal_A_dough=misal_A_list[4]*misal_sum
misal_A_chicken=misal_A_list[5]*misal_sum
misal_A_cheese=misal_A_list[6]*misal_sum
misal_A_corn=misal_A_list[7]*misal_sum
misal_A_rava=misal_A_list[8]*misal_sum
misal_A_sabudana=misal_A_list[9]*misal_sum
misal_A_masala=misal_A_list[10]*misal_sum
misal_A_vegetables=misal_A_list[11]*misal_sum
misal_A_dal=misal_A_list[12]*misal_sum
misal_A_flour=misal_A_list[13]*misal_sum
misal_A_rice=misal_A_list[14]*misal_sum
misal_A_papad=misal_A_list[15]*misal_sum
misal_A_butter=misal_A_list[16]*misal_sum
#idli analysis for restauarant A
group_data_idli_A=idli_data.groupby("Restaurant")
idli_for_rest_A=group_data_idli_A.get_group('A')
weekday_input_idli_A=idli_for_rest_A[['Weekday']]
weekday_input_idli_A=weekday_input_idli_A.apply(labelencoder_X.fit_transform)
idli_out=idli_for_rest_A[['idli']]
X_train_idli_A,X_test_idli_A,Y_train_idli_A,Y_test_idli_A = train_test_split(weekday_input_idli_A,idli_out,test_size=0.2,random_state=0)
regressor.fit(X_train_idli_A, Y_train_idli_A)
idli_sum=0
for i in range(0,7):
idli_predict_sum=regressor.predict([[i]])
idli_sum=idli_sum+idli_predict_sum
idli_sum=int(idli_sum)
default_quantity_data_A_idli=default_quantity_data_A.iloc[8,].values
idli_A_list=default_quantity_data_A_idli.tolist()
idli_A_list=idli_A_list[1:]
idli_A_tomato=idli_A_list[0]*idli_sum
idli_A_onion=idli_A_list[1]*idli_sum
idli_A_capsicum=idli_A_list[2]*idli_sum
idli_A_bread=idli_A_list[3]*idli_sum
idli_A_dough=idli_A_list[4]*idli_sum
idli_A_chicken=idli_A_list[5]*idli_sum
idli_A_cheese=idli_A_list[6]*idli_sum
idli_A_corn=idli_A_list[7]*idli_sum
idli_A_rava=idli_A_list[8]*idli_sum
idli_A_sabudana=idli_A_list[9]*idli_sum
idli_A_masala=idli_A_list[10]*idli_sum
idli_A_vegetables=idli_A_list[11]*idli_sum
idli_A_dal=idli_A_list[12]*idli_sum
idli_A_flour=idli_A_list[13]*idli_sum
idli_A_rice=idli_A_list[14]*idli_sum
idli_A_papad=idli_A_list[15]*idli_sum
idli_A_butter=idli_A_list[16]*idli_sum
#kichdi analysis for restaurant A
group_data_kichdi_A=kichdi_data.groupby("Restaurant")
kichdi_for_rest_A=group_data_kichdi_A.get_group('A')
weekday_input_kichdi_A=kichdi_for_rest_A[['Weekday']]
weekday_input_kichdi_A=weekday_input_kichdi_A.apply(labelencoder_X.fit_transform)
kichdi_out=kichdi_for_rest_A[['kichdi']]
X_train_kichdi_A,X_test_kichdi_A,Y_train_kichdi_A,Y_test_kichdi_A = train_test_split(weekday_input_kichdi_A,kichdi_out,test_size=0.2,random_state=0)
regressor.fit(X_train_kichdi_A, Y_train_kichdi_A)
kichdi_sum=0
for i in range(0,7):
kichdi_predict_sum=regressor.predict([[i]])
kichdi_sum=kichdi_sum+kichdi_predict_sum
kichdi_sum=int(kichdi_sum)
default_quantity_data_A_kichdi=default_quantity_data_A.iloc[9,].values
kichdi_A_list=default_quantity_data_A_kichdi.tolist()
kichdi_A_list=kichdi_A_list[1:]
kichdi_A_tomato=kichdi_A_list[0]*kichdi_sum
kichdi_A_onion=kichdi_A_list[1]*kichdi_sum
kichdi_A_capsicum=kichdi_A_list[2]*kichdi_sum
kichdi_A_bread=kichdi_A_list[3]*kichdi_sum
kichdi_A_dough=kichdi_A_list[4]*kichdi_sum
kichdi_A_chicken=kichdi_A_list[5]*kichdi_sum
kichdi_A_cheese=kichdi_A_list[6]*kichdi_sum
kichdi_A_corn=kichdi_A_list[7]*kichdi_sum
kichdi_A_rava=kichdi_A_list[8]*kichdi_sum
kichdi_A_sabudana=kichdi_A_list[9]*kichdi_sum
kichdi_A_masala=kichdi_A_list[10]*kichdi_sum
kichdi_A_vegetables=kichdi_A_list[11]*kichdi_sum
kichdi_A_dal=kichdi_A_list[12]*kichdi_sum
kichdi_A_flour=kichdi_A_list[13]*kichdi_sum
kichdi_A_rice=kichdi_A_list[14]*kichdi_sum
kichdi_A_papad=kichdi_A_list[15]*kichdi_sum
kichdi_A_butter=kichdi_A_list[16]*kichdi_sum
total_tom_A=[]
total_tom_A.append(pizza_A_tomato)
total_tom_A.append(burger_A_tomato)
total_tom_A.append(nonveg_A_tomato)
total_tom_A.append(veg_A_tomato)
total_tom_A.append(dosa_A_tomato)
total_tom_A.append(sandwich_A_tomato)
total_tom_A.append(pavbhaji_A_tomato)
total_tom_A.append(misal_A_tomato)
total_tom_A.append(idli_A_tomato)
total_tom_A.append(kichdi_A_tomato)
total_tom_A=sum(total_tom_A)
total_onion_A=[]
total_onion_A.append(pizza_A_onion)
total_onion_A.append(burger_A_onion)
total_onion_A.append(nonveg_A_onion)
total_onion_A.append(veg_A_onion)
total_onion_A.append(dosa_A_onion)
total_onion_A.append(sandwich_A_onion)
total_onion_A.append(pavbhaji_A_onion)
total_onion_A.append(misal_A_onion)
total_onion_A.append(idli_A_onion)
total_onion_A.append(kichdi_A_onion)
total_onion_A=sum(total_onion_A)
total_capsicum_A=[]
total_capsicum_A.append(pizza_A_capsicum)
total_capsicum_A.append(burger_A_capsicum)
total_capsicum_A.append(nonveg_A_capsicum)
total_capsicum_A.append(veg_A_capsicum)
total_capsicum_A.append(dosa_A_capsicum)
total_capsicum_A.append(sandwich_A_capsicum)
total_capsicum_A.append(pavbhaji_A_capsicum)
total_capsicum_A.append(misal_A_capsicum)
total_capsicum_A.append(idli_A_capsicum)
total_capsicum_A.append(kichdi_A_capsicum)
total_capsicum_A=sum(total_capsicum_A)
total_bread_A=[]
total_bread_A.append(pizza_A_bread)
total_bread_A.append(burger_A_bread)
total_bread_A.append(nonveg_A_bread)
total_bread_A.append(veg_A_bread)
total_bread_A.append(dosa_A_bread)
total_bread_A.append(sandwich_A_bread)
total_bread_A.append(pavbhaji_A_bread)
total_bread_A.append(misal_A_bread)
total_bread_A.append(idli_A_bread)
total_bread_A.append(kichdi_A_bread)
total_bread_A=sum(total_bread_A)
total_dough_A=[]
total_dough_A.append(pizza_A_dough)
total_dough_A.append(burger_A_dough)
total_dough_A.append(nonveg_A_dough)
total_dough_A.append(veg_A_dough)
total_dough_A.append(dosa_A_dough)
total_dough_A.append(sandwich_A_dough)
total_dough_A.append(pavbhaji_A_dough)
total_dough_A.append(misal_A_dough)
total_dough_A.append(idli_A_dough)
total_dough_A.append(kichdi_A_dough)
total_dough_A=sum(total_dough_A)
total_chicken_A=[]
total_chicken_A.append(pizza_A_chicken)
total_chicken_A.append(burger_A_chicken)
total_chicken_A.append(nonveg_A_chicken)
total_chicken_A.append(veg_A_chicken)
total_chicken_A.append(dosa_A_chicken)
total_chicken_A.append(sandwich_A_chicken)
total_chicken_A.append(pavbhaji_A_chicken)
total_chicken_A.append(misal_A_chicken)
total_chicken_A.append(idli_A_chicken)
total_chicken_A.append(kichdi_A_chicken)
total_chicken_A=sum(total_chicken_A)
total_cheese_A=[]
total_cheese_A.append(pizza_A_cheese)
total_cheese_A.append(burger_A_cheese)
total_cheese_A.append(nonveg_A_cheese)
total_cheese_A.append(veg_A_cheese)
total_cheese_A.append(dosa_A_cheese)
total_cheese_A.append(sandwich_A_cheese)
total_cheese_A.append(pavbhaji_A_cheese)
total_cheese_A.append(misal_A_cheese)
total_cheese_A.append(idli_A_cheese)
total_cheese_A.append(kichdi_A_cheese)
total_cheese_A=sum(total_cheese_A)
total_corn_A=[]
total_corn_A.append(pizza_A_corn)
total_corn_A.append(burger_A_corn)
total_corn_A.append(nonveg_A_corn)
total_corn_A.append(veg_A_corn)
total_corn_A.append(dosa_A_corn)
total_corn_A.append(sandwich_A_corn)
total_corn_A.append(pavbhaji_A_corn)
total_corn_A.append(misal_A_corn)
total_corn_A.append(idli_A_corn)
total_corn_A.append(kichdi_A_corn)
total_corn_A=sum(total_corn_A)
total_rava_A=[]
total_rava_A.append(pizza_A_rava)
total_rava_A.append(burger_A_rava)
total_rava_A.append(nonveg_A_rava)
total_rava_A.append(veg_A_rava)
total_rava_A.append(dosa_A_rava)
total_rava_A.append(sandwich_A_rava)
total_rava_A.append(pavbhaji_A_rava)
total_rava_A.append(misal_A_rava)
total_rava_A.append(idli_A_rava)
total_rava_A.append(kichdi_A_rava)
total_rava_A=sum(total_rava_A)
total_sabu_A=[]
total_sabu_A.append(pizza_A_sabudana)
total_sabu_A.append(burger_A_sabudana)
total_sabu_A.append(nonveg_A_sabudana)
total_sabu_A.append(veg_A_sabudana)
total_sabu_A.append(dosa_A_sabudana)
total_sabu_A.append(sandwich_A_sabudana)
total_sabu_A.append(pavbhaji_A_sabudana)
total_sabu_A.append(misal_A_sabudana)
total_sabu_A.append(idli_A_sabudana)
total_sabu_A.append(kichdi_A_sabudana)
total_sabu_A=sum(total_sabu_A)
total_masala_A=[]
total_masala_A.append(pizza_A_masala)
total_masala_A.append(burger_A_masala)
total_masala_A.append(nonveg_A_masala)
total_masala_A.append(veg_A_masala)
total_masala_A.append(dosa_A_masala)
total_masala_A.append(sandwich_A_masala)
total_masala_A.append(pavbhaji_A_masala)
total_masala_A.append(misal_A_masala)
total_masala_A.append(idli_A_masala)
total_masala_A.append(kichdi_A_masala)
total_masala_A=sum(total_masala_A)
total_veggies_A=[]
total_veggies_A.append(pizza_A_vegetables)
total_veggies_A.append(burger_A_vegetables)
total_veggies_A.append(nonveg_A_vegetables)
total_veggies_A.append(veg_A_vegetables)
total_veggies_A.append(dosa_A_vegetables)
total_veggies_A.append(sandwich_A_vegetables)
total_veggies_A.append(pavbhaji_A_vegetables)
total_veggies_A.append(misal_A_vegetables)
total_veggies_A.append(idli_A_vegetables)
total_veggies_A.append(kichdi_A_vegetables)
total_veggies_A=sum(total_veggies_A)
total_dal_A=[]
total_dal_A.append(pizza_A_dal)
total_dal_A.append(burger_A_dal)
total_dal_A.append(nonveg_A_dal)
total_dal_A.append(veg_A_dal)
total_dal_A.append(dosa_A_dal)
total_dal_A.append(sandwich_A_dal)
total_dal_A.append(pavbhaji_A_dal)
total_dal_A.append(misal_A_dal)
total_dal_A.append(idli_A_dal)
total_dal_A.append(kichdi_A_dal)
total_dal_A=sum(total_dal_A)
total_flour_A=[]
total_flour_A.append(pizza_A_flour)
total_flour_A.append(burger_A_flour)
total_flour_A.append(nonveg_A_flour)
total_flour_A.append(veg_A_flour)
total_flour_A.append(dosa_A_flour)
total_flour_A.append(sandwich_A_flour)
total_flour_A.append(pavbhaji_A_flour)
total_flour_A.append(misal_A_flour)
total_flour_A.append(idli_A_flour)
total_flour_A.append(kichdi_A_flour)
total_flour_A=sum(total_flour_A)
total_rice_A=[]
total_rice_A.append(pizza_A_rice)
total_rice_A.append(burger_A_rice)
total_rice_A.append(nonveg_A_rice)
total_rice_A.append(veg_A_rice)
total_rice_A.append(dosa_A_rice)
total_rice_A.append(sandwich_A_rice)
total_rice_A.append(pavbhaji_A_rice)
total_rice_A.append(misal_A_rice)
total_rice_A.append(idli_A_rice)
total_rice_A.append(kichdi_A_rice)
total_rice_A=sum(total_rice_A)
total_papad_A=[]
total_papad_A.append(pizza_A_papad)
total_papad_A.append(burger_A_papad)
total_papad_A.append(nonveg_A_papad)
total_papad_A.append(veg_A_papad)
total_papad_A.append(dosa_A_papad)
total_papad_A.append(sandwich_A_papad)
total_papad_A.append(pavbhaji_A_papad)
total_papad_A.append(misal_A_papad)
total_papad_A.append(idli_A_papad)
total_papad_A.append(kichdi_A_papad)
total_papad_A=sum(total_papad_A)
total_butter_A=[]
total_butter_A.append(pizza_A_butter)
total_butter_A.append(burger_A_butter)
total_butter_A.append(nonveg_A_butter)
total_butter_A.append(veg_A_butter)
total_butter_A.append(dosa_A_butter)
total_butter_A.append(sandwich_A_butter)
total_butter_A.append(pavbhaji_A_butter)
total_butter_A.append(misal_A_butter)
total_butter_A.append(idli_A_butter)
total_butter_A.append(kichdi_A_butter)
total_butter_A=sum(total_butter_A)
#Analysis for restaurant B
#pizza analysis for group B
group_data_pizza_B=pizza_data.groupby("Restaurant")
pizza_for_rest_B=group_data_pizza_B.get_group('B')
weekday_input_pizza_B=pizza_for_rest_B[['Weekday']]
weekday_input_pizza_B=weekday_input_pizza_B.apply(labelencoder_X.fit_transform)
pizza_out_B=pizza_for_rest_B[['Pizza']]
X_train_pizza_B,X_test_pizza_B,Y_train_pizza_B,Y_test_pizza_B = train_test_split(weekday_input_pizza_B,pizza_out_B,test_size=0.2,random_state=0)
regressor.fit(X_train_pizza_B, Y_train_pizza_B)
pizza_sum_B=0
for i in range(0,7):
pizza_pred_B=regressor.predict([[i]])
pizza_sum_B=pizza_sum_B+pizza_pred_B
pizza_sum_B=int(pizza_sum_B)
default_quantity_data_B_pizza=default_quantity_data_B.iloc[0,].values
pizza_B_list=default_quantity_data_B_pizza.tolist()
pizza_B_list=pizza_B_list[1:]
pizza_B_tomato=pizza_B_list[0]*pizza_sum_B
pizza_B_onion=pizza_B_list[1]*pizza_sum_B
pizza_B_capsicum=pizza_B_list[2]*pizza_sum_B
pizza_B_bread=pizza_B_list[3]*pizza_sum_B
pizza_B_dough=pizza_B_list[4]*pizza_sum_B
pizza_B_chicken=pizza_B_list[5]*pizza_sum_B
pizza_B_cheese=pizza_B_list[6]*pizza_sum_B
pizza_B_corn=pizza_B_list[7]*pizza_sum_B
pizza_B_rava=pizza_B_list[8]*pizza_sum_B
pizza_B_sabudana=pizza_B_list[9]*pizza_sum_B
pizza_B_masala=pizza_B_list[10]*pizza_sum_B
pizza_B_vegetables=pizza_B_list[11]*pizza_sum_B
pizza_B_dal=pizza_B_list[12]*pizza_sum_B
pizza_B_flour=pizza_B_list[13]*pizza_sum_B
pizza_B_rice=pizza_B_list[14]*pizza_sum_B
pizza_B_papad=pizza_B_list[15]*pizza_sum_B
pizza_B_butter=pizza_B_list[16]*pizza_sum_B
#Burger Analysis for restaurant B
group_data_burger_B=burger_data.groupby("Restaurant")
burger_for_rest_B=group_data_burger_B.get_group('B')
weekday_input_burger_B=burger_for_rest_B[['Weekday']]
weekday_input_burger_B=weekday_input_burger_B.apply(labelencoder_X.fit_transform)
burger_out_B=burger_for_rest_B[['Burger']]
X_train_burger_B,X_test_burger_B,Y_train_burger_B,Y_test_burger_B = train_test_split(weekday_input_burger_B,burger_out_B,test_size=0.2,random_state=0)
regressor.fit(X_train_burger_B, Y_train_burger_B)
burger_sum_B=0
for i in range(0,7):
burger_predict_sum=regressor.predict([[i]])
burger_sum_B=burger_sum_B+burger_predict_sum
burger_sum_B=int(burger_sum_B)
default_quantity_data_B_burger=default_quantity_data_B.iloc[1,].values
burger_B_list=default_quantity_data_B_burger.tolist()
burger_B_list=burger_B_list[1:]
burger_B_tomato=burger_B_list[0]*burger_sum_B
burger_B_onion=burger_B_list[1]*burger_sum_B
burger_B_capsicum=burger_B_list[2]*burger_sum_B
burger_B_bread=burger_B_list[3]*burger_sum_B
burger_B_dough=burger_B_list[4]*burger_sum_B
burger_B_chicken=burger_B_list[5]*burger_sum_B
burger_B_cheese=burger_B_list[6]*burger_sum_B
burger_B_corn=burger_B_list[7]*burger_sum_B
burger_B_rava=burger_B_list[8]*burger_sum_B
burger_B_sabudana=burger_B_list[9]*burger_sum_B
burger_B_masala=burger_B_list[10]*burger_sum_B
burger_B_vegetables=burger_B_list[11]*burger_sum_B
burger_B_dal=burger_B_list[12]*burger_sum_B
burger_B_flour=burger_B_list[13]*burger_sum_B
burger_B_rice=burger_B_list[14]*burger_sum_B
burger_B_papad=burger_B_list[15]*burger_sum_B
burger_B_butter=burger_B_list[16]*burger_sum_B
#Non veg analysis for restaurant B
group_data_nonveg_B=non_veg_thali_data.groupby("Restaurant")
nonveg_for_rest_B=group_data_nonveg_B.get_group('B')
weekday_input_nonveg_B=nonveg_for_rest_B[['Weekday']]
weekday_input_nonveg_B=weekday_input_nonveg_B.apply(labelencoder_X.fit_transform)
nonveg_out_B=nonveg_for_rest_B[['Non Veg Thali']]
X_train_nonveg_B,X_test_nonveg_B,Y_train_nonveg_B,Y_test_nonveg_B = train_test_split(weekday_input_nonveg_B,nonveg_out_B,test_size=0.2,random_state=0)
regressor.fit(X_train_nonveg_B, Y_train_nonveg_B)
nonveg_sum_B=0
for i in range(0,7):
nonveg_predict_sum=regressor.predict([[i]])
nonveg_sum_B=nonveg_sum_B+nonveg_predict_sum
nonveg_sum_B=int(nonveg_sum_B)
default_quantity_data_B_nonveg=default_quantity_data_B.iloc[2,].values
nonveg_B_list=default_quantity_data_B_nonveg.tolist()
nonveg_B_list=nonveg_B_list[1:]
nonveg_B_tomato=nonveg_B_list[0]*nonveg_sum_B
nonveg_B_onion=nonveg_B_list[1]*nonveg_sum_B
nonveg_B_capsicum=nonveg_B_list[2]*nonveg_sum_B
nonveg_B_bread=nonveg_B_list[3]*nonveg_sum_B
nonveg_B_dough=nonveg_B_list[4]*nonveg_sum_B
nonveg_B_chicken=nonveg_B_list[5]*nonveg_sum_B
nonveg_B_cheese=nonveg_B_list[6]*nonveg_sum_B
nonveg_B_corn=nonveg_B_list[7]*nonveg_sum_B
nonveg_B_rava=nonveg_B_list[8]*nonveg_sum_B
nonveg_B_sabudana=nonveg_B_list[9]*nonveg_sum_B
nonveg_B_masala=nonveg_B_list[10]*nonveg_sum_B
nonveg_B_vegetables=nonveg_B_list[11]*nonveg_sum_B
nonveg_B_dal=nonveg_B_list[12]*nonveg_sum_B
nonveg_B_flour=nonveg_B_list[13]*nonveg_sum_B
nonveg_B_rice=nonveg_B_list[14]*nonveg_sum_B
nonveg_B_papad=nonveg_B_list[15]*nonveg_sum_B
nonveg_B_butter=nonveg_B_list[16]*nonveg_sum_B
#Veg analysis for restaurant B
group_data_veg_B=veg_thali_data.groupby("Restaurant")
veg_for_rest_B=group_data_veg_B.get_group('B')
weekday_input_veg_B=veg_for_rest_B[['Weekday']]
weekday_input_veg_B=weekday_input_veg_B.apply(labelencoder_X.fit_transform)
veg_out_B=veg_for_rest_B[['Veg Thali']]
X_train_veg_B,X_test_veg_B,Y_train_veg_B,Y_test_veg_B = train_test_split(weekday_input_veg_B,veg_out_B,test_size=0.2,random_state=0)
regressor.fit(X_train_veg_B, Y_train_veg_B)
veg_sum_B=0
for i in range(0,7):
veg_predict_sum=regressor.predict([[i]])
veg_sum_B=veg_sum_B+veg_predict_sum
veg_sum_B=int(veg_sum_B)-1
default_quantity_data_B_veg=default_quantity_data_B.iloc[3,].values
veg_B_list=default_quantity_data_B_veg.tolist()
veg_B_list=veg_B_list[1:]
veg_B_tomato=veg_B_list[0]*veg_sum_B
veg_B_onion=veg_B_list[1]*veg_sum_B
veg_B_capsicum=veg_B_list[2]*veg_sum_B
veg_B_bread=veg_B_list[3]*veg_sum_B
veg_B_dough=veg_B_list[4]*veg_sum_B
veg_B_chicken=veg_B_list[5]*veg_sum_B
veg_B_cheese=veg_B_list[6]*veg_sum_B
veg_B_corn=veg_B_list[7]*veg_sum_B
veg_B_rava=veg_B_list[8]*veg_sum_B
veg_B_sabudana=veg_B_list[9]*veg_sum_B
veg_B_masala=veg_B_list[10]*veg_sum_B
veg_B_vegetables=veg_B_list[11]*veg_sum_B
veg_B_dal=veg_B_list[12]*veg_sum_B
veg_B_flour=veg_B_list[13]*veg_sum_B
veg_B_rice=veg_B_list[14]*veg_sum_B
veg_B_papad=veg_B_list[15]*veg_sum_B
veg_B_butter=veg_B_list[16]*veg_sum_B
#DOSA analysis for restaurant B
group_data_dosa_B=dosa_data.groupby("Restaurant")
dosa_for_rest_B=group_data_dosa_B.get_group('B')
weekday_input_dosa_B=dosa_for_rest_B[['Weekday']]
weekday_input_dosa_B=weekday_input_dosa_B.apply(labelencoder_X.fit_transform)
dosa_out_B=dosa_for_rest_B[['Dosa']]
X_train_dosa_B,X_test_dosa_B,Y_train_dosa_B,Y_test_dosa_B = train_test_split(weekday_input_dosa_B,dosa_out_B,test_size=0.2,random_state=0)
regressor.fit(X_train_dosa_B, Y_train_dosa_B)
dosa_sum_B=0
for i in range(0,7):
dosa_predict_sum=regressor.predict([[i]])
dosa_sum_B=dosa_sum_B+dosa_predict_sum
dosa_sum_B=int(dosa_sum_B)
default_quantity_data_B_dosa=default_quantity_data_B.iloc[4,].values
dosa_B_list=default_quantity_data_B_dosa.tolist()
dosa_B_list=dosa_B_list[1:]
dosa_B_tomato=dosa_B_list[0]*dosa_sum_B
dosa_B_onion=dosa_B_list[1]*dosa_sum_B
dosa_B_capsicum=dosa_B_list[2]*dosa_sum_B
dosa_B_bread=dosa_B_list[3]*dosa_sum_B
dosa_B_dough=dosa_B_list[4]*dosa_sum_B
dosa_B_chicken=dosa_B_list[5]*dosa_sum_B
dosa_B_cheese=dosa_B_list[6]*dosa_sum_B
dosa_B_corn=dosa_B_list[7]*dosa_sum_B
dosa_B_rava=dosa_B_list[8]*dosa_sum_B
dosa_B_sabudana=dosa_B_list[9]*dosa_sum_B
dosa_B_masala=dosa_B_list[10]*dosa_sum_B
dosa_B_vegetables=dosa_B_list[11]*dosa_sum_B
dosa_B_dal=dosa_B_list[12]*dosa_sum_B
dosa_B_flour=dosa_B_list[13]*dosa_sum_B
dosa_B_rice=dosa_B_list[14]*dosa_sum_B
dosa_B_papad=dosa_B_list[15]*dosa_sum_B
dosa_B_butter=dosa_B_list[16]*dosa_sum_B
#Sandwich ananlysis for restaurant B
group_data_sandwich_B=sandwich_data.groupby("Restaurant")
sandwich_for_rest_B=group_data_sandwich_B.get_group('B')
weekday_input_sandwich_B=sandwich_for_rest_B[['Weekday']]
weekday_input_sandwich_B=weekday_input_sandwich_B.apply(labelencoder_X.fit_transform)
sandwich_out_B=sandwich_for_rest_B[['Sandwich']]
X_train_sandwich_B,X_test_sandwich_B,Y_train_sandwich_B,Y_test_sandwich_B = train_test_split(weekday_input_sandwich_B,sandwich_out_B,test_size=0.2,random_state=0)
regressor.fit(X_train_sandwich_B, Y_train_sandwich_B)
sandwich_sum_B=0
for i in range(0,7):
sandwich_predict_sum=regressor.predict([[i]])
sandwich_sum_B=sandwich_sum_B+sandwich_predict_sum
sandwich_sum_B=int(sandwich_sum_B)
default_quantity_data_B_sandwich=default_quantity_data_B.iloc[5,].values
sandwich_B_list=default_quantity_data_B_sandwich.tolist()
sandwich_B_list=sandwich_B_list[1:]
sandwich_B_tomato=sandwich_B_list[0]*sandwich_sum_B
sandwich_B_onion=sandwich_B_list[1]*sandwich_sum_B
sandwich_B_capsicum=sandwich_B_list[2]*sandwich_sum_B
sandwich_B_bread=sandwich_B_list[3]*sandwich_sum_B
sandwich_B_dough=sandwich_B_list[4]*sandwich_sum_B
sandwich_B_chicken=sandwich_B_list[5]*sandwich_sum_B
sandwich_B_cheese=sandwich_B_list[6]*sandwich_sum_B
sandwich_B_corn=sandwich_B_list[7]*sandwich_sum_B
sandwich_B_rava=sandwich_B_list[8]*sandwich_sum_B
sandwich_B_sabudana=sandwich_B_list[9]*sandwich_sum_B
sandwich_B_masala=sandwich_B_list[10]*sandwich_sum_B
sandwich_B_vegetables=sandwich_B_list[11]*sandwich_sum_B
sandwich_B_dal=sandwich_B_list[12]*sandwich_sum_B
sandwich_B_flour=sandwich_B_list[13]*sandwich_sum_B
sandwich_B_rice=sandwich_B_list[14]*sandwich_sum_B
sandwich_B_papad=sandwich_B_list[15]*sandwich_sum_B
sandwich_B_butter=sandwich_B_list[16]*sandwich_sum_B
#PAVBHAJI analysis for restauarnt B
group_data_pavbhaji_B=pav_bhaji_data.groupby("Restaurant")
pavbhaji_for_rest_B=group_data_pavbhaji_B.get_group('B')
weekday_input_pavbhaji_B=pavbhaji_for_rest_B[['Weekday']]
weekday_input_pavbhaji_B=weekday_input_pavbhaji_B.apply(labelencoder_X.fit_transform)
pavbhaji_out_B=pavbhaji_for_rest_B[['Pav Bhaji']]
X_train_pavbhaji_B,X_test_pavbhaji_B,Y_train_pavbhaji_B,Y_test_pavbhaji_B = train_test_split(weekday_input_pavbhaji_B,pavbhaji_out_B,test_size=0.2,random_state=0)
regressor.fit(X_train_pavbhaji_B, Y_train_pavbhaji_B)
pavbhaji_sum_B=0
for i in range(0,7):
pavbhaji_predict_sum=regressor.predict([[i]])
pavbhaji_sum_B=pavbhaji_sum_B+pavbhaji_predict_sum
pavbhaji_sum_B=int(pavbhaji_sum_B)
default_quantity_data_B_pavbhaji=default_quantity_data_B.iloc[6,].values
pavbhaji_B_list=default_quantity_data_B_pavbhaji.tolist()
pavbhaji_B_list=pavbhaji_B_list[1:]
pavbhaji_B_tomato=pavbhaji_B_list[0]*pavbhaji_sum_B
pavbhaji_B_onion=pavbhaji_B_list[1]*pavbhaji_sum_B
pavbhaji_B_capsicum=pavbhaji_B_list[2]*pavbhaji_sum_B
pavbhaji_B_bread=pavbhaji_B_list[3]*pavbhaji_sum_B
pavbhaji_B_dough=pavbhaji_B_list[4]*pavbhaji_sum_B
pavbhaji_B_chicken=pavbhaji_B_list[5]*pavbhaji_sum_B
pavbhaji_B_cheese=pavbhaji_B_list[6]*pavbhaji_sum_B
pavbhaji_B_corn=pavbhaji_B_list[7]*pavbhaji_sum_B
pavbhaji_B_rava=pavbhaji_B_list[8]*pavbhaji_sum_B
pavbhaji_B_sabudana=pavbhaji_B_list[9]*pavbhaji_sum_B
pavbhaji_B_masala=pavbhaji_B_list[10]*pavbhaji_sum_B
pavbhaji_B_vegetables=pavbhaji_B_list[11]*pavbhaji_sum_B
pavbhaji_B_dal=pavbhaji_B_list[12]*pavbhaji_sum_B
pavbhaji_B_flour=pavbhaji_B_list[13]*pavbhaji_sum_B
pavbhaji_B_rice=pavbhaji_B_list[14]*pavbhaji_sum_B
pavbhaji_B_papad=pavbhaji_B_list[15]*pavbhaji_sum_B
pavbhaji_B_butter=pavbhaji_B_list[16]*pavbhaji_sum_B
#Misal analysis for restaurant B
group_data_misal_B=misal_data.groupby("Restaurant")
misal_for_rest_B=group_data_misal_B.get_group('B')
weekday_input_misal_B=misal_for_rest_B[['Weekday']]
weekday_input_misal_B=weekday_input_misal_B.apply(labelencoder_X.fit_transform)
misal_out_B=misal_for_rest_B[['Misal']]
X_train_misal_B,X_test_misal_B,Y_train_misal_B,Y_test_misal_B = train_test_split(weekday_input_misal_B,misal_out_B,test_size=0.2,random_state=0)
regressor.fit(X_train_misal_B, Y_train_misal_B)
misal_sum_B=0
for i in range(0,7):
misal_predict_sum=regressor.predict([[i]])
misal_sum_B=misal_sum_B+misal_predict_sum
misal_sum_B=int(misal_sum_B)+1
default_quantity_data_B_misal=default_quantity_data_B.iloc[7,].values
misal_B_list=default_quantity_data_B_misal.tolist()
misal_B_list=misal_B_list[1:]
misal_B_tomato=misal_B_list[0]*misal_sum_B
misal_B_onion=misal_B_list[1]*misal_sum_B
misal_B_capsicum=misal_B_list[2]*misal_sum_B
misal_B_bread=misal_B_list[3]*misal_sum_B
misal_B_dough=misal_B_list[4]*misal_sum_B
misal_B_chicken=misal_B_list[5]*misal_sum_B
misal_B_cheese=misal_B_list[6]*misal_sum_B
misal_B_corn=misal_B_list[7]*misal_sum_B
misal_B_rava=misal_B_list[8]*misal_sum_B
misal_B_sabudana=misal_B_list[9]*misal_sum_B
misal_B_masala=misal_B_list[10]*misal_sum_B
misal_B_vegetables=misal_B_list[11]*misal_sum_B
misal_B_dal=misal_B_list[12]*misal_sum_B
misal_B_flour=misal_B_list[13]*misal_sum_B
misal_B_rice=misal_B_list[14]*misal_sum_B
misal_B_papad=misal_B_list[15]*misal_sum_B
misal_B_butter=misal_B_list[16]*misal_sum_B
#idli analysis for restauarant B
group_data_idli_B=idli_data.groupby("Restaurant")
idli_for_rest_B=group_data_idli_B.get_group('B')
weekday_input_idli_B=idli_for_rest_B[['Weekday']]
weekday_input_idli_B=weekday_input_idli_B.apply(labelencoder_X.fit_transform)
idli_out_B=idli_for_rest_B[['idli']]
X_train_idli_B,X_test_idli_B,Y_train_idli_B,Y_test_idli_B = train_test_split(weekday_input_idli_B,idli_out_B,test_size=0.2,random_state=0)
regressor.fit(X_train_idli_B, Y_train_idli_B)
idli_sum_B=0
for i in range(0,7):
idli_predict_sum=regressor.predict([[i]])
idli_sum_B=idli_sum_B+idli_predict_sum