Path: blob/master/ML/Notebook/Random Forest Continuous data.ipynb
3087 views
Kernel: Python 3
Problem :The problem we will tackle is predicting the max temperature for next day in a city using one year of past weather data.
In [1]:
Out[1]:
In [2]:
Out[2]:
The shape of our features is: (348, 12)
In [3]:
Out[3]:
There are not any data points that immediately appear as anomalous and no zeros in any of the measurement columns.
In [4]:
Out[4]:
In [5]:
In [6]:
In [7]:
Out[7]:
Training Features Shape: (261, 17)
Training Labels Shape: (261,)
Testing Features Shape: (87, 17)
Testing Labels Shape: (87,)
In [8]:
Out[8]:
Average baseline error: 5.06
In [9]:
In [10]:
Out[10]:
Mean Absolute Error: 3.87 degrees
In [11]:
Out[11]:
Accuracy: 93.93 %.
In [12]:
Out[12]:
Variable: temp_1 Importance: 0.66
Variable: average Importance: 0.15
Variable: forecast_noaa Importance: 0.05
Variable: forecast_acc Importance: 0.03
Variable: day Importance: 0.02
Variable: temp_2 Importance: 0.02
Variable: forecast_under Importance: 0.02
Variable: friend Importance: 0.02
Variable: month Importance: 0.01
Variable: year Importance: 0.0
Variable: week_Fri Importance: 0.0
Variable: week_Mon Importance: 0.0
Variable: week_Sat Importance: 0.0
Variable: week_Sun Importance: 0.0
Variable: week_Thurs Importance: 0.0
Variable: week_Tues Importance: 0.0
Variable: week_Wed Importance: 0.0
In [13]:
Out[13]:
In [ ]: