GithubHelp home page GithubHelp logo

gustavomccoelho / predicting-house-eletric-consumption Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 80.84 MB

Predicting home appliances electric consumption by using data provided by a IoT system, applying data wrangling, feature engineering, normalization and different prediction models.

R 100.00%
iot appliance-level-consumption

predicting-house-eletric-consumption's Introduction

Predicting House Eletric Consumption

This is a IoT project focused on predicting home appliance eletric consumption. Data is provided by colecting the output of temperature and humidity sensors in a wireless networks, in addition to the weather forecast from a airport weather station. The data is stored every 10 minutes during 5 months. The train and test sets are randomly splitted from this dataset.

Scrip overview

The train and test data are loaded and the first action is to analyse the target variable histogram:

target_hist

As we can see, the distribution is close to a normal shape, but with a long tale, which indicated existance of outliers. This is confirmed by looking at the boxplot:

target_boxplot

The outliers are removed by keeping the dataset 97% quantile. The result is as follows:

target_hist_after target_boxplot_after

The nexty step is to verify the presence of NA values, which is none.

Next, we analyse the WeekStatus and Day_of_week variables. It's decided to not trust it's validity (i.e if they match with the date variable), and they are remade by using the date column as reference. In addition, we decide to add the hour variable, since it is reasonable to assume that the consumption has a high correlation to the hour of the day.

Here we can see the correlation matrix:

correlation

By using Ranger (Random Forest Model), we are able to collect the feature importance (Gini index):

importance

As we can see, the following variables are probably not helpfull to the model, and thus should be removed:

-WeekStatus -Day_of_week -rv1 -rv2

The data is scaled with zero mean and unitary standard deviaton, and is ready for the prediction models.

The following models were tested:

-Ranger (Random Forest) - R2: 0.57, RMSE: 42.06 -SVM - R2: 0.27, RMSE: 54.36 -Linear Regression - R2: 0.26, RMSE: 54.95

As we can see, Random Forest seem to be the best out of this options.

At least, cross validation is used in the Random Forest model, which didn't add any accuracy.

predicting-house-eletric-consumption's People

Contributors

gustavomccoelho avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.