Kartheesh commited on
Commit
7b3be54
1 Parent(s): 09dbe6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1080 -29
app.py CHANGED
@@ -1,45 +1,1092 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
- import gradio as gr
3
- import pandas as pd
4
- import numpy as np
5
- def greet(year,co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission):
6
- data1=pd.read_excel("FINAL_DATASET.xlsx")
7
- df1 = data1.drop(['YEAR'], axis=1)
8
- x=df1.iloc[:,1:].values
9
- y=df1.iloc[:,0].values
10
- np.reshape(y,(-1,1))
11
-
12
-
13
- from sklearn.model_selection import train_test_split
14
- X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.33, random_state=42)
15
- from sklearn.linear_model import LinearRegression
16
- reg = LinearRegression().fit(X_train, y_train)
17
- #Equation
18
- total1="2.29209688*(x1)+(-17.24834114)*(x2)+(-34.46449984)*(x3)+441.88734541*(x4)+(-10.5704468)*(x5)+3032.3276611889232"
19
- eq1=2.29209688*(co2_emission)+(-17.24834114)*(No2_emission)+(-34.46449984)*(so2_emission)+441.88734541*(Global_Warming)+(-10.5704468)*(Methane_emission)+3032.3276611889232
20
- if(year==1996):
21
- return total1,eq1
22
 
23
-
 
 
24
 
25
-
26
-
27
-
28
-
29
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
 
 
 
33
 
34
 
35
 
36
 
 
 
37
 
38
-
39
 
40
 
41
 
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
 
45
 
