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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datasets import load_dataset
|
2 |
+
|
3 |
+
dataset = load_dataset("Kartheesh/MLdataset")
|
4 |
+
import gradio as gr
|
5 |
+
import numpy as np
|
6 |
+
import pandas as pd
|
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("/content/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("/content/ans1 (1).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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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("/content/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 |
+
|
643 |
+
#traing the dataset
|
644 |
+
from sklearn.linear_model import LinearRegression
|
645 |
+
|
646 |
+
reg = LinearRegression().fit(X_train, y_train)
|
647 |
+
|
648 |
+
|
649 |
+
y_pred18=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
650 |
+
|
651 |
+
|
652 |
+
|
653 |
+
|
654 |
+
|
655 |
+
#Equation
|
656 |
+
total18="138.94519275 *(x1)+19.41784298*(x2)+160.13405515*(x3)+1190.40134987*(x4)+(-787.72926112)*(x5)+340350.32984524494"
|
657 |
+
|
658 |
+
|
659 |
+
|
660 |
+
|
661 |
+
|
662 |
+
#2014
|
663 |
+
|
664 |
+
#data collection
|
665 |
+
data19=pd.read_excel("/content/ans18.xlsx")
|
666 |
+
df19 = data19.drop([' YEAR '], axis=1)
|
667 |
+
|
668 |
+
|
669 |
+
|
670 |
+
#data indexing
|
671 |
+
x=df19.iloc[:,1:].values
|
672 |
+
y=df19.iloc[:,0].values
|
673 |
+
np.reshape(y,(-1,1))
|
674 |
+
|
675 |
+
#split the dataset
|
676 |
+
from sklearn.model_selection import train_test_split
|
677 |
+
X_train, X_test, y_train, y_test = train_test_split(
|
678 |
+
x, y, test_size=0.33, random_state=42)
|
679 |
+
|
680 |
+
|
681 |
+
#traing the dataset
|
682 |
+
from sklearn.linear_model import LinearRegression
|
683 |
+
|
684 |
+
reg = LinearRegression().fit(X_train, y_train)
|
685 |
+
|
686 |
+
|
687 |
+
y_pred19=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
688 |
+
|
689 |
+
|
690 |
+
|
691 |
+
|
692 |
+
|
693 |
+
#Equation
|
694 |
+
total19="83.98184027*(x1)+61.59628945*(x2)+740.33672736*(x3)+(-347.39343539)*(x4)+(-293.6388187)*(x5)+121547.59923111903"
|
695 |
+
|
696 |
+
|
697 |
+
|
698 |
+
|
699 |
+
|
700 |
+
#2015
|
701 |
+
|
702 |
+
#data collection
|
703 |
+
data20=pd.read_excel("/content/ans19.xlsx")
|
704 |
+
df20 = data20.drop([' YEAR '], axis=1)
|
705 |
+
|
706 |
+
|
707 |
+
|
708 |
+
#data indexing
|
709 |
+
x=df20.iloc[:,1:].values
|
710 |
+
y=df20.iloc[:,0].values
|
711 |
+
np.reshape(y,(-1,1))
|
712 |
+
|
713 |
+
#split the dataset
|
714 |
+
from sklearn.model_selection import train_test_split
|
715 |
+
X_train, X_test, y_train, y_test = train_test_split(
|
716 |
+
x, y, test_size=0.33, random_state=42)
|
717 |
+
|
718 |
+
|
719 |
+
#traing the dataset
|
720 |
+
from sklearn.linear_model import LinearRegression
|
721 |
+
|
722 |
+
reg = LinearRegression().fit(X_train, y_train)
|
723 |
+
|
724 |
+
|
725 |
+
y_pred20=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
726 |
+
|
727 |
+
|
728 |
+
|
729 |
+
|
730 |
+
|
731 |
+
#Equation
|
732 |
+
total20="25.74397202*(x1)+(-109.5936775)*(x2)+293.36826631*(x3)+(-52.97554351)*(x4)+178.24908664*(x5)-80332.13002824014"
|
733 |
+
|
734 |
+
|
735 |
+
|
736 |
+
|
737 |
+
|
738 |
+
|
739 |
+
|
740 |
+
#2016
|
741 |
+
|
742 |
+
#data collection
|
743 |
+
data21=pd.read_excel("/content/ans20.xlsx")
|
744 |
+
df21 = data21.drop([' YEAR '], axis=1)
|
745 |
+
|
746 |
+
|
747 |
+
|
748 |
+
#data indexing
|
749 |
+
x=df21.iloc[:,1:].values
|
750 |
+
y=df21.iloc[:,0].values
|
751 |
+
np.reshape(y,(-1,1))
|
752 |
+
|
753 |
+
#split the dataset
|
754 |
+
from sklearn.model_selection import train_test_split
|
755 |
+
X_train, X_test, y_train, y_test = train_test_split(
|
756 |
+
x, y, test_size=0.33, random_state=42)
|
757 |
+
|
758 |
+
|
759 |
+
#traing the dataset
|
760 |
+
from sklearn.linear_model import LinearRegression
|
761 |
+
|
762 |
+
reg = LinearRegression().fit(X_train, y_train)
|
763 |
+
|
764 |
+
|
765 |
+
y_pred21=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
766 |
+
|
767 |
+
|
768 |
+
|
769 |
+
|
770 |
+
|
771 |
+
#Equation
|
772 |
+
total21="-9.33709575 *(x1)+(-60.54283141)*(x2)+1291.89291784*(x3)+112.70137053*(x4)+167.06117048*(x5)-76365.90014799789"
|
773 |
+
|
774 |
+
|
775 |
+
|
776 |
+
|
777 |
+
|
778 |
+
#2017
|
779 |
+
|
780 |
+
#data collection
|
781 |
+
data22=pd.read_excel("/content/ans21.xlsx")
|
782 |
+
df22 = data22.drop([' YEAR '], axis=1)
|
783 |
+
|
784 |
+
|
785 |
+
|
786 |
+
#data indexing
|
787 |
+
x=df22.iloc[:,1:].values
|
788 |
+
y=df22.iloc[:,0].values
|
789 |
+
np.reshape(y,(-1,1))
|
790 |
+
|
791 |
+
#split the dataset
|
792 |
+
from sklearn.model_selection import train_test_split
|
793 |
+
X_train, X_test, y_train, y_test = train_test_split(
|
794 |
+
x, y, test_size=0.33, random_state=42)
|
795 |
+
|
796 |
+
|
797 |
+
#traing the dataset
|
798 |
+
from sklearn.linear_model import LinearRegression
|
799 |
+
|
800 |
+
reg = LinearRegression().fit(X_train, y_train)
|
801 |
+
|
802 |
+
|
803 |
+
y_pred22=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
804 |
+
|
805 |
+
|
806 |
+
|
807 |
+
|
808 |
+
|
809 |
+
#Equation
|
810 |
+
total22="-12.58553956 *(x1)+54.81099258*(x2)+224.41124874*(x3)+437.35226861*(x4)+(-160.78658794)*(x5)+68323.07737183299"
|
811 |
+
|
812 |
+
|
813 |
+
|
814 |
+
|
815 |
+
|
816 |
+
#2018
|
817 |
+
|
818 |
+
#data collection
|
819 |
+
data23=pd.read_excel("/content/ans22.xlsx")
|
820 |
+
df23 = data23.drop([' YEAR '], axis=1)
|
821 |
+
|
822 |
+
|
823 |
+
|
824 |
+
#data indexing
|
825 |
+
x=df23.iloc[:,1:].values
|
826 |
+
y=df23.iloc[:,0].values
|
827 |
+
np.reshape(y,(-1,1))
|
828 |
+
|
829 |
+
#split the dataset
|
830 |
+
from sklearn.model_selection import train_test_split
|
831 |
+
X_train, X_test, y_train, y_test = train_test_split(
|
832 |
+
x, y, test_size=0.33, random_state=42)
|
833 |
+
|
834 |
+
|
835 |
+
#traing the dataset
|
836 |
+
from sklearn.linear_model import LinearRegression
|
837 |
+
|
838 |
+
reg = LinearRegression().fit(X_train, y_train)
|
839 |
+
|
840 |
+
|
841 |
+
y_pred23=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
842 |
+
|
843 |
+
|
844 |
+
|
845 |
+
|
846 |
+
|
847 |
+
#Equation
|
848 |
+
total23="73.20314723*(x1)+158.24671048*(x2)+(-3876.80695302)*(x3)+356.25236863*(x4)+(-195.73184137)*(x5)+85757.9509512224"
|
849 |
+
|
850 |
+
|
851 |
+
|
852 |
+
|
853 |
+
#2019
|
854 |
+
|
855 |
+
#data collection
|
856 |
+
data24=pd.read_excel("/content/ans23.xlsx")
|
857 |
+
df24 = data24.drop([' YEAR '], axis=1)
|
858 |
+
|
859 |
+
|
860 |
+
|
861 |
+
#data indexing
|
862 |
+
x=df24.iloc[:,1:].values
|
863 |
+
y=df24.iloc[:,0].values
|
864 |
+
np.reshape(y,(-1,1))
|
865 |
+
|
866 |
+
#split the dataset
|
867 |
+
from sklearn.model_selection import train_test_split
|
868 |
+
X_train, X_test, y_train, y_test = train_test_split(
|
869 |
+
x, y, test_size=0.33, random_state=42)
|
870 |
+
|
871 |
+
|
872 |
+
#traing the dataset
|
873 |
+
from sklearn.linear_model import LinearRegression
|
874 |
+
|
875 |
+
reg = LinearRegression().fit(X_train, y_train)
|
876 |
+
|
877 |
+
|
878 |
+
y_pred24=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
879 |
+
|
880 |
+
|
881 |
+
|
882 |
+
|
883 |
+
|
884 |
+
#Equation
|
885 |
+
total24="104.06131346*(x1)+110.40576115*(x2)+(-3143.30201973)*(x3)+(-466.5687285)*(x4)+(-40.30732688)*(x5)+6946.199087391373"
|
886 |
+
|
887 |
+
|
888 |
+
|
889 |
+
|
890 |
+
|
891 |
+
#2020
|
892 |
+
|
893 |
+
#data collection
|
894 |
+
data25=pd.read_excel("/content/ans24.xlsx")
|
895 |
+
df25 = data25.drop([' YEAR '], axis=1)
|
896 |
+
|
897 |
+
|
898 |
+
|
899 |
+
#data indexing
|
900 |
+
x=df25.iloc[:,1:].values
|
901 |
+
y=df25.iloc[:,0].values
|
902 |
+
np.reshape(y,(-1,1))
|
903 |
+
|
904 |
+
#split the dataset
|
905 |
+
from sklearn.model_selection import train_test_split
|
906 |
+
X_train, X_test, y_train, y_test = train_test_split(
|
907 |
+
x, y, test_size=0.33, random_state=42)
|
908 |
+
|
909 |
+
|
910 |
+
#traing the dataset
|
911 |
+
from sklearn.linear_model import LinearRegression
|
912 |
+
|
913 |
+
reg = LinearRegression().fit(X_train, y_train)
|
914 |
+
|
915 |
+
|
916 |
+
y_pred25=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
917 |
+
|
918 |
+
|
919 |
+
|
920 |
+
|
921 |
+
|
922 |
+
#Equation
|
923 |
+
total25="22.78813682*(x1)+46.1536507*(x2)+78.00814512*(x3)+(-71.38031119)*(x4)+(-37.57839411)*(x5)+12559.184605195129"
|
924 |
+
|
925 |
+
|
926 |
+
|
927 |
+
|
928 |
+
|
929 |
+
#2021
|
930 |
+
|
931 |
+
#data collection
|
932 |
+
data26=pd.read_excel("/content/ans25.xlsx")
|
933 |
+
df26 = data26.drop([' YEAR '], axis=1)
|
934 |
+
|
935 |
+
|
936 |
+
|
937 |
+
#data indexing
|
938 |
+
x=df26.iloc[:,1:].values
|
939 |
+
y=df26.iloc[:,0].values
|
940 |
+
np.reshape(y,(-1,1))
|
941 |
+
|
942 |
+
#split the dataset
|
943 |
+
from sklearn.model_selection import train_test_split
|
944 |
+
X_train, X_test, y_train, y_test = train_test_split(
|
945 |
+
x, y, test_size=0.33, random_state=42)
|
946 |
+
|
947 |
+
|
948 |
+
#traing the dataset
|
949 |
+
from sklearn.linear_model import LinearRegression
|
950 |
+
|
951 |
+
reg = LinearRegression().fit(X_train, y_train)
|
952 |
+
|
953 |
+
|
954 |
+
y_pred26=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
955 |
+
|
956 |
+
|
957 |
+
|
958 |
+
|
959 |
+
|
960 |
+
#Equation
|
961 |
+
total26="63.70545758*(x1)+9.57432502*(x2)+1734.12898357*(x3)+(-230.53815238)*(x4)+93.1299683*(x5)-51860.81441391745"
|
962 |
+
|
963 |
+
|
964 |
+
|
965 |
+
|
966 |
+
|
967 |
+
#2022
|
968 |
+
|
969 |
+
#data collection
|
970 |
+
data27=pd.read_excel("/content/ans26.xlsx")
|
971 |
+
df27 = data27.drop([' YEAR '], axis=1)
|
972 |
+
|
973 |
+
|
974 |
+
|
975 |
+
#data indexing
|
976 |
+
x=df27.iloc[:,1:].values
|
977 |
+
y=df27.iloc[:,0].values
|
978 |
+
np.reshape(y,(-1,1))
|
979 |
+
|
980 |
+
#split the dataset
|
981 |
+
from sklearn.model_selection import train_test_split
|
982 |
+
X_train, X_test, y_train, y_test = train_test_split(
|
983 |
+
x, y, test_size=0.33, random_state=42)
|
984 |
+
|
985 |
+
|
986 |
+
#traing the dataset
|
987 |
+
from sklearn.linear_model import LinearRegression
|
988 |
+
|
989 |
+
reg = LinearRegression().fit(X_train, y_train)
|
990 |
+
|
991 |
+
|
992 |
+
y_pred27=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
|
993 |
+
|
994 |
+
|
995 |
+
|
996 |
+
|
997 |
+
|
998 |
+
#Equation
|
999 |
+
total27="15.98972327*(x1)+5568.67299429*(x2)+79.28661735*(x3)+16.79333316*(x4)+(-87.10169494)*(x5)+40155.32700035415"
|
1000 |
+
|
1001 |
+
|
1002 |
+
|
1003 |
+
|
1004 |
+
|
1005 |
+
|
1006 |
+
|
1007 |
+
#app section
|
1008 |
+
if(year==1996):
|
1009 |
+
return total1,y_pred1
|
1010 |
+
|
1011 |
+
elif(year==1997):
|
1012 |
+
return total2,y_pred2
|
1013 |
+
|
1014 |
+
elif(year==1998):
|
1015 |
+
return total3,y_pred3
|
1016 |
+
|
1017 |
+
elif(year==1999):
|
1018 |
+
return total4,y_pred4
|
1019 |
+
|
1020 |
+
elif(year==2000):
|
1021 |
+
return total5,y_pred5
|
1022 |
+
|
1023 |
+
elif(year==2001):
|
1024 |
+
return total6,y_pred6
|
1025 |
+
|
1026 |
+
elif(year==2002):
|
1027 |
+
return total7,y_pred7
|
1028 |
+
|
1029 |
+
elif(year==2003):
|
1030 |
+
return total8,y_pred8
|
1031 |
+
|
1032 |
+
elif(year==2004):
|
1033 |
+
return total9,y_pred9
|
1034 |
+
|
1035 |
+
elif(year==2005):
|
1036 |
+
return total10,y_pred10
|
1037 |
+
|
1038 |
+
elif(year==2006):
|
1039 |
+
return total11,y_pred11
|
1040 |
+
|
1041 |
+
elif(year==2007):
|
1042 |
+
return total12,y_pred12
|
1043 |
+
|
1044 |
+
elif(year==2008):
|
1045 |
+
return total13,y_pred13
|
1046 |
+
|
1047 |
+
elif(year==2009):
|
1048 |
+
return total14,y_pred14
|
1049 |
+
|
1050 |
+
elif(year==2010):
|
1051 |
+
return total15,y_pred15
|
1052 |
+
|
1053 |
+
elif(year==2011):
|
1054 |
+
return total16,y_pred16
|
1055 |
+
|
1056 |
+
elif(year==2012):
|
1057 |
+
return total17,y_pred17
|
1058 |
+
|
1059 |
+
elif(year==2013):
|
1060 |
+
return total18,y_pred18
|
1061 |
+
|
1062 |
+
elif(year==2014):
|
1063 |
+
return total19,y_pred19
|
1064 |
+
|
1065 |
+
elif(year==2015):
|
1066 |
+
return total20,y_pred20
|
1067 |
+
|
1068 |
+
elif(year==2016):
|
1069 |
+
return total21,y_pred21
|
1070 |
+
|
1071 |
+
elif(year==2017):
|
1072 |
+
return total22,y_pred22
|
1073 |
+
|
1074 |
+
elif(year==2018):
|
1075 |
+
return total23,y_pred23
|
1076 |
+
|
1077 |
+
elif(year==2019):
|
1078 |
+
return total24,y_pred24
|
1079 |
+
|
1080 |
+
elif(year==2020):
|
1081 |
+
return total25,y_pred25
|
1082 |
+
|
1083 |
+
elif(year==2021):
|
1084 |
+
return total26,y_pred26
|
1085 |
+
|
1086 |
+
elif(year==2022):
|
1087 |
+
return total27,y_pred27
|
1088 |
+
|
1089 |
+
else:
|
1090 |
+
return "no",0
|
1091 |
+
|
1092 |
+
|
1093 |
+
|
1094 |
+
|
1095 |
+
|
1096 |
+
|
1097 |
+
|
1098 |
+
|
1099 |
+
demo = gr.Interface(
|
1100 |
+
fn=greet,
|
1101 |
+
inputs=["number","number","number","number","number","number"],
|
1102 |
+
outputs=["text","number"],
|
1103 |
+
title="BARA SHIGRI",
|
1104 |
+
css="div {background-image: url('https://drive.google.com/uc?export=view&id=1o4Q6O7LAFTpejs4zwOo6X-BYfrjjyTVr');background-size: 2000px 2000px;}",
|
1105 |
+
description=
|
1106 |
+
"Bara Shigri feeds the Chandra River which after its confluence at Tandi with the Bhaga River is known as Chandrabhaga or Chenab."
|
1107 |
+
"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."
|
1108 |
+
"Across the Bara Shigri is another glacier known as Chhota Shigri. It is, as the name suggests, a comparatively smaller glacier.",
|
1109 |
+
description_font_color="Black"
|
1110 |
+
|
1111 |
+
|
1112 |
+
)
|
1113 |
+
demo.launch()
|
1114 |
+
|
1115 |
+
|
1116 |
+
|