padmapriya commited on
Commit
a45bc4c
·
1 Parent(s): 914aba7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +644 -369
app.py CHANGED
@@ -2,466 +2,641 @@ import numpy as np
2
  import pandas as pd
3
  import gradio as gr
4
  def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emission):
5
-
6
- #1996
 
7
 
8
- #data collection
9
- data1=pd.read_excel("FINAL_DATASET.xlsx")
10
- df1 = data1.drop(['YEAR'], axis=1)
 
 
11
 
12
- #data indexing
13
- x=df1.iloc[:,1:].values
14
- y=df1.iloc[:,0].values
15
- np.reshape(y,(-1,1))
16
 
17
- #split the dataset
18
- from sklearn.model_selection import train_test_split
19
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
 
20
  x, y, test_size=0.33, random_state=42)
21
 
22
 
23
- #traing the dataset
24
- from sklearn.linear_model import LinearRegression
25
- reg = LinearRegression().fit(X_train, y_train)
26
- y_pred1=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
27
 
28
- #Equation
29
- total1="2.29209688*(x1)+(-17.24834114)*(x2)+(-34.46449984)*(x3)+441.88734541(x4)+(-10.5704468)*(x5)+3032.3276611889232"
30
-
31
- #1997
32
-
33
- #data collection
34
- data2=pd.read_excel("ans1.xlsx")
35
- df2 = data2.drop(['YEAR '], axis=1)
36
-
37
- #data indexing
38
- x=df2.iloc[:,1:].values
39
- y=df2.iloc[:,0].values
40
- np.reshape(y,(-1,1))
41
-
42
- #split the dataset
43
- from sklearn.model_selection import train_test_split
44
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
 
 
 
 
 
 
 
45
  x, y, test_size=0.33, random_state=42)
46
 
47
- #traing the dataset
48
- from sklearn.linear_model import LinearRegression
49
- reg = LinearRegression().fit(X_train, y_train)
50
- y_pred2=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
51
 
52
- #Equation
53
- total2="1.87191609*(x1)+19.64115875*(x2)+91.64048224*(x3)+188.38350818*(x4)+23.55498894*(x5)-10954.252919457198"
 
 
 
 
 
 
 
 
54
 
55
- #1998
56
 
57
- #data collection
58
- data3=pd.read_excel("ans2.xlsx")
59
- df3 = data3.drop([' YEAR '], axis=1)
60
-
61
- #data indexing
62
- x=df3.iloc[:,1:].values
63
- y=df3.iloc[:,0].values
64
- np.reshape(y,(-1,1))
65
-
66
- #split the dataset
67
- from sklearn.model_selection import train_test_split
68
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
 
 
 
 
69
  x, y, test_size=0.33, random_state=42)
70
 
71
- #traing the dataset
72
- from sklearn.linear_model import LinearRegression
73
- reg = LinearRegression().fit(X_train, y_train)
74
- y_pred3=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
75
-
76
- #Equation
77
- total3="-16.16933055*(x1)+222.22199705*(x2)+137.12332335*(x3)+325.31073157*(x4)+(-123.63496668)*(x5)+56972.685015326366"
78
-
79
- #1999
80
-
81
- #data collection
82
-
83
- data4=pd.read_excel("/content/ans3.xlsx")
84
- df4 = data4.drop([' YEAR '], axis=1)
85
-
86
- #data indexing
87
- x=df4.iloc[:,1:].values
88
- y=df4.iloc[:,0].values
89
- np.reshape(y,(-1,1))
90
-
91
- #split the dataset
92
- from sklearn.model_selection import train_test_split
93
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
 
 
 
 
 
 
94
  x, y, test_size=0.33, random_state=42)
95
-
96
- #traing the dataset
97
- from sklearn.linear_model import LinearRegression
98
- reg = LinearRegression().fit(X_train, y_train)
99
- y_pred4=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
100
-
101
-
102
- #Equation
103
- total4="24.45036879*(x1)+(-30.15985323)*(x2)+40.89603753*(x3)+102.95011027*(x4)+(-26.35323684)*(x5)+7934.309705068432"
104
-
105
- #2000
106
-
107
- #data collection
108
-
109
- data5=pd.read_excel("/content/ans4.xlsx")
110
- df5 = data5.drop([' YEAR '], axis=1)
111
-
112
- #data indexing
113
-
114
- x=df5.iloc[:,1:].values
115
- y=df5.iloc[:,0].values
116
- np.reshape(y,(-1,1))
117
-
118
- #split the dataset
119
- from sklearn.model_selection import train_test_split
120
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
 
 
 
 
121
  x, y, test_size=0.33, random_state=42)
122
-
123
- #traing the dataset
124
- from sklearn.linear_model import LinearRegression
125
- reg = LinearRegression().fit(X_train, y_train)
126
- y_pred5=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
127
-
128
- #Equation
129
- total5="9.64446417*(x1)+1536.50170104*(x2)+(-43.51829088)*(x3)+(-209.86341104)*(x4)+(-56.82344007)*(x5)+21672.006533155447"
130
-
 
 
 
 
 
 
 
 
 
 
131
  #2001
132
-
133
- #data collection
134
-
135
- data6=pd.read_excel("/content/ans5.xlsx")
136
- df6 = data6.drop([' YEAR '], axis=1)
137
-
138
- #data indexing
139
-
140
- x=df6.iloc[:,1:].values
141
- y=df6.iloc[:,0].values
142
- np.reshape(y,(-1,1))
143
-
144
- #split the dataset
145
- from sklearn.model_selection import train_test_split
146
- X_train, X_test, y_train, y_test = train_test_split(
147
  x, y, test_size=0.33, random_state=42)