@@ -51,7 +1098,7 @@ demo = gr.Interface(
51
  inputs=["number","number","number","number","number","number"],
52
  outputs=["text","number"],
53
  title="BARA SHIGRI",
54
- css="div {background-image: url('https://drive.google.com/uc?export=view&id=1o4Q6O7LAFTpejs4zwOo6X-BYfrjjyTVr');background-size: 2000px 2000px;}",
55
  description=
56
  "Bara Shigri feeds the Chandra River which after its confluence at Tandi with the Bhaga River is known as Chandrabhaga or Chenab."
57
  "According to Hugh Whistler’s 1924 writing, Shigri is applied par-excellence to one particular glacier that emerges from the mountains on the left bank of the Chenab. It is said to be several miles long, and the snout reaches right down to the river, lying athwart the customary road from Kulu to Spiti... In 1836 this glacier dammed the Chenab River, causing the formation of a large lake, which eventually broke loose and carried devastation down the valley."
@@ -60,4 +1107,8 @@ demo = gr.Interface(
60
 
61
 
62
  )
63
- demo.launch(inline=False)
 
 
 
 
 
1
+ import gradio as gr
2
+ import numpy as np
3
+ import pandas as pd
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
+
13
+
14
+ #data indexing
15
+ x=df1.iloc[:,1:].values
16
+ y=df1.iloc[:,0].values
17
+ np.reshape(y,(-1,1))
18
+
19
+ #split the dataset
20
+ from sklearn.model_selection import train_test_split
21
+ X_train, X_test, y_train, y_test = train_test_split(
22
+ x, y, test_size=0.33, random_state=42)
23
+
24
+
25
+ #traing the dataset
26
+ from sklearn.linear_model import LinearRegression
27
+
28
+ reg = LinearRegression().fit(X_train, y_train)
29
+
30
+
31
+ y_pred1=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
32
+
33
+
34
+
35
+
36
+
37
+ #Equation
38
+ total1="2.29209688*(x1)+(-17.24834114)*(x2)+(-34.46449984)*(x3)+441.88734541*(x4)+(-10.5704468)*(x5)+3032.3276611889232"
39
+
40
+
41
+ #1997
42
+
43
+ #data collection
44
+ data2=pd.read_excel("ans1 (1).xlsx")
45
+ df2 = data2.drop(['YEAR '], axis=1)
46
+
47
+
48
+
49
+ #data indexing
50
+ x=df2.iloc[:,1:].values
51
+ y=df2.iloc[:,0].values
52
+ np.reshape(y,(-1,1))
53
+
54
+ #split the dataset
55
+ from sklearn.model_selection import train_test_split
56
+ X_train, X_test, y_train, y_test = train_test_split(
57
+ x, y, test_size=0.33, random_state=42)
58
+
59
+
60
+ #traing the dataset
61
+ from sklearn.linear_model import LinearRegression
62
+
63
+ reg = LinearRegression().fit(X_train, y_train)
64
+
65
+
66
+ y_pred2=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
67
+
68
+
69
+
70
+
71
+
72
+ #Equation
73
+ total2="1.87191609*(x1)+19.64115875*(x2)+91.64048224*(x3)+188.38350818*(x4)+23.55498894*(x5)-10954.252919457198"
74
+
75
+
76
+
77
+ #1998
78
+
79
+ #data collection
80
+ data3=pd.read_excel("ans2.xlsx")
81
+ df3 = data3.drop([' YEAR '], axis=1)
82
+
83
+
84
+
85
+ #data indexing
86
+ x=df3.iloc[:,1:].values
87
+ y=df3.iloc[:,0].values
88
+ np.reshape(y,(-1,1))
89
+
90
+ #split the dataset
91
+ from sklearn.model_selection import train_test_split
92
+ X_train, X_test, y_train, y_test = train_test_split(
93
+ x, y, test_size=0.33, random_state=42)
94
+
95
+
96
+ #traing the dataset
97
+ from sklearn.linear_model import LinearRegression
98
+
99
+ reg = LinearRegression().fit(X_train, y_train)
100
+
101
+
102
+ y_pred3=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
103
+
104
+
105
+
106
+
107
+
108
+ #Equation
109
+ total3="-16.16933055*(x1)+222.22199705*(x2)+137.12332335*(x3)+325.31073157*(x4)+(-123.63496668)*(x5)+56972.685015326366"
110
+
111
+
112
+
113
+ #1999
114
+
115
+ #data collection
116
+ data4=pd.read_excel("ans3.xlsx")
117
+ df4 = data4.drop([' YEAR '], axis=1)
118
+
119
+
120
+
121
+ #data indexing
122
+ x=df4.iloc[:,1:].values
123
+ y=df4.iloc[:,0].values
124
+ np.reshape(y,(-1,1))
125
+
126
+ #split the dataset
127
+ from sklearn.model_selection import train_test_split
128
+ X_train, X_test, y_train, y_test = train_test_split(
129
+ x, y, test_size=0.33, random_state=42)
130
+
131
+
132
+ #traing the dataset
133
+ from sklearn.linear_model import LinearRegression
134
+
135
+ reg = LinearRegression().fit(X_train, y_train)
136
+
137
+
138
+ y_pred4=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
139
+
140
+
141
+
142
+
143
+
144
+ #Equation
145
+ total4="24.45036879*(x1)+(-30.15985323)*(x2)+40.89603753*(x3)+102.95011027*(x4)+(-26.35323684)*(x5)+7934.309705068432"
146
+
147
+
148
+
149
+ #2000
150
+
151
+ #data collection
152
+ data5=pd.read_excel("ans4.xlsx")
153
+ df5 = data5.drop([' YEAR '], axis=1)
154
+
155
+
156
+
157
+ #data indexing
158
+ x=df5.iloc[:,1:].values
159
+ y=df5.iloc[:,0].values
160
+ np.reshape(y,(-1,1))
161
+
162
+ #split the dataset
163
+ from sklearn.model_selection import train_test_split
164
+ X_train, X_test, y_train, y_test = train_test_split(
165
+ x, y, test_size=0.33, random_state=42)
166
+
167
+
168
+ #traing the dataset
169
+ from sklearn.linear_model import LinearRegression
170
+
171
+ reg = LinearRegression().fit(X_train, y_train)
172
+
173
+
174
+ y_pred5=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
175
+
176
+
177
+
178
+
179
+
180
+ #Equation
181
+ total5="9.64446417*(x1)+1536.50170104*(x2)+(-43.51829088)*(x3)+(-209.86341104)*(x4)+(-56.82344007)*(x5)+21672.006533155447"
182
+
183
+
184
+
185
+ #2001
186
+
187
+ #data collection
188
+ data6=pd.read_excel("ans5.xlsx")
189
+ df6 = data6.drop([' YEAR '], axis=1)
190
+
191
+
192
+
193
+ #data indexing
194
+ x=df6.iloc[:,1:].values
195
+ y=df6.iloc[:,0].values
196
+ np.reshape(y,(-1,1))
197
+
198
+ #split the dataset
199
+ from sklearn.model_selection import train_test_split
200
+ X_train, X_test, y_train, y_test = train_test_split(
201
+ x, y, test_size=0.33, random_state=42)
202
+
203
+
204
+ #traing the dataset
205
+ from sklearn.linear_model import LinearRegression
206
+
207
+ reg = LinearRegression().fit(X_train, y_train)
208
+
209
+
210
+ y_pred6=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
211
+
212
+
213
+
214
+
215
+
216
+ #Equation
217
+ total6="(-17.95980305)*(x1)+397.29027184*(x2)+332.85116421*(x3)+176.63505073*(x4)+(-100.69005777)*(x5)+47882.75497380103"
218
+
219
+
220
+ #2002
221
+
222
+ #data collection
223
+ data7=pd.read_excel("ans6.xlsx")
224
+ df7 = data7.drop([' YEAR '], axis=1)
225
+
226
+
227
+
228
+ #data indexing
229
+ x=df7.iloc[:,1:].values
230
+ y=df7.iloc[:,0].values
231
+ np.reshape(y,(-1,1))
232
+
233
+ #split the dataset
234
+ from sklearn.model_selection import train_test_split
235
+ X_train, X_test, y_train, y_test = train_test_split(
236
+ x, y, test_size=0.33, random_state=42)
237
+
238
+
239
+ #traing the dataset
240
+ from sklearn.linear_model import LinearRegression
241
+
242
+ reg = LinearRegression().fit(X_train, y_train)
243
+
244
+
245
+ y_pred7=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
246
+
247
+
248
+
249
+
250
+
251
+ #Equation
252
+ total7="4.08573322*(x1)+531.87792204*(x2)+(-17.3614085 )*(x3)+(-11.17919737)*(x4)+(-53.48796076)*(x5)+22953.88111229325"
253
+
254
+
255
+ #2003
256
+
257
+ #data collection
258
+ data8=pd.read_excel("ans7.xlsx")
259
+ df8 = data8.drop([' YEAR '], axis=1)
260
+
261
+
262
+
263
+ #data indexing
264
+ x=df8.iloc[:,1:].values
265
+ y=df8.iloc[:,0].values
266
+ np.reshape(y,(-1,1))
267
+
268
+ #split the dataset
269
+ from sklearn.model_selection import train_test_split
270
+ X_train, X_test, y_train, y_test = train_test_split(
271
+ x, y, test_size=0.33, random_state=42)
272
+
273
+
274
+ #traing the dataset
275
+ from sklearn.linear_model import LinearRegression
276
+
277
+ reg = LinearRegression().fit(X_train, y_train)
278
+
279
+
280
+ y_pred8=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
281
+
282
+
283
+
284
+
285
+
286
+ #Equation
287
+ total8="31.82512443*(x1)+(-521.96868383 )*(x2)+(-43.51829088)*(x3)+ 205.27514768 *(x4)+(-97.91577198)*(x5)+37973.451433772294"
288
+
289
+
290
+
291
+ #2004
292
+
293
+ #data collection
294
+ data9=pd.read_excel("ans8.xlsx")
295
+ df9 = data9.drop([' YEAR '], axis=1)
296
+
297
+
298
+
299
+ #data indexing
300
+ x=df9.iloc[:,1:].values
301
+ y=df9.iloc[:,0].values
302
+ np.reshape(y,(-1,1))
303
+
304
+ #split the dataset
305
+ from sklearn.model_selection import train_test_split
306
+ X_train, X_test, y_train, y_test = train_test_split(
307
+ x, y, test_size=0.33, random_state=42)
308
+
309
+
310
+ #traing the dataset
311
+ from sklearn.linear_model import LinearRegression
312
+
313
+ reg = LinearRegression().fit(X_train, y_train)
314
+
315
+
316
+ y_pred9=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
317
+
318
+
319
+
320
+
321
+
322
+ #Equation
323
+ total9="9.64446417*(x1)+1536.50170104*(x2)+(-43.51829088)*(x3)+(-209.86341104)*(x4)+(-56.82344007)*(x5)+21672.006533155447"
324
+
325
+
326
+
327
+ #2005
328
+
329
+ #data collection
330
+ data10=pd.read_excel("ans9.xlsx")
331
+ df10 = data10.drop([' YEAR '], axis=1)
332
+
333
+
334
+
335
+ #data indexing
336
+ x=df10.iloc[:,1:].values
337
+ y=df10.iloc[:,0].values
338
+ np.reshape(y,(-1,1))
339
+
340
+ #split the dataset
341
+ from sklearn.model_selection import train_test_split
342
+ X_train, X_test, y_train, y_test = train_test_split(
343
+ x, y, test_size=0.33, random_state=42)
344
+
345
+
346
+ #traing the dataset
347
+ from sklearn.linear_model import LinearRegression
348
+
349
+ reg = LinearRegression().fit(X_train, y_train)
350
+
351
+
352
+ y_pred10=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
353
+
354
+
355
+
356
+
357
+
358
+ #Equation
359
+ total10="(-46.41395388)*(x1)+27.19076539*(x2)+(442.44336049)*(x3)+(-205.61881527)*(x4)+120.39426307*(x5)-46289.48823133327"
360
+
361
+
362
+
363
+ #2006
364
+
365
+ #data collection
366
+ data11=pd.read_excel("ans10.xlsx")
367
+ df11 = data11.drop([' YEAR '], axis=1)
368
+
369
+
370
+
371
+ #data indexing
372
+ x=df11.iloc[:,1:].values
373
+ y=df11.iloc[:,0].values
374
+ np.reshape(y,(-1,1))
375
+
376
+ #split the dataset
377
+ from sklearn.model_selection import train_test_split
378
+ X_train, X_test, y_train, y_test = train_test_split(
379
+ x, y, test_size=0.33, random_state=42)
380
+
381
+
382
+ #traing the dataset
383
+ from sklearn.linear_model import LinearRegression
384
+
385
+ reg = LinearRegression().fit(X_train, y_train)
386
+
387
+
388
+ y_pred11=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
389
+
390
+
391
+
392
+
393
+
394
+ #Equation
395
+ total11="(-15.45736104)*(x1)+23.92398419*(x2)+334.30252317*(x3)+151.55678804*(x4)+(-66.42769537)*(x5)+29294.014037250927"
396
+
397
+
398
+
399
+
400
+ #2007
401
+
402
+ #data collection
403
+ data12=pd.read_excel("ans11.xlsx")
404
+ df12 = data12.drop([' YEAR '], axis=1)
405
+
406
+
407
+
408
+ #data indexing
409
+ x=df12.iloc[:,1:].values
410
+ y=df12.iloc[:,0].values
411
+ np.reshape(y,(-1,1))
412
+
413
+ #split the dataset
414
+ from sklearn.model_selection import train_test_split
415
+ X_train, X_test, y_train, y_test = train_test_split(
416
+ x, y, test_size=0.33, random_state=42)
417
+
418
+
419
+ #traing the dataset
420
+ from sklearn.linear_model import LinearRegression
421
+
422
+ reg = LinearRegression().fit(X_train, y_train)
423
+
424
+
425
+ y_pred12=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
426
+
427
+
428
+
429
+
430
+
431
+ #Equation
432
+ total12="33.41323832*(x1)+(-36.18735569)*(x2)+768.11444325*(x3)+(-182.42626044 )*(x4)+(14.70116631)*(x5)-6967.764713347897"
433
+
434
+
435
+
436
+ #2008
437
+
438
+ #data collection
439
+ data13=pd.read_excel("ans12.xlsx")
440
+ df13 = data13.drop([' YEAR '], axis=1)
441
+
442
+
443
+
444
+ #data indexing
445
+ x=df13.iloc[:,1:].values
446
+ y=df13.iloc[:,0].values
447
+ np.reshape(y,(-1,1))
448
+
449
+ #split the dataset
450
+ from sklearn.model_selection import train_test_split
451
+ X_train, X_test, y_train, y_test = train_test_split(
452
+ x, y, test_size=0.33, random_state=42)
453
+
454
+
455
+ #traing the dataset
456
+ from sklearn.linear_model import LinearRegression
457
+
458
+ reg = LinearRegression().fit(X_train, y_train)
459
+
460
+
461
+ y_pred13=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
462
+
463
+
464
+
465
+
466
+
467
+ #Equation
468
+ total13="180.34683409 *(x1)+49.48628012*(x2)+152.71729516*(x3)+( -174.89679207)*(x4)+(-144.40854904)*(x5)+30420.505686819404"
469
+
470
+
471
+
472
+
473
+
474
+ #2009
475
+
476
+ #data collection
477
+ data14=pd.read_excel("ans13.xlsx")
478
+ df14 = data14.drop([' YEAR '], axis=1)
479
+
480
+
481
+
482
+ #data indexing
483
+ x=df14.iloc[:,1:].values
484
+ y=df14.iloc[:,0].values
485
+ np.reshape(y,(-1,1))
486
+
487
+ #split the dataset
488
+ from sklearn.model_selection import train_test_split
489
+ X_train, X_test, y_train, y_test = train_test_split(
490
+ x, y, test_size=0.33, random_state=42)
491
+
492
+
493
+ #traing the dataset
494
+ from sklearn.linear_model import LinearRegression
495
+
496
+ reg = LinearRegression().fit(X_train, y_train)
497
+
498
+
499
+ y_pred14=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
500
+
501
+
502
+
503
+
504
+
505
+ #Equation
506
+ total14="17.11355138 *(x1)+37.59837451*(x2)+156.43469383*(x3)+(-104.8362236)*(x4)+81.10973597*(x5)-38919.678559060834"
507
+
508
+
509
+
510
+
511
+ #2010
512
+
513
+ #data collection
514
+ data15=pd.read_excel("ans14.xlsx")
515
+ df15 = data15.drop([' YEAR '], axis=1)
516
+
517
+
518
+
519
+ #data indexing
520
+ x=df15.iloc[:,1:].values
521
+ y=df15.iloc[:,0].values
522
+ np.reshape(y,(-1,1))
523
+
524
+ #split the dataset
525
+ from sklearn.model_selection import train_test_split
526
+ X_train, X_test, y_train, y_test = train_test_split(
527
+ x, y, test_size=0.33, random_state=42)
528
+
529
+
530
+ #traing the dataset
531
+ from sklearn.linear_model import LinearRegression
532
+
533
+ reg = LinearRegression().fit(X_train, y_train)
534
+
535
+
536
+ y_pred15=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
537
+
538
+
539
+
540
+
541
+
542
+ #Equation
543
+ total15="39.06418699 *(x1)+148.53455807*(x2)+14.69213499 *(x3)+107.43795246*(x4)+(-207.77185028)*(x5)+82358.63651384937"
544
+
545
+
546
+
547
+
548
+ #2011
549
+
550
+ #data collection
551
+ data16=pd.read_excel("ans15.xlsx")
552
+ df16 = data16.drop([' YEAR '], axis=1)
553
+
554
+
555
+
556
+ #data indexing
557
+ x=df16.iloc[:,1:].values
558
+ y=df16.iloc[:,0].values
559
+ np.reshape(y,(-1,1))
560
+
561
+ #split the dataset
562
+ from sklearn.model_selection import train_test_split
563
+ X_train, X_test, y_train, y_test = train_test_split(
564
+ x, y, test_size=0.33, random_state=42)
565
+
566
+
567
+ #traing the dataset
568
+ from sklearn.linear_model import LinearRegression
569
+
570
+ reg = LinearRegression().fit(X_train, y_train)
571
+
572
+
573
+ y_pred16=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
574
+
575
+
576
 
577
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
578
 
579
+ #Equation
580
+ total16="36.2551509 *(x1)+-21.16118114*(x2)+372.06856269*(x3)+(-59.04384028)*(x4)+(-49.61395171)*(x5)+18259.681897588325"
581
+
582
 
583
+
584
+
585
+ #2012
586
+
587
+ #data collection
588
+ data17=pd.read_excel("ans16.xlsx")
589
+ df17 = data17.drop([' YEAR '], axis=1)
590
+
591
+
592
+
593
+ #data indexing
594
+ x=df17.iloc[:,1:].values
595
+ y=df17.iloc[:,0].values
596
+ np.reshape(y,(-1,1))
597
+
598
+ #split the dataset
599
+ from sklearn.model_selection import train_test_split
600
+ X_train, X_test, y_train, y_test = train_test_split(
601
+ x, y, test_size=0.33, random_state=42)
602
+
603
+
604
+ #traing the dataset
605
+ from sklearn.linear_model import LinearRegression
606
+
607
+ reg = LinearRegression().fit(X_train, y_train)
608
+
609
+
610
+ y_pred17=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
611
+
612
+
613
+
614
+
615
+
616
+ #Equation
617
+ total17="76.15862868 *(x1)+24.66304806*(x2)+(-31.1753211)*(x3)+(-281.13550722 )*(x4)+48.76763872*(x5)-27641.15357666507"
618
+
619
+
620
+
621
+ #2013
622
+
623
+ #data collection
624
+ data18=pd.read_excel("ans17.xlsx")
625
+ df18 = data18.drop([' YEAR '], axis=1)
626
+
627
+
628
+
629
+ #data indexing
630
+ x=df18.iloc[:,1:].values
631
+ y=df18.iloc[:,0].values
632
+ np.reshape(y,(-1,1))
633
+
634
+ #split the dataset
635
+ from sklearn.model_selection import train_test_split
636
+ X_train, X_test, y_train, y_test = train_test_split(
637
+ x, y, test_size=0.33, random_state=42)
638
+
639
+
640
+ #traing the dataset
641
+ from sklearn.linear_model import LinearRegression
642
+
643
+ reg = LinearRegression().fit(X_train, y_train)
644
 
645
+
646
+ y_pred18=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
647
+
648
+
649
+
650
+
651
+
652
+ #Equation
653
+ total18="138.94519275 *(x1)+19.41784298*(x2)+160.13405515*(x3)+1190.40134987*(x4)+(-787.72926112)*(x5)+340350.32984524494"
654
+
655
+
656
+
657
+
658
+
659
+ #2014
660
+
661
+ #data collection
662
+ data19=pd.read_excel("ans18.xlsx")
663
+ df19 = data19.drop([' YEAR '], axis=1)
664
+
665
+
666
+
667
+ #data indexing
668
+ x=df19.iloc[:,1:].values
669
+ y=df19.iloc[:,0].values
670
+ np.reshape(y,(-1,1))
671
+
672
+ #split the dataset
673
+ from sklearn.model_selection import train_test_split
674
+ X_train, X_test, y_train, y_test = train_test_split(
675
+ x, y, test_size=0.33, random_state=42)
676
+
677
+
678
+ #traing the dataset
679
+ from sklearn.linear_model import LinearRegression
680
+
681
+ reg = LinearRegression().fit(X_train, y_train)
682
 
683
 
684
+ y_pred19=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
685
+
686
 
687
 
688
 
689
 
690
+ #Equation
691
+ total19="83.98184027*(x1)+61.59628945*(x2)+740.33672736*(x3)+(-347.39343539)*(x4)+(-293.6388187)*(x5)+121547.59923111903"
692
 
 
693
 
694
 
695
 
696
 
697
+ #2015
698
+
699
+ #data collection
700
+ data20=pd.read_excel("ans19.xlsx")
701
+ df20 = data20.drop([' YEAR '], axis=1)
702
+
703
+
704
+
705
+ #data indexing
706
+ x=df20.iloc[:,1:].values
707
+ y=df20.iloc[:,0].values
708
+ np.reshape(y,(-1,1))
709
+
710
+ #split the dataset
711
+ from sklearn.model_selection import train_test_split
712
+ X_train, X_test, y_train, y_test = train_test_split(
713
+ x, y, test_size=0.33, random_state=42)
714
+
715
+
716
+ #traing the dataset
717
+ from sklearn.linear_model import LinearRegression
718
+
719
+ reg = LinearRegression().fit(X_train, y_train)
720
+
721
+
722
+ y_pred20=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
723
+
724
+
725
+
726
+
727
+
728
+ #Equation
729
+ total20="25.74397202*(x1)+(-109.5936775)*(x2)+293.36826631*(x3)+(-52.97554351)*(x4)+178.24908664*(x5)-80332.13002824014"
730
+
731
+
732
+
733
+
734
+
735
+
736
+
737
+ #2016
738
+
739
+ #data collection
740
+ data21=pd.read_excel("ans20.xlsx")
741
+ df21 = data21.drop([' YEAR '], axis=1)
742
+
743
+
744
+
745
+ #data indexing
746
+ x=df21.iloc[:,1:].values
747
+ y=df21.iloc[:,0].values
748
+ np.reshape(y,(-1,1))
749
+
750
+ #split the dataset
751
+ from sklearn.model_selection import train_test_split
752
+ X_train, X_test, y_train, y_test = train_test_split(
753
+ x, y, test_size=0.33, random_state=42)
754
+
755
+
756
+ #traing the dataset
757
+ from sklearn.linear_model import LinearRegression
758
+
759
+ reg = LinearRegression().fit(X_train, y_train)
760
+
761
+
762
+ y_pred21=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
763
+
764
+
765
+
766
+
767
+
768
+ #Equation
769
+ total21="-9.33709575 *(x1)+(-60.54283141)*(x2)+1291.89291784*(x3)+112.70137053*(x4)+167.06117048*(x5)-76365.90014799789"
770
+
771
+
772
+
773
+
774
+
775
+ #2017
776
+
777
+ #data collection
778
+ data22=pd.read_excel("ans21.xlsx")
779
+ df22 = data22.drop([' YEAR '], axis=1)
780
+
781
+
782
+
783
+ #data indexing
784
+ x=df22.iloc[:,1:].values
785
+ y=df22.iloc[:,0].values
786
+ np.reshape(y,(-1,1))
787
+
788
+ #split the dataset
789
+ from sklearn.model_selection import train_test_split
790
+ X_train, X_test, y_train, y_test = train_test_split(
791
+ x, y, test_size=0.33, random_state=42)
792
+
793
+
794
+ #traing the dataset
795
+ from sklearn.linear_model import LinearRegression
796
+
797
+ reg = LinearRegression().fit(X_train, y_train)
798
+
799
+
800
+ y_pred22=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
801
+
802
+
803
+
804
+
805
+
806
+ #Equation
807
+ total22="-12.58553956 *(x1)+54.81099258*(x2)+224.41124874*(x3)+437.35226861*(x4)+(-160.78658794)*(x5)+68323.07737183299"
808
+
809
+
810
+
811
+
812
+
813
+ #2018
814
+
815
+ #data collection
816
+ data23=pd.read_excel("ans22.xlsx")
817
+ df23 = data23.drop([' YEAR '], axis=1)
818
+
819
+
820
+
821
+ #data indexing
822
+ x=df23.iloc[:,1:].values
823
+ y=df23.iloc[:,0].values
824
+ np.reshape(y,(-1,1))
825
+
826
+ #split the dataset
827
+ from sklearn.model_selection import train_test_split
828
+ X_train, X_test, y_train, y_test = train_test_split(
829
+ x, y, test_size=0.33, random_state=42)
830
+
831
+
832
+ #traing the dataset
833
+ from sklearn.linear_model import LinearRegression
834
+
835
+ reg = LinearRegression().fit(X_train, y_train)
836
+
837
+
838
+ y_pred23=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
839
+
840
+
841
+
842
+
843
+
844
+ #Equation
845
+ total23="73.20314723*(x1)+158.24671048*(x2)+(-3876.80695302)*(x3)+356.25236863*(x4)+(-195.73184137)*(x5)+85757.9509512224"
846
+
847
+
848
+
849
+
850
+ #2019
851
+
852
+ #data collection
853
+ data24=pd.read_excel("ans23.xlsx")
854
+ df24 = data24.drop([' YEAR '], axis=1)
855
+
856
+
857
+
858
+ #data indexing
859
+ x=df24.iloc[:,1:].values
860
+ y=df24.iloc[:,0].values
861
+ np.reshape(y,(-1,1))
862
+
863
+ #split the dataset
864
+ from sklearn.model_selection import train_test_split
865
+ X_train, X_test, y_train, y_test = train_test_split(
866
+ x, y, test_size=0.33, random_state=42)
867
+
868
+
869
+ #traing the dataset
870
+ from sklearn.linear_model import LinearRegression
871
+
872
+ reg = LinearRegression().fit(X_train, y_train)
873
+
874
+
875
+ y_pred24=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
876
+
877
+
878
+
879
+
880
+
881
+ #Equation
882
+ total24="104.06131346*(x1)+110.40576115*(x2)+(-3143.30201973)*(x3)+(-466.5687285)*(x4)+(-40.30732688)*(x5)+6946.199087391373"
883
+
884
+
885
+
886
+
887
+
888
+ #2020
889
+
890
+ #data collection
891
+ data25=pd.read_excel("ans24.xlsx")
892
+ df25 = data25.drop([' YEAR '], axis=1)
893
+
894
+
895
+
896
+ #data indexing
897
+ x=df25.iloc[:,1:].values
898
+ y=df25.iloc[:,0].values
899
+ np.reshape(y,(-1,1))
900
+
901
+ #split the dataset
902
+ from sklearn.model_selection import train_test_split
903
+ X_train, X_test, y_train, y_test = train_test_split(
904
+ x, y, test_size=0.33, random_state=42)
905
+
906
+
907
+ #traing the dataset
908
+ from sklearn.linear_model import LinearRegression
909
+
910
+ reg = LinearRegression().fit(X_train, y_train)
911
+
912
+
913
+ y_pred25=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
914
+
915
+
916
+
917
+
918
+
919
+ #Equation
920
+ total25="22.78813682*(x1)+46.1536507*(x2)+78.00814512*(x3)+(-71.38031119)*(x4)+(-37.57839411)*(x5)+12559.184605195129"
921
+
922
+
923
+
924
+
925
+
926
+ #2021
927
+
928
+ #data collection
929
+ data26=pd.read_excel("ans25.xlsx")
930
+ df26 = data26.drop([' YEAR '], axis=1)
931
+
932
+
933
+
934
+ #data indexing
935
+ x=df26.iloc[:,1:].values
936
+ y=df26.iloc[:,0].values
937
+ np.reshape(y,(-1,1))
938
+
939
+ #split the dataset
940
+ from sklearn.model_selection import train_test_split
941
+ X_train, X_test, y_train, y_test = train_test_split(
942
+ x, y, test_size=0.33, random_state=42)
943
+
944
+
945
+ #traing the dataset
946
+ from sklearn.linear_model import LinearRegression
947
+
948
+ reg = LinearRegression().fit(X_train, y_train)
949
+
950
+
951
+ y_pred26=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
952
+
953
+
954
+
955
+
956
+
957
+ #Equation
958
+ total26="63.70545758*(x1)+9.57432502*(x2)+1734.12898357*(x3)+(-230.53815238)*(x4)+93.1299683*(x5)-51860.81441391745"
959
+
960
+
961
+
962
+
963
+
964
+ #2022
965
+
966
+ #data collection
967
+ data27=pd.read_excel("ans26.xlsx")
968
+ df27 = data27.drop([' YEAR '], axis=1)
969
+
970
+
971
+
972
+ #data indexing
973
+ x=df27.iloc[:,1:].values
974
+ y=df27.iloc[:,0].values
975
+ np.reshape(y,(-1,1))
976
+
977
+ #split the dataset
978
+ from sklearn.model_selection import train_test_split
979
+ X_train, X_test, y_train, y_test = train_test_split(
980
+ x, y, test_size=0.33, random_state=42)
981
+
982
+
983
+ #traing the dataset
984
+ from sklearn.linear_model import LinearRegression
985
+
986
+ reg = LinearRegression().fit(X_train, y_train)
987
+
988
+
989
+ y_pred27=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
990
+
991
+
992
+
993
+
994
+
995
+ #Equation
996
+ total27="15.98972327*(x1)+5568.67299429*(x2)+79.28661735*(x3)+16.79333316*(x4)+(-87.10169494)*(x5)+40155.32700035415"
997
+
998
+
999
+
1000
+
1001
+
1002
+
1003
+
1004
+ #app section
1005
+ if(year==1996):
1006
+ return total1,y_pred1
1007
+
1008
+ elif(year==1997):
1009
+ return total2,y_pred2
1010
+
1011
+ elif(year==1998):
1012
+ return total3,y_pred3
1013
+
1014
+ elif(year==1999):
1015
+ return total4,y_pred4
1016
+
1017
+ elif(year==2000):
1018
+ return total5,y_pred5
1019
+
1020
+ elif(year==2001):
1021
+ return total6,y_pred6
1022
+
1023
+ elif(year==2002):
1024
+ return total7,y_pred7
1025
+
1026
+ elif(year==2003):
1027
+ return total8,y_pred8
1028
+
1029
+ elif(year==2004):
1030
+ return total9,y_pred9
1031
+
1032
+ elif(year==2005):
1033
+ return total10,y_pred10
1034
+
1035
+ elif(year==2006):
1036
+ return total11,y_pred11
1037
+
1038
+ elif(year==2007):
1039
+ return total12,y_pred12
1040
+
1041
+ elif(year==2008):
1042
+ return total13,y_pred13
1043
+
1044
+ elif(year==2009):
1045
+ return total14,y_pred14
1046
+
1047
+ elif(year==2010):
1048
+ return total15,y_pred15
1049
+
1050
+ elif(year==2011):
1051
+ return total16,y_pred16
1052
+
1053
+ elif(year==2012):
1054
+ return total17,y_pred17
1055
+
1056
+ elif(year==2013):
1057
+ return total18,y_pred18
1058
+
1059
+ elif(year==2014):
1060
+ return total19,y_pred19
1061
+
1062
+ elif(year==2015):
1063
+ return total20,y_pred20
1064
+
1065
+ elif(year==2016):
1066
+ return total21,y_pred21
1067
+
1068
+ elif(year==2017):
1069
+ return total22,y_pred22
1070
+
1071
+ elif(year==2018):
1072
+ return total23,y_pred23
1073
+
1074
+ elif(year==2019):
1075
+ return total24,y_pred24
1076
+
1077
+ elif(year==2020):
1078
+ return total25,y_pred25
1079
+
1080
+ elif(year==2021):
1081
+ return total26,y_pred26
1082
+
1083
+ elif(year==2022):
1084
+ return total27,y_pred27
1085
+
1086
+ else:
1087
+ return "no",0
1088
+
1089
+
1090
 
1091
 
1092
 
 
1098
  inputs=["number","number","number","number","number","number"],
1099
  outputs=["text","number"],
1100
  title="BARA SHIGRI",
1101
+ css="div {background-image: url('');background-size: 2000px 2000px;}",
1102
  description=
1103
  "Bara Shigri feeds the Chandra River which after its confluence at Tandi with the Bhaga River is known as Chandrabhaga or Chenab."
1104
  "According to Hugh Whistler’s 1924 writing, Shigri is applied par-excellence to one particular glacier that emerges from the mountains on the left bank of the Chenab. It is said to be several miles long, and the snout reaches right down to the river, lying athwart the customary road from Kulu to Spiti... In 1836 this glacier dammed the Chenab River, causing the formation of a large lake, which eventually broke loose and carried devastation down the valley."
 
1107
 
1108
 
1109
  )
1110
+ demo.launch()
1111
+
1112
+
1113
+
1114
+