Skip to content

Commit

Permalink
Its V3 actually, Updated Data Points... Better Data..
Browse files Browse the repository at this point in the history
Code Updated,
Better Model,
Implemeted Using Random Forest Model Highest accuracy...
Traing took more than 1hr
  • Loading branch information
805karansaini committed Oct 7, 2022
1 parent 70619f3 commit d32dc7f
Show file tree
Hide file tree
Showing 258 changed files with 36,685 additions and 57,151 deletions.
35 changes: 13 additions & 22 deletions AQI.py → AQI_Ploter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,28 @@
# generic doesnot work
# feture_extraction_combine.pt line 70: getattribuute error
def avg_data(year):
temp_i=0
average=[]
location = "Data/air_quality_data/air_quality_data" + str(year) + ".csv"
for rows in pd.read_csv(location,chunksize=24):
add_var=0
df = pd.read_csv(location)
for val in df['pm25']:
avg=0.0
data=[]
df=pd.DataFrame(data=rows)
for index,row in df.iterrows():
data.append(row['PM2.5'])
for i in data:
if type(i) is float or type(i) is int:
add_var=add_var+i
elif type(i) is str:
if i!='NoData' and i!='PwrFail' and i!='---' and i!='InVld':
temp=float(i)
add_var=add_var+temp
avg=add_var/24
temp_i=temp_i+1

if type(val) is float or type(val) is int:
avg = avg + val
elif type(val) is str:
if val!='' and val!='NoData' and val!='PwrFail' and val!='---' and val!='InVld':
temp=float(val)
avg = avg + temp
average.append(avg)
return average


if __name__=="__main__":
year_days = {2013:365, 2014:364, 2015:365}
for year in range(2013,2016):
year_days = { 2014 : 365, 2015 : 365, 2016 : 366, 2017 : 365, 2018 : 365, 2019 : 365, 2020 : 366, 2021 : 365, 2022 : 273 }
for year in range(2014,2017):
plot_year = avg_data(year)
lable_data = str(year) + " data"
plt.plot(range(0,year_days[year]),plot_year,label=lable_data)
plt.xlabel('Day')
plt.ylabel('PM 2.5')
plt.legend(loc='upper right')
plt.xlabel('Day')
plt.ylabel('PM 2.5')
plt.legend(loc='upper right')
plt.show()
Loading

0 comments on commit d32dc7f

Please sign in to comment.