148
-
149
- #traing the dataset
150
- from sklearn.linear_model import LinearRegression
151
- reg = LinearRegression().fit(X_train, y_train)
152
- y_pred6=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
153
-
154
- #Equation
155
- total6="(-17.95980305)*(x1)+397.29027184*(x2)+332.85116421*(x3)+176.63505073*(x4)+(-100.69005777)*(x5)+47882.75497380103"
 
 
 
 
 
 
 
 
156
 
157
 
158
  #2002
159
 
160
- #data collection
161
-
162
- data7=pd.read_excel("/content/ans6.xlsx")
163
- df7 = data7.drop([' YEAR '], axis=1)
164
 
165
- #data indexing
166
- x=df7.iloc[:,1:].values
167
- y=df7.iloc[:,0].values
168
- np.reshape(y,(-1,1))
169
 
170
- #split the dataset
171
- from sklearn.model_selection import train_test_split
172
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
 
173
  x, y, test_size=0.33, random_state=42)
174
-
175
- #traing the dataset
176
- from sklearn.linear_model import LinearRegression
177
- reg = LinearRegression().fit(X_train, y_train)
178
- y_pred7=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
179
 
180
 
181
- #Equation
182
- total7="4.08573322*(x1)+531.87792204*(x2)+(-17.3614085 )*(x3)+(-11.17919737)*(x4)+(-53.48796076)*(x5)+22953.88111229325"
 
 
 
 
 
 
 
 
 
 
 
 
183
 
184
 
185
  #2003
186
 
187
- #data collection
188
- data8=pd.read_excel("/content/ans7.xlsx")
189
- df8 = data8.drop([' YEAR '], axis=1)
190
-
191
- #data indexing
192
- x=df8.iloc[:,1:].values
193
- y=df8.iloc[:,0].values
194
- np.reshape(y,(-1,1))
195
-
196
- #split the dataset
197
- from sklearn.model_selection import train_test_split
198
- X_train, X_test, y_train, y_test = train_test_split(
 
 
199
  x, y, test_size=0.33, random_state=42)
200
-
201
- #traing the dataset
202
- from sklearn.linear_model import LinearRegression
203
- reg = LinearRegression().fit(X_train, y_train)
204
- y_pred8=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
205
 
206
 
207
- #Equation
208
- total8="31.82512443*(x1)+(-521.96868383 )*(x2)+(-43.51829088)*(x3)+ 205.27514768 *(x4)+(-97.91577198)*(x5)+37973.451433772294"
 
 
209
 
210
 
 
 
 
 
 
 
 
 
 
 
 
211
  #2004
212
 
213
- #data collection
214
- data9=pd.read_excel("/content/ans8.xlsx")
215
- df9 = data9.drop([' YEAR '], axis=1)
216
 
217
 
218
- #data indexing
219
- x=df9.iloc[:,1:].values
220
- y=df9.iloc[:,0].values
221
- np.reshape(y,(-1,1))
222
-
223
- #split the dataset
224
- from sklearn.model_selection import train_test_split
225
- X_train, X_test, y_train, y_test = train_test_split(
 
226
  x, y, test_size=0.33, random_state=42)
227
 
228
- #traing the dataset
229
- from sklearn.linear_model import LinearRegression
230
- reg = LinearRegression().fit(X_train, y_train)
231
- y_pred9=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
232
 
 
 
233
 
234
- #Equation
235
- total9="9.64446417*(x1)+1536.50170104*(x2)+(-43.51829088)*(x3)+(-209.86341104)*(x4)+(-56.82344007)*(x5)+21672.006533155447"
236
 
237
 
 
 
 
 
 
 
 
 
 
 
 
238
  #2005
239
-
240
- #data collection
241
- data10=pd.read_excel("/content/ans9.xlsx")
242
- df10 = data10.drop([' YEAR '], axis=1)
243
-
244
- #data indexing
245
- x=df10.iloc[:,1:].values
246
- y=df10.iloc[:,0].values
247
- np.reshape(y,(-1,1))
248
-
249
- #split the dataset
250
- from sklearn.model_selection import train_test_split
251
- X_train, X_test, y_train, y_test = train_test_split(
 
 
252
  x, y, test_size=0.33, random_state=42)
253
-
254
-
255
- #traing the dataset
256
- from sklearn.linear_model import LinearRegression
257
- reg = LinearRegression().fit(X_train, y_train)
258
- y_pred10=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
259
 
260
 
261
- #Equation
262
- total10="(-46.41395388)*(x1)+27.19076539*(x2)+(442.44336049)*(x3)+(-205.61881527)*(x4)+120.39426307*(x5)-46289.48823133327"
 
 
 
 
 
 
 
 
 
 
 
 
263
 
264
 
 
265
  #2006
266
 
267
- #data collection
268
- data11=pd.read_excel("/content/ans10.xlsx")
269
- df11 = data11.drop([' YEAR '], axis=1)
270
-
271
- #data indexing
272
- x=df11.iloc[:,1:].values
273
- y=df11.iloc[:,0].values
274
- np.reshape(y,(-1,1))
275
-
276
- #split the dataset
277
- from sklearn.model_selection import train_test_split
278
- X_train, X_test, y_train, y_test = train_test_split(
 
 
279
  x, y, test_size=0.33, random_state=42)
280
-
281
- #traing the dataset
282
- from sklearn.linear_model import LinearRegression
283
- reg = LinearRegression().fit(X_train, y_train)
284
- y_pred11=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
285
 
286
 
287
- #Equation
288
- total11="(-15.45736104)*(x1)+23.92398419*(x2)+334.30252317*(x3)+151.55678804*(x4)+(-66.42769537)*(x5)+29294.014037250927"
289
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  #2007
291
 
292
- #data collection
293
- data12=pd.read_excel("/content/ans11.xlsx")
294
- df12 = data12.drop([' YEAR '], axis=1)
 
295
 
