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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +295 -435
app.py CHANGED
@@ -75,533 +75,393 @@ def greet(year,co2_emission,no2_emission,so2_emission,global_warming,methane_emi
75
 
76
  #Equation
77
  total3="-16.16933055*(x1)+222.22199705*(x2)+137.12332335*(x3)+325.31073157*(x4)+(-123.63496668)*(x5)+56972.685015326366"
78
-
79
-
80
-
81
- #1999
82
-
83
- #data collection
84
- data4=pd.read_excel("/content/ans3.xlsx")
85
- df4 = data4.drop([' YEAR '], axis=1)
86
-
87
-
88
-
89
- #data indexing
90
- x=df4.iloc[:,1:].values
91
- y=df4.iloc[:,0].values
92
- np.reshape(y,(-1,1))
93
-
94
- #split the dataset
95
- from sklearn.model_selection import train_test_split
96
- X_train, X_test, y_train, y_test = train_test_split(
97
  x, y, test_size=0.33, random_state=42)
98
-
99
-
100
- #traing the dataset
101
- from sklearn.linear_model import LinearRegression
102
-
103
- reg = LinearRegression().fit(X_train, y_train)
104
-
105
-
106
- y_pred4=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
107
-
108
-
109
-
110
-
111
-
112
- #Equation
113
- total4="24.45036879*(x1)+(-30.15985323)*(x2)+40.89603753*(x3)+102.95011027*(x4)+(-26.35323684)*(x5)+7934.309705068432"
114
-
115
-
116
-
117
- #2000
118
-
119
- #data collection
120
- data5=pd.read_excel("/content/ans4.xlsx")
121
- df5 = data5.drop([' YEAR '], axis=1)
122
-
123
-
124
-
125
- #data indexing
126
- x=df5.iloc[:,1:].values
127
- y=df5.iloc[:,0].values
128
- np.reshape(y,(-1,1))
129
-
130
- #split the dataset
131
- from sklearn.model_selection import train_test_split
132
- X_train, X_test, y_train, y_test = train_test_split(
133
  x, y, test_size=0.33, random_state=42)
134
-
135
-
136
- #traing the dataset
137
- from sklearn.linear_model import LinearRegression
138
-
139
- reg = LinearRegression().fit(X_train, y_train)
140
-
141
-
142
- y_pred5=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
143
-
144
-
145
-
146
-
147
-
148
- #Equation
149
- total5="9.64446417*(x1)+1536.50170104*(x2)+(-43.51829088)*(x3)+(-209.86341104)*(x4)+(-56.82344007)*(x5)+21672.006533155447"
150
-
151
-
152
-
153
  #2001
154
-
155
- #data collection
156
- data6=pd.read_excel("/content/ans5.xlsx")
157
- df6 = data6.drop([' YEAR '], axis=1)
158
-
159
-
160
-
161
- #data indexing
162
- x=df6.iloc[:,1:].values
163
- y=df6.iloc[:,0].values
164
- np.reshape(y,(-1,1))
165
-
166
- #split the dataset
167
- from sklearn.model_selection import train_test_split
168
- X_train, X_test, y_train, y_test = train_test_split(
169
  x, y, test_size=0.33, random_state=42)
170
-
171
-
172
- #traing the dataset
173
- from sklearn.linear_model import LinearRegression
174
-
175
- reg = LinearRegression().fit(X_train, y_train)
176
-
177
-
178
- y_pred6=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
179
-
180
-
181
-
182
-
183
-
184
- #Equation
185
- total6="(-17.95980305)*(x1)+397.29027184*(x2)+332.85116421*(x3)+176.63505073*(x4)+(-100.69005777)*(x5)+47882.75497380103"
186
 
187
 
188
  #2002
189
 
190
- #data collection
191
- data7=pd.read_excel("/content/ans6.xlsx")
192
- df7 = data7.drop([' YEAR '], axis=1)
193
-
194
-
195
-
196
- #data indexing
197
- x=df7.iloc[:,1:].values
198
- y=df7.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_pred7=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
214
-
215
-
216
-
217
-
218
-
219
- #Equation
220
- total7="4.08573322*(x1)+531.87792204*(x2)+(-17.3614085 )*(x3)+(-11.17919737)*(x4)+(-53.48796076)*(x5)+22953.88111229325"
221
-
222
-
223
- #2003
224
-
225
- #data collection
226
- data8=pd.read_excel("/content/ans7.xlsx")
227
- df8 = data8.drop([' YEAR '], axis=1)
228
-
229
-
230
-
231
- #data indexing
232
- x=df8.iloc[:,1:].values
233
- y=df8.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_pred8=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
249
-
250
-
251
-
252
-
253
-
254
- #Equation
255
- total8="31.82512443*(x1)+(-521.96868383 )*(x2)+(-43.51829088)*(x3)+ 205.27514768 *(x4)+(-97.91577198)*(x5)+37973.451433772294"
256
-
257
-
258
-
259
- #2004
260
-
261
- #data collection
262
- data9=pd.read_excel("/content/ans8.xlsx")
263
- df9 = data9.drop([' YEAR '], axis=1)
264
-
265
-
266
-
267
- #data indexing
268
- x=df9.iloc[:,1:].values
269
- y=df9.iloc[:,0].values
270
- np.reshape(y,(-1,1))
271
-
272
- #split the dataset
273
- from sklearn.model_selection import train_test_split
274
- X_train, X_test, y_train, y_test = train_test_split(
275
- x, y, test_size=0.33, random_state=42)
276
-
277
-
278
- #traing the dataset
279
- from sklearn.linear_model import LinearRegression
280
-
281
- reg = LinearRegression().fit(X_train, y_train)
282
-
283
-
284
- y_pred9=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
285
-
286
-
287
-
288
-
289
-
290
- #Equation
291
- total9="9.64446417*(x1)+1536.50170104*(x2)+(-43.51829088)*(x3)+(-209.86341104)*(x4)+(-56.82344007)*(x5)+21672.006533155447"
292
-
293
-
294
-
295
- #2005
296
-
297
- #data collection
298
- data10=pd.read_excel("/content/ans9.xlsx")
299
- df10 = data10.drop([' YEAR '], axis=1)
300
-
301
-
302
-
303
- #data indexing
304
- x=df10.iloc[:,1:].values
305
- y=df10.iloc[:,0].values
306
- np.reshape(y,(-1,1))
307
-
308
- #split the dataset
309
- from sklearn.model_selection import train_test_split
310
- X_train, X_test, y_train, y_test = train_test_split(
311
- x, y, test_size=0.33, random_state=42)
312
-
313
-
314
- #traing the dataset
315
- from sklearn.linear_model import LinearRegression
316
-
317
- reg = LinearRegression().fit(X_train, y_train)
318
-
319
-
320
- y_pred10=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
321
-
322
-
323
-
324
-
325
-
326
- #Equation
327
- total10="(-46.41395388)*(x1)+27.19076539*(x2)+(442.44336049)*(x3)+(-205.61881527)*(x4)+120.39426307*(x5)-46289.48823133327"
328
-
329
-
330
-
331
- #2006
332
-
333
- #data collection
334
- data11=pd.read_excel("/content/ans10.xlsx")
335
- df11 = data11.drop([' YEAR '], axis=1)
336
-
337
-
338
-
339
- #data indexing
340
- x=df11.iloc[:,1:].values
341
- y=df11.iloc[:,0].values
342
- np.reshape(y,(-1,1))
343
-
344
- #split the dataset
345
- from sklearn.model_selection import train_test_split
346
- X_train, X_test, y_train, y_test = train_test_split(
347
- x, y, test_size=0.33, random_state=42)
348
-
349
-
350
- #traing the dataset
351
- from sklearn.linear_model import LinearRegression
352
-
353
- reg = LinearRegression().fit(X_train, y_train)
354
-
355
-
356
- y_pred11=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
357
-
358
-
359
-
360
-
361
-
362
- #Equation
363
- total11="(-15.45736104)*(x1)+23.92398419*(x2)+334.30252317*(x3)+151.55678804*(x4)+(-66.42769537)*(x5)+29294.014037250927"
364
-
365
-
366
-
367
-
368
- #2007
369
-
370
- #data collection
371
- data12=pd.read_excel("/content/ans11.xlsx")
372
- df12 = data12.drop([' YEAR '], axis=1)
373
-
374
-
375
 
376
- #data indexing
377
- x=df12.iloc[:,1:].values
378
- y=df12.iloc[:,0].values
379
- np.reshape(y,(-1,1))
380
 
381
- #split the dataset
382
- from sklearn.model_selection import train_test_split
383
- X_train, X_test, y_train, y_test = train_test_split(
384
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
385
 
386
 
387
- #traing the dataset
388
- from sklearn.linear_model import LinearRegression
389
-
390
- reg = LinearRegression().fit(X_train, y_train)
391
 
392
 
393
- y_pred12=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
394
 
 
 
 
 
 
 
 
 
395
 
 
 
 
 
 
 
 
 
 
396
 
397
-
398
 
399
- #Equation
400
- total12="33.41323832*(x1)+(-36.18735569)*(x2)+768.11444325*(x3)+(-182.42626044 )*(x4)+(14.70116631)*(x5)-6967.764713347897"
401
 
402
 
 
403
 
404
- #2008
405
-
406
- #data collection
407
- data13=pd.read_excel("/content/ans12.xlsx")
408
- df13 = data13.drop([' YEAR '], axis=1)
409
-
410
-
411
 
412
- #data indexing
413
- x=df13.iloc[:,1:].values
414
- y=df13.iloc[:,0].values
415
- np.reshape(y,(-1,1))
416
 
417
- #split the dataset
418
- from sklearn.model_selection import train_test_split
419
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
420
  x, y, test_size=0.33, random_state=42)
421
 
 
 
 
 
422
 
423
- #traing the dataset
424
- from sklearn.linear_model import LinearRegression
425
 
426
- reg = LinearRegression().fit(X_train, y_train)
 
427
 
428
 
429
- y_pred13=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
430
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
431
 
432
 
 
 
433
 
434
 
435
- #Equation
436
- total13="180.34683409 *(x1)+49.48628012*(x2)+152.71729516*(x3)+( -174.89679207)*(x4)+(-144.40854904)*(x5)+30420.505686819404"
437
-
438
 
 
 
 
439
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
 
441
 
442
- #2009
443
-
444
- #data collection
445
- data14=pd.read_excel("/content/ans13.xlsx")
446
- df14 = data14.drop([' YEAR '], axis=1)
447
-
448
-
449
 
450
- #data indexing
451
- x=df14.iloc[:,1:].values
452
- y=df14.iloc[:,0].values
453
- np.reshape(y,(-1,1))
454
 
455
- #split the dataset
456
- from sklearn.model_selection import train_test_split
457
- X_train, X_test, y_train, y_test = train_test_split(
 
 
 
 
 
458
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
459
 
460
 
461
- #traing the dataset
462
- from sklearn.linear_model import LinearRegression
463
-
464
- reg = LinearRegression().fit(X_train, y_train)
465
 
 
466
 
467
- y_pred14=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
468
-
 
469
 
 
 
 
 
470
 
471
-
 
 
 
 
 
 
 
 
472
 
473
- #Equation
474
- total14="17.11355138 *(x1)+37.59837451*(x2)+156.43469383*(x3)+(-104.8362236)*(x4)+81.10973597*(x5)-38919.678559060834"
475
 
476
 
 
477
 
 
 
 
478
 
479
- #2010
480
-
481
- #data collection
482
- data15=pd.read_excel("/content/ans14.xlsx")
483
- df15 = data15.drop([' YEAR '], axis=1)
484
-
485
-
486
-
487
- #data indexing
488
- x=df15.iloc[:,1:].values
489
- y=df15.iloc[:,0].values
490
- np.reshape(y,(-1,1))
491
-
492
- #split the dataset
493
- from sklearn.model_selection import train_test_split
494
- X_train, X_test, y_train, y_test = train_test_split(
495
  x, y, test_size=0.33, random_state=42)
 
 
 
 
 
496
 
497
 
498
- #traing the dataset
499
- from sklearn.linear_model import LinearRegression
500
-
501
- reg = LinearRegression().fit(X_train, y_train)
502
 
503
 
504
- y_pred15=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
505
-
506
-
 
 
507
 
508
-
 
 
 
 
 
 
 
 
 
 
 
 
 
509
 
510
- #Equation
511
- total15="39.06418699 *(x1)+148.53455807*(x2)+14.69213499 *(x3)+107.43795246*(x4)+(-207.77185028)*(x5)+82358.63651384937"
512
 
513
 
514
 
515
 
516
  #2011
517
 
518
- #data collection
519
- data16=pd.read_excel("/content/ans15.xlsx")
520
- df16 = data16.drop([' YEAR '], axis=1)
521
-
522
-
523
 
524
- #data indexing
525
- x=df16.iloc[:,1:].values
526
- y=df16.iloc[:,0].values
527
- np.reshape(y,(-1,1))
528
 
529
- #split the dataset
530
- from sklearn.model_selection import train_test_split
531
- X_train, X_test, y_train, y_test = train_test_split(
532
  x, y, test_size=0.33, random_state=42)
533
 
534
 
535
- #traing the dataset
536
- from sklearn.linear_model import LinearRegression
537
-
538
- reg = LinearRegression().fit(X_train, y_train)
539
-
540
-
541
- y_pred16=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
542
-
543
-
544
-
545
-
546
 
547
- #Equation
548
- total16="36.2551509 *(x1)+-21.16118114*(x2)+372.06856269*(x3)+(-59.04384028)*(x4)+(-49.61395171)*(x5)+18259.681897588325"
549
 
550
 
551
 
552
 
553
  #2012
554
-
555
- #data collection
556
- data17=pd.read_excel("/content/ans16.xlsx")
557
  df17 = data17.drop([' YEAR '], axis=1)
 
 
 
 
 
558
 
559
-
560
-
561
- #data indexing
562
- x=df17.iloc[:,1:].values
563
- y=df17.iloc[:,0].values
564
- np.reshape(y,(-1,1))
565
-
566
- #split the dataset
567
- from sklearn.model_selection import train_test_split
568
- X_train, X_test, y_train, y_test = train_test_split(
569
  x, y, test_size=0.33, random_state=42)
570
 
571
 
572
- #traing the dataset
573
- from sklearn.linear_model import LinearRegression
574
-
575
- reg = LinearRegression().fit(X_train, y_train)
576
-
577
-
578
- y_pred17=reg.predict([[co2_emission,No2_emission,so2_emission,Global_Warming,Methane_emission]])
579
-
580
-
581
 
582
-
583
 
584
- #Equation
585
- total17="76.15862868 *(x1)+24.66304806*(x2)+(-31.1753211)*(x3)+(-281.13550722 )*(x4)+48.76763872*(x5)-27641.15357666507"
586
 
587
 
588
 
589
  #2013
590
 
591
- #data collection
592
- data18=pd.read_excel("/content/ans17.xlsx")
593
- df18 = data18.drop([' YEAR '], axis=1)
594
 
595
 
596
 
597
- #data indexing
598
- x=df18.iloc[:,1:].values
599
- y=df18.iloc[:,0].values
600
- np.reshape(y,(-1,1))
601
 
602
- #split the dataset
603
- from sklearn.model_selection import train_test_split
604
- X_train, X_test, y_train, y_test = train_test_split(
605
  x, y, test_size=0.33, random_state=42)
606
 
607
 
 
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