[WEEK 3 — Wi-Fi Based Indoor Positioning]
Team Members: Burak Emre Ozer, Huzeyfe Kocabas
This is the third blog post of our Machine Learning Project about Wi-Fi Based Indoor Positioning System. This week we will explore the effects of the Random Forest algorithm.
Random Forest
Random Forest is a flexible, easy to use machine learning algorithm that produces, even without hyper-parameter tuning, a great result most of the time.
Random Forest model is an ensemble tree-based learning algorithm; that is the algorithms averages predictions over many individual trees
Prediction for a classification problem:
fˆ(x) = majority vote of all predicted classes over B trees
Prediction for a regression problem:
fˆ(x) = sum of all sub-tree predictions divided over B trees
“Random forest builds multiple decision trees and merges them together to get a more accurate and stable prediction.”
More detailed information can be found at the links below:
https://towardsdatascience.com/the-random-forest-algorithm-d457d499ffcd
Building Predictive Model
We use ensemble methods from the scikit-learn library to build a random forest classifier and random forest regressor and MinMaxScaler to normalize the data values.
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.preprocessing import MinMaxScaler
Then we create our model, fit the training dataset. Finally, we calculated the average error value: 15.5 meters as seen above the error value of each point on the graph.
We have shown each points’ actual position and predicted position in the graph to provide a more understandable and clear impact.
Although the results are not as good as we expected, we think it is good for the beginning. In the next weeks, we will try different approaches to improve the results. Peace out.