296
- #data indexing
297
- x=df12.iloc[:,1:].values
298
- y=df12.iloc[:,0].values
299
- np.reshape(y,(-1,1))
300
-
301
- #split the dataset
302
- from sklearn.model_selection import train_test_split
303
- X_train, X_test, y_train, y_test = train_test_split(
 
304
  x, y, test_size=0.33, random_state=42)
305
-
306
- #traing the dataset
307
- from sklearn.linear_model import LinearRegression
308
- reg = LinearRegression().fit(X_train, y_train)
309
- y_pred12=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
310
 
311
 
312
- #Equation
313
- total12="33.41323832*(x1)+(-36.18735569)*(x2)+768.11444325*(x3)+(-182.42626044 )*(x4)+(14.70116631)*(x5)-6967.764713347897"
 
 
 
 
 
 
 
 
 
 
 
 
314
 
 
 
315
  #2008
316
 
317
- #data collection
318
- data13=pd.read_excel("/content/ans12.xlsx")
319
- df13 = data13.drop([' YEAR '], axis=1)
 
320
 
321
- #data indexing
322
- x=df13.iloc[:,1:].values
323
- y=df13.iloc[:,0].values
324
- np.reshape(y,(-1,1))
325
 
326
- #split the dataset
327
- from sklearn.model_selection import train_test_split
328
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
329
  x, y, test_size=0.33, random_state=42)
330
-
331
- #traing the dataset
332
- from sklearn.linear_model import LinearRegression
333
- reg = LinearRegression().fit(X_train, y_train)
334
- y_pred13=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
335
 
336
- #Equation
337
- total13="180.34683409 *(x1)+49.48628012*(x2)+152.71729516*(x3)+( -174.89679207)*(x4)+(-144.40854904)*(x5)+30420.505686819404"
 
 
 
338
 
339
 
340
- #2009
 
 
 
 
341
 
342
- #data collection
343
- data14=pd.read_excel("/content/ans13.xlsx")
344
- df14 = data14.drop([' YEAR '], axis=1)
345
 
346
- #data indexing
347
- x=df14.iloc[:,1:].values
348
- y=df14.iloc[:,0].values
349
- np.reshape(y,(-1,1))
350
 
351
- #split the dataset
352
- from sklearn.model_selection import train_test_split
353
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  x, y, test_size=0.33, random_state=42)
355
-
356
- #traing the dataset
357
- from sklearn.linear_model import LinearRegression
358
- reg = LinearRegression().fit(X_train, y_train)
359
- y_pred14=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
360
 
361
 
362
- #Equation
363
- total14="17.11355138 *(x1)+37.59837451*(x2)+156.43469383*(x3)+(-104.8362236)*(x4)+81.10973597*(x5)-38919.678559060834"
 
 
 
 
 
 
 
 
364
 
365
 
 
 
 
 
 
 
366
  #2010
367
-
368
- #data collection
369
- data15=pd.read_excel("/content/ans14.xlsx")
370
- df15 = data15.drop([' YEAR '], axis=1)
371
-
372
- #data indexing
373
- x=df15.iloc[:,1:].values
374
- y=df15.iloc[:,0].values
375
- np.reshape(y,(-1,1))
376
-
377
- #split the dataset
378
- from sklearn.model_selection import train_test_split
379
- X_train, X_test, y_train, y_test = train_test_split(
 
 
380
  x, y, test_size=0.33, random_state=42)
381
-
382
- #traing the dataset
383
- from sklearn.linear_model import LinearRegression
384
- reg = LinearRegression().fit(X_train, y_train)
385
- y_pred15=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
386
 
387
- #Equation
388
- total15="39.06418699 *(x1)+148.53455807*(x2)+14.69213499 *(x3)+107.43795246*(x4)+(-207.77185028)*(x5)+82358.63651384937"
 
 
 
 
 
 
 
 
 
 
 
 
 
389
 
390
 
391
 
392
 
393
  #2011
394
 
395
- #data collection
396
- data16=pd.read_excel("/content/ans15.xlsx")
397
- df16 = data16.drop([' YEAR '], axis=1)
 
398
 
399
- #data indexing
400
- x=df16.iloc[:,1:].values
401
- y=df16.iloc[:,0].values
402
- np.reshape(y,(-1,1))
403
 
404
- #split the dataset
405
- from sklearn.model_selection import train_test_split
406
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
407
  x, y, test_size=0.33, random_state=42)
408
 
409
 
410
- #traing the dataset
411
- from sklearn.linear_model import LinearRegression
412
- reg = LinearRegression().fit(X_train, y_train)
413
- y_pred16=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
414
 
415
- #Equation
416
- total16="36.2551509 *(x1)+-21.16118114*(x2)+372.06856269*(x3)+(-59.04384028)*(x4)+(-49.61395171)*(x5)+18259.681897588325"
 
 
 
 
 
 
 
 
 
417
 
418
 
419
 
420
 
421
  #2012
422
-
423
- #data collection
424
- data17=pd.read_excel("/content/ans16.xlsx")
425
- df17 = data17.drop([' YEAR '], axis=1)
426
-
427
- #data indexing
428
- x=df17.iloc[:,1:].values
429
- y=df17.iloc[:,0].values
430
- np.reshape(y,(-1,1))
431
-
432
- #split the dataset
433
- from sklearn.model_selection import train_test_split
434
- X_train, X_test, y_train, y_test = train_test_split(
 
 
435
  x, y, test_size=0.33, random_state=42)
436
 
437
 
438
- #traing the dataset
439
- from sklearn.linear_model import LinearRegression
440
- reg = LinearRegression().fit(X_train, y_train)
441
- y_pred17=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
 
 
 
 
442
 
443
 
444
- #Equation
445
- total17="76.15862868 *(x1)+24.66304806*(x2)+(-31.1753211)*(x3)+(-281.13550722 )*(x4)+48.76763872*(x5)-27641.15357666507"
 
 
446
 
447
 
448
 
449
  #2013
450
 
451
- #data collection
452
- data18=pd.read_excel("/content/ans17.xlsx")
453
- df18 = data18.drop([' YEAR '], axis=1)
454
 
455
 
456
 
457
- #data indexing
458
- x=df18.iloc[:,1:].values
459
- y=df18.iloc[:,0].values
460
- np.reshape(y,(-1,1))
461
 
462
- #split the dataset
463
- from sklearn.model_selection import train_test_split
464
- X_train, X_test, y_train, y_test = train_test_split(
465
  x, y, test_size=0.33, random_state=42)
466
 
467
 
@@ -487,7 +662,7 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
487
  #2014
488
 
489
  #data collection
490
- data19=pd.read_excel("/content/ans18.xlsx")
491
  df19 = data19.drop([' YEAR '], axis=1)
492
 
493
 
@@ -525,7 +700,7 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
525
  #2015
526
 
527
  #data collection
528
- data20=pd.read_excel("/content/ans19.xlsx")
529
  df20 = data20.drop([' YEAR '], axis=1)
530
 
531
 
@@ -565,7 +740,7 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
565
  #2016
566
 
567
  #data collection
568
- data21=pd.read_excel("/content/ans20.xlsx")
569
  df21 = data21.drop([' YEAR '], axis=1)
570
 
571
 
@@ -603,7 +778,7 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
603
  #2017
604
 
605
  #data collection
606
- data22=pd.read_excel("/content/ans21.xlsx")
607
  df22 = data22.drop([' YEAR '], axis=1)
608
 
609
 
@@ -641,7 +816,7 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
641
  #2018
642
 
643
  #data collection
644
- data23=pd.read_excel("/content/ans22.xlsx")
645
  df23 = data23.drop([' YEAR '], axis=1)
646
 
647
 
@@ -678,7 +853,7 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
678
  #2019
679
 
680
  #data collection
681
- data24=pd.read_excel("/content/ans23.xlsx")
682
  df24 = data24.drop([' YEAR '], axis=1)
683
 
684
 
@@ -716,7 +891,7 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
716
  #2020
717
 
718
  #data collection
719
- data25=pd.read_excel("/content/ans24.xlsx")
720
  df25 = data25.drop([' YEAR '], axis=1)
721
 
722
 
@@ -754,7 +929,7 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
754
  #2021
755
 
756
  #data collection
757
- data26=pd.read_excel("/content/ans25.xlsx")
758
  df26 = data26.drop([' YEAR '], axis=1)
759
 
760
 
@@ -792,7 +967,7 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
792
  #2022
793
 
794
  #data collection
795
- data27=pd.read_excel("/content/ans26.xlsx")
796
  df27 = data27.drop([' YEAR '], axis=1)
797
 
798
 
@@ -820,20 +995,120 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
820
  #Equation
821
  total27="15.98972327*(x1)+5568.67299429*(x2)+79.28661735*(x3)+16.79333316*(x4)+(-87.10169494)*(x5)+40155.32700035415"
822
 
823
-
824
- data=pd.read_excel("bara shigiri - Copy.xlsx")
825
- x=data.iloc[:,1:].values
826
- y=data.iloc[:,0].values
827
- np.reshape(y,(-1,1))
828
- from sklearn.model_selection import train_test_split
829
- from sklearn.linear_model import LinearRegression
830
- X_train, X_test, y_train, y_test = train_test_split(x,y,test_size=0.33,random_state=42)
831
- reg=LinearRegression().fit(X_train,y_train)
832
- eqn="-1.50608097*(x1) +(10.05272793)*(x2) +(-10.52662062)*(x3) +336.60218769*(x4) +(-23.82408478)*(x5) +12129.976853563849"
833
- y_pred=reg.predict([[co2_emission,no2_emission,so2_emission,global_warming,methane_emission]])
834
-
835
- if(year>=2023):
836
- return eqn,y_pred
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
837
 
838
  demo = gr.Interface(
839
  fn=greet,
 
2
  import pandas as pd
3
  import gradio as gr
4
  def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emission):
5
+ import gradio as gr
6
+
7
+ def greet(year,co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission):
8
 
9
+ #1996
10
+
11
+ #data collection
12
+ data1=pd.read_excel("FINAL_DATASET.xlsx")
13
+ df1 = data1.drop(['YEAR'], axis=1)
14
 
 
 
 
 
15
 
16
+
17
+ #data indexing
18
+ x=df1.iloc[:,1:].values
19
+ y=df1.iloc[:,0].values
20
+ np.reshape(y,(-1,1))
21
+
22
+ #split the dataset
23
+ from sklearn.model_selection import train_test_split
24
+ X_train, X_test, y_train, y_test = train_test_split(
25
  x, y, test_size=0.33, random_state=42)
26
 
27
 
28
+ #traing the dataset
29
+ from sklearn.linear_model import LinearRegression
 
 
30
 
31
+ reg = LinearRegression().fit(X_train, y_train)
32
+
33
+
34
+ y_pred1=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
35
+
36
+
37
+
38
+
39
+
40
+ #Equation
41
+ total1="2.29209688*(x1)+(-17.24834114)*(x2)+(-34.46449984)*(x3)+441.88734541(x4)+(-10.5704468)*(x5)+3032.3276611889232"
42
+
43
+
44
+ #1997
45
+
46
+ #data collection
47
+ data2=pd.read_excel("ans1.xlsx")
48
+ df2 = data2.drop(['YEAR '], axis=1)
49
+
50
+
51
+
52
+ #data indexing
53
+ x=df2.iloc[:,1:].values
54
+ y=df2.iloc[:,0].values
55
+ np.reshape(y,(-1,1))
56
+
57
+ #split the dataset
58
+ from sklearn.model_selection import train_test_split
59
+ X_train, X_test, y_train, y_test = train_test_split(
60
  x, y, test_size=0.33, random_state=42)
61
 
 
 
 
 
62
 
63
+ #traing the dataset
64
+ from sklearn.linear_model import LinearRegression
65
+
66
+ reg = LinearRegression().fit(X_train, y_train)
67
+
68
+
69
+ y_pred2=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
70
+
71
+
72
+
73
 
 
74
 
75
+ #Equation
76
+ total2="1.87191609*(x1)+19.64115875*(x2)+91.64048224*(x3)+188.38350818*(x4)+23.55498894*(x5)-10954.252919457198"
77
+
78
+
79
+
80
+ #1998
81
+
82
+ #data collection
83
+ data3=pd.read_excel("ans2.xlsx")
84
+ df3 = data3.drop([' YEAR '], axis=1)
85
+
86
+
87
+
88
+ #data indexing
89
+ x=df3.iloc[:,1:].values
90
+ y=df3.iloc[:,0].values
91
+ np.reshape(y,(-1,1))
92
+
93
+ #split the dataset
94
+ from sklearn.model_selection import train_test_split
95
+ X_train, X_test, y_train, y_test = train_test_split(
96
  x, y, test_size=0.33, random_state=42)
97
 
98
+
99
+ #traing the dataset
100
+ from sklearn.linear_model import LinearRegression
101
+
102
+ reg = LinearRegression().fit(X_train, y_train)
103
+
104
+
105
+ y_pred3=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
106
+
107
+
108
+
109
+
110
+
111
+ #Equation
112
+ total3="-16.16933055*(x1)+222.22199705*(x2)+137.12332335*(x3)+325.31073157*(x4)+(-123.63496668)*(x5)+56972.685015326366"
113
+
114
+
115
+
116
+ #1999
117
+
118
+ #data collection
119
+ data4=pd.read_excel("ans3.xlsx")
120
+ df4 = data4.drop([' YEAR '], axis=1)
121
+
122
+
123
+
124
+ #data indexing
125
+ x=df4.iloc[:,1:].values
126
+ y=df4.iloc[:,0].values
127
+ np.reshape(y,(-1,1))
128
+
129
+ #split the dataset
130
+ from sklearn.model_selection import train_test_split
131
+ X_train, X_test, y_train, y_test = train_test_split(
132
  x, y, test_size=0.33, random_state=42)
133
+
134
+
135
+ #traing the dataset
136
+ from sklearn.linear_model import LinearRegression
137
+
138
+ reg = LinearRegression().fit(X_train, y_train)
139
+
140
+
141
+ y_pred4=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
142
+
143
+
144
+
145
+
146
+
147
+ #Equation
148
+ total4="24.45036879*(x1)+(-30.15985323)*(x2)+40.89603753*(x3)+102.95011027*(x4)+(-26.35323684)*(x5)+7934.309705068432"
149
+
150
+
151
+
152
+ #2000
153
+
154
+ #data collection
155
+ data5=pd.read_excel("ans4.xlsx")
156
+ df5 = data5.drop([' YEAR '], axis=1)
157
+
158
+
159
+
160
+ #data indexing
161
+ x=df5.iloc[:,1:].values
162
+ y=df5.iloc[:,0].values
163
+ np.reshape(y,(-1,1))
164
+
165
+ #split the dataset
166
+ from sklearn.model_selection import train_test_split
167
+ X_train, X_test, y_train, y_test = train_test_split(
168
  x, y, test_size=0.33, random_state=42)
169
+
170
+
171
+ #traing the dataset
172
+ from sklearn.linear_model import LinearRegression
173
+
174
+ reg = LinearRegression().fit(X_train, y_train)
175
+
176
+
177
+ y_pred5=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
178
+
179
+
180
+
181
+
182
+
183
+ #Equation
184
+ total5="9.64446417*(x1)+1536.50170104*(x2)+(-43.51829088)*(x3)+(-209.86341104)*(x4)+(-56.82344007)*(x5)+21672.006533155447"
185
+
186
+
187
+
188
  #2001
189
+
190
+ #data collection
191
+ data6=pd.read_excel("ans5.xlsx")
192
+ df6 = data6.drop([' YEAR '], axis=1)
193
+
194
+
195
+
196
+ #data indexing
197
+ x=df6.iloc[:,1:].values
198
+ y=df6.iloc[:,0].values
199
+ np.reshape(y,(-1,1))
200
+
201
+ #split the dataset
202
+ from sklearn.model_selection import train_test_split
203
+ X_train, X_test, y_train, y_test = train_test_split(
204
  x, y, test_size=0.33, random_state=42)
205
+
206
+
207
+ #traing the dataset
208
+ from sklearn.linear_model import LinearRegression
209
+
210
+ reg = LinearRegression().fit(X_train, y_train)
211
+
212
+
213
+ y_pred6=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
214
+
215
+
216
+
217
+
218
+
219
+ #Equation
220
+ total6="(-17.95980305)*(x1)+397.29027184*(x2)+332.85116421*(x3)+176.63505073*(x4)+(-100.69005777)*(x5)+47882.75497380103"
221
 
222
 
223
  #2002
224
 
225
+ #data collection
226
+ data7=pd.read_excel("ans6.xlsx")
227
+ df7 = data7.drop([' YEAR '], axis=1)
 
228
 
 
 
 
 
229
 
230
+
231
+ #data indexing
232
+ x=df7.iloc[:,1:].values
233
+ y=df7.iloc[:,0].values
234
+ np.reshape(y,(-1,1))
235
+
236
+ #split the dataset
237
+ from sklearn.model_selection import train_test_split
238
+ X_train, X_test, y_train, y_test = train_test_split(
239
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
240
 
241
 
242
+ #traing the dataset
243
+ from sklearn.linear_model import LinearRegression
244
+
245
+ reg = LinearRegression().fit(X_train, y_train)
246
+
247
+
248
+ y_pred7=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
249
+
250
+
251
+
252
+
253
+
254
+ #Equation
255
+ total7="4.08573322*(x1)+531.87792204*(x2)+(-17.3614085 )*(x3)+(-11.17919737)*(x4)+(-53.48796076)*(x5)+22953.88111229325"
256
 
257
 
258
  #2003
259
 
260
+ #data collection
261
+ data8=pd.read_excel("ans7.xlsx")
262
+ df8 = data8.drop([' YEAR '], axis=1)
263
+
264
+
265
+
266
+ #data indexing
267
+ x=df8.iloc[:,1:].values
268
+ y=df8.iloc[:,0].values
269
+ np.reshape(y,(-1,1))
270
+
271
+ #split the dataset
272
+ from sklearn.model_selection import train_test_split
273
+ X_train, X_test, y_train, y_test = train_test_split(
274
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
275
 
276
 
277
+ #traing the dataset
278
+ from sklearn.linear_model import LinearRegression
279
+
280
+ reg = LinearRegression().fit(X_train, y_train)
281
 
282
 
283
+ y_pred8=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
284
+
285
+
286
+
287
+
288
+
289
+ #Equation
290
+ total8="31.82512443*(x1)+(-521.96868383 )*(x2)+(-43.51829088)*(x3)+ 205.27514768 *(x4)+(-97.91577198)*(x5)+37973.451433772294"
291
+
292
+
293
+
294
  #2004
295
 
296
+ #data collection
297
+ data9=pd.read_excel("ans8.xlsx")
298
+ df9 = data9.drop([' YEAR '], axis=1)
299
 
300
 
301
+
302
+ #data indexing
303
+ x=df9.iloc[:,1:].values
304
+ y=df9.iloc[:,0].values
305
+ np.reshape(y,(-1,1))
306
+
307
+ #split the dataset
308
+ from sklearn.model_selection import train_test_split
309
+ X_train, X_test, y_train, y_test = train_test_split(
310
  x, y, test_size=0.33, random_state=42)
311
 
 
 
 
 
312
 
313
+ #traing the dataset
314
+ from sklearn.linear_model import LinearRegression
315
 
316
+ reg = LinearRegression().fit(X_train, y_train)
 
317
 
318
 
319
+ y_pred9=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
320
+
321
+
322
+
323
+
324
+
325
+ #Equation
326
+ total9="9.64446417*(x1)+1536.50170104*(x2)+(-43.51829088)*(x3)+(-209.86341104)*(x4)+(-56.82344007)*(x5)+21672.006533155447"
327
+
328
+
329
+
330
  #2005
331
+
332
+ #data collection
333
+ data10=pd.read_excel("ans9.xlsx")
334
+ df10 = data10.drop([' YEAR '], axis=1)
335
+
336
+
337
+
338
+ #data indexing
339
+ x=df10.iloc[:,1:].values
340
+ y=df10.iloc[:,0].values
341
+ np.reshape(y,(-1,1))
342
+
343
+ #split the dataset
344
+ from sklearn.model_selection import train_test_split
345
+ X_train, X_test, y_train, y_test = train_test_split(
346
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
 
347
 
348
 
349
+ #traing the dataset
350
+ from sklearn.linear_model import LinearRegression
351
+
352
+ reg = LinearRegression().fit(X_train, y_train)
353
+
354
+
355
+ y_pred10=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
356
+
357
+
358
+
359
+
360
+
361
+ #Equation
362
+ total10="(-46.41395388)*(x1)+27.19076539*(x2)+(442.44336049)*(x3)+(-205.61881527)*(x4)+120.39426307*(x5)-46289.48823133327"
363
 
364
 
365
+
366
  #2006
367
 
368
+ #data collection
369
+ data11=pd.read_excel("ans10.xlsx")
370
+ df11 = data11.drop([' YEAR '], axis=1)
371
+
372
+
373
+
374
+ #data indexing
375
+ x=df11.iloc[:,1:].values
376
+ y=df11.iloc[:,0].values
377
+ np.reshape(y,(-1,1))
378
+
379
+ #split the dataset
380
+ from sklearn.model_selection import train_test_split
381
+ X_train, X_test, y_train, y_test = train_test_split(
382
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
383
 
384
 
385
+ #traing the dataset
386
+ from sklearn.linear_model import LinearRegression
387
+
388
+ reg = LinearRegression().fit(X_train, y_train)
389
+
390
+
391
+ y_pred11=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
392
+
393
+
394
+
395
+
396
+
397
+ #Equation
398
+ total11="(-15.45736104)*(x1)+23.92398419*(x2)+334.30252317*(x3)+151.55678804*(x4)+(-66.42769537)*(x5)+29294.014037250927"
399
+
400
+
401
+
402
+
403
  #2007
404
 
405
+ #data collection
406
+ data12=pd.read_excel("ans11.xlsx")
407
+ df12 = data12.drop([' YEAR '], axis=1)
408
+
409
 
410
+
411
+ #data indexing
412
+ x=df12.iloc[:,1:].values
413
+ y=df12.iloc[:,0].values
414
+ np.reshape(y,(-1,1))
415
+
416
+ #split the dataset
417
+ from sklearn.model_selection import train_test_split
418
+ X_train, X_test, y_train, y_test = train_test_split(
419
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
420
 
421
 
422
+ #traing the dataset
423
+ from sklearn.linear_model import LinearRegression
424
+
425
+ reg = LinearRegression().fit(X_train, y_train)
426
+
427
+
428
+ y_pred12=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
429
+
430
+
431
+
432
+
433
+
434
+ #Equation
435
+ total12="33.41323832*(x1)+(-36.18735569)*(x2)+768.11444325*(x3)+(-182.42626044 )*(x4)+(14.70116631)*(x5)-6967.764713347897"
436
 
437
+
438
+
439
  #2008
440
 
441
+ #data collection
442
+ data13=pd.read_excel("ans12.xlsx")
443
+ df13 = data13.drop([' YEAR '], axis=1)
444
+
445
 
 
 
 
 
446
 
447
+ #data indexing
448
+ x=df13.iloc[:,1:].values
449
+ y=df13.iloc[:,0].values
450
+ np.reshape(y,(-1,1))
451
+
452
+ #split the dataset
453
+ from sklearn.model_selection import train_test_split
454
+ X_train, X_test, y_train, y_test = train_test_split(
455
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
456
 
457
+
458
+ #traing the dataset
459
+ from sklearn.linear_model import LinearRegression
460
+
461
+ reg = LinearRegression().fit(X_train, y_train)
462
 
463
 
464
+ y_pred13=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
465
+
466
+
467
+
468
+
469
 
470
+ #Equation
471
+ total13="180.34683409 *(x1)+49.48628012*(x2)+152.71729516*(x3)+( -174.89679207)*(x4)+(-144.40854904)*(x5)+30420.505686819404"
472
+
473
 
 
 
 
 
474
 
475
+
476
+
477
+ #2009
478
+
479
+ #data collection
480
+ data14=pd.read_excel("ans13.xlsx")
481
+ df14 = data14.drop([' YEAR '], axis=1)
482
+
483
+
484
+
485
+ #data indexing
486
+ x=df14.iloc[:,1:].values
487
+ y=df14.iloc[:,0].values
488
+ np.reshape(y,(-1,1))
489
+
490
+ #split the dataset
491
+ from sklearn.model_selection import train_test_split
492
+ X_train, X_test, y_train, y_test = train_test_split(
493
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
494
 
495
 
496
+ #traing the dataset
497
+ from sklearn.linear_model import LinearRegression
498
+
499
+ reg = LinearRegression().fit(X_train, y_train)
500
+
501
+
502
+ y_pred14=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
503
+
504
+
505
+
506
 
507
 
508
+ #Equation
509
+ total14="17.11355138 *(x1)+37.59837451*(x2)+156.43469383*(x3)+(-104.8362236)*(x4)+81.10973597*(x5)-38919.678559060834"
510
+
511
+
512
+
513
+
514
  #2010
515
+
516
+ #data collection
517
+ data15=pd.read_excel("ans14.xlsx")
518
+ df15 = data15.drop([' YEAR '], axis=1)
519
+
520
+
521
+
522
+ #data indexing
523
+ x=df15.iloc[:,1:].values
524
+ y=df15.iloc[:,0].values
525
+ np.reshape(y,(-1,1))
526
+
527
+ #split the dataset
528
+ from sklearn.model_selection import train_test_split
529
+ X_train, X_test, y_train, y_test = train_test_split(
530
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
531
 
532
+
533
+ #traing the dataset
534
+ from sklearn.linear_model import LinearRegression
535
+
536
+ reg = LinearRegression().fit(X_train, y_train)
537
+
538
+
539
+ y_pred15=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
540
+
541
+
542
+
543
+
544
+
545
+ #Equation
546
+ total15="39.06418699 *(x1)+148.53455807*(x2)+14.69213499 *(x3)+107.43795246*(x4)+(-207.77185028)*(x5)+82358.63651384937"
547
 
548
 
549
 
550
 
551
  #2011
552
 
553
+ #data collection
554
+ data16=pd.read_excel("ans15.xlsx")
555
+ df16 = data16.drop([' YEAR '], axis=1)
556
+
557
 
 
 
 
 
558
 
559
+ #data indexing
560
+ x=df16.iloc[:,1:].values
561
+ y=df16.iloc[:,0].values
562
+ np.reshape(y,(-1,1))
563
+
564
+ #split the dataset
565
+ from sklearn.model_selection import train_test_split
566
+ X_train, X_test, y_train, y_test = train_test_split(
567
  x, y, test_size=0.33, random_state=42)
568
 
569
 
570
+ #traing the dataset
571
+ from sklearn.linear_model import LinearRegression
 
 
572
 
573
+ reg = LinearRegression().fit(X_train, y_train)
574
+
575
+
576
+ y_pred16=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
577
+
578
+
579
+
580
+
581
+
582
+ #Equation
583
+ total16="36.2551509 *(x1)+-21.16118114*(x2)+372.06856269*(x3)+(-59.04384028)*(x4)+(-49.61395171)*(x5)+18259.681897588325"
584
 
585
 
586
 
587
 
588
  #2012
589
+
590
+ #data collection
591
+ data17=pd.read_excel("ans16.xlsx")
592
+ df17 = data17.drop([' YEAR '], axis=1)
593
+
594
+
595
+
596
+ #data indexing
597
+ x=df17.iloc[:,1:].values
598
+ y=df17.iloc[:,0].values
599
+ np.reshape(y,(-1,1))
600
+
601
+ #split the dataset
602
+ from sklearn.model_selection import train_test_split
603
+ X_train, X_test, y_train, y_test = train_test_split(
604
  x, y, test_size=0.33, random_state=42)
605
 
606
 
607
+ #traing the dataset
608
+ from sklearn.linear_model import LinearRegression
609
+
610
+ reg = LinearRegression().fit(X_train, y_train)
611
+
612
+
613
+ y_pred17=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
614
+
615
 
616
 
617
+
618
+
619
+ #Equation
620
+ total17="76.15862868 *(x1)+24.66304806*(x2)+(-31.1753211)*(x3)+(-281.13550722 )*(x4)+48.76763872*(x5)-27641.15357666507"
621
 
622
 
623
 
624
  #2013
625
 
626
+ #data collection
627
+ data18=pd.read_excel("ans17.xlsx")
628
+ df18 = data18.drop([' YEAR '], axis=1)
629
 
630
 
631
 
632
+ #data indexing
633
+ x=df18.iloc[:,1:].values
634
+ y=df18.iloc[:,0].values
635
+ np.reshape(y,(-1,1))
636
 
637
+ #split the dataset
638
+ from sklearn.model_selection import train_test_split
639
+ X_train, X_test, y_train, y_test = train_test_split(
640
  x, y, test_size=0.33, random_state=42)
641
 
642
 
 
662
  #2014
663
 
664
  #data collection
665
+ data19=pd.read_excel("ans18.xlsx")
666
  df19 = data19.drop([' YEAR '], axis=1)
667
 
668
 
 
700
  #2015
701
 
702
  #data collection
703
+ data20=pd.read_excel("ans19.xlsx")
704
  df20 = data20.drop([' YEAR '], axis=1)
705
 
706
 
 
740
  #2016
741
 
742
  #data collection
743
+ data21=pd.read_excel("ans20.xlsx")
744
  df21 = data21.drop([' YEAR '], axis=1)
745
 
746
 
 
778
  #2017
779
 
780
  #data collection
781
+ data22=pd.read_excel("ans21.xlsx")
782
  df22 = data22.drop([' YEAR '], axis=1)
783
 
784
 
 
816
  #2018
817
 
818
  #data collection
819
+ data23=pd.read_excel("ans22.xlsx")
820
  df23 = data23.drop([' YEAR '], axis=1)
821
 
822
 
 
853
  #2019
854
 
855
  #data collection
856
+ data24=pd.read_excel("ans23.xlsx")
857
  df24 = data24.drop([' YEAR '], axis=1)
858
 
859
 
 
891
  #2020
892
 
893
  #data collection
894
+ data25=pd.read_excel("ans24.xlsx")
895
  df25 = data25.drop([' YEAR '], axis=1)
896
 
897
 
 
929
  #2021
930
 
931
  #data collection
932
+ data26=pd.read_excel("ans25.xlsx")
933
  df26 = data26.drop([' YEAR '], axis=1)
934
 
935
 
 
967
  #2022
968
 
969
  #data collection
970
+ data27=pd.read_excel("ans26.xlsx")
971
  df27 = data27.drop([' YEAR '], axis=1)
972
 
973
 
 
995
  #Equation
996
  total27="15.98972327*(x1)+5568.67299429*(x2)+79.28661735*(x3)+16.79333316*(x4)+(-87.10169494)*(x5)+40155.32700035415"
997
 
998
+
999
+ #above 2023
1000
+ data28=pd.read_excel("bara shigiri - Copy.xlsx")
1001
+
1002
+ #data indexing
1003
+ x=data28.iloc[:,1:].values
1004
+ y=data28.iloc[:,0].values
1005
+ np.reshape(y,(-1,1))
1006
+
1007
+ #split the dataset
1008
+ from sklearn.model_selection import train_test_split
1009
+ X_train, X_test, y_train, y_test = train_test_split(
1010
+ x, y, test_size=0.33, random_state=42)
1011
+
1012
+ #training the dataset
1013
+ from sklearn.linear_model import LinearRegression
1014
+
1015
+ reg = LinearRegression().fit(X_train, y_train)
1016
+ y_pred28=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
1017
+
1018
+
1019
+
1020
+ #Equation
1021
+ total28="-1.50608097*(x1)+10.05272793*(x2)+(-10.52662062)*(x3)+336.60218769*(x4)+(-23.82408478)*(x5)+12129.976853563849"
1022
+
1023
+
1024
+ #app section
1025
+ if(year==1996):
1026
+ return total1,y_pred1
1027
+
1028
+ elif(year==1997):
1029
+ return total2,y_pred2
1030
+
1031
+ elif(year==1998):
1032
+ return total3,y_pred3
1033
+
1034
+ elif(year==1999):
1035
+ return total4,y_pred4
1036
+
1037
+ elif(year==2000):
1038
+ return total5,y_pred5
1039
+
1040
+ elif(year==2001):
1041
+ return total6,y_pred6
1042
+
1043
+ elif(year==2002):
1044
+ return total7,y_pred7
1045
+
1046
+ elif(year==2003):
1047
+ return total8,y_pred8
1048
+
1049
+ elif(year==2004):
1050
+ return total9,y_pred9
1051
+
1052
+ elif(year==2005):
1053
+ return total10,y_pred10
1054
+
1055
+ elif(year==2006):
1056
+ return total11,y_pred11
1057
+
1058
+ elif(year==2007):
1059
+ return total12,y_pred12
1060
+
1061
+ elif(year==2008):
1062
+ return total13,y_pred13
1063
+
1064
+ elif(year==2009):
1065
+ return total14,y_pred14
1066
+
1067
+ elif(year==2010):
1068
+ return total15,y_pred15
1069
+
1070
+ elif(year==2011):
1071
+ return total16,y_pred16
1072
+
1073
+ elif(year==2012):
1074
+ return total17,y_pred17
1075
+
1076
+ elif(year==2013):
1077
+ return total18,y_pred18
1078
+
1079
+ elif(year==2014):
1080
+ return total19,y_pred19
1081
+
1082
+ elif(year==2015):
1083
+ return total20,y_pred20
1084
+
1085
+ elif(year==2016):
1086
+ return total21,y_pred21
1087
+
1088
+ elif(year==2017):
1089
+ return total22,y_pred22
1090
+
1091
+ elif(year==2018):
1092
+ return total23,y_pred23
1093
+
1094
+ elif(year==2019):
1095
+ return total24,y_pred24
1096
+
1097
+ elif(year==2020):
1098
+ return total25,y_pred25
1099
+
1100
+ elif(year==2021):
1101
+ return total26,y_pred26
1102
+
1103
+ elif(year==2022):
1104
+ return total27,y_pred27
1105
+
1106
+ elif(year>=2023):
1107
+ return total28,y_pred28
1108
+
1109
+ else:
1110
+ return "no",0
1111
+
1112
 
1113
  demo = gr.Interface(
1114
  fn=greet,