Giter Site home page Giter Site logo

electric_vehicle_detection's Introduction

Electric Vehicle Detection

Detecting the presence of an Electic Vehicle that is connected to the grid.

Project Summary

This project utilizes an open data set from GridCure. The intention of this project is the following:

  • Interesting aspects about this dataset
  • Identify which households own an Electric Vehicle(EV)
  • Determine the probability that an EV is charging at any given interval

Interesting aspects of the dataset

I am going to tackle this one first because it affected how I treated cleaning and ultimately how I trained my algorithms on it.

  1. Using findNaN function that I wrote, I discovered that there were four households that containted null data in the training set and two households in the test set. Given that these houses that had null data only comprimised less than 0.5% of the data I felt comfortable eliminating them from the datasets. It appears that these null values comprise an entire months worth of data. In all likely hood these occupants were either moving in or moving out their houses... thus this dataset only captured their first month or last month of electricity usage.
  2. Using the average usage of each household as a representation for the training set, it appears over the course of two weeks that each day there is spike in electricity. Graph below. alt tag

Filtering down into a single days worth of electicity usage, it becomes apparent that usage begins to ramp up in the early morning, remains steady throughout mid morning and early afternoon, peaks in the evening and then finally falls off precipitously right after peak usage. This makes intuitive sense, there is likely minimal electricity use when everyone in a house is asleep and usage will start to increase as people wake up and start to make breakfast,use the toaster, stove, etc... and electricity use will be at it's peak in the evening when everyone in the household is home and using all their computers, TV's,running the air conditioner, and charging their EV if they own one. Graph below. alt tag

Which houses own an EV?

Approximately 1/3 of the training set households owned an EV, or 485/1586 = 30.5% if you prefer decimals. The House ID can be found in the the pickled file 'Houses_that_own_ev.pkl' located in this repo's data_files folder. Or just go to the link below.

https://raw.githubusercontent.com/ajduncan3/Electric_Vehicle_Detection/master/data_files/Houses_that_own_ev.pkl

Now, over any one interval it appears that at most 16% of households have an EV plugged in and given that almost two sigmas worth of the households has their EV plugged in less than 10 % of the time... this problem appears to be a minority class detection problem. Very similar to a fraud detection problem, I needed to detect with high recall an occurrence that only happens a small percentage of the time. I used a variety a techniques ranging from using the synthetic minority oversampling technique(SMOTE) to a gradient boosted tree classifier. Yet no matter what technique or combination of techniques I still had a very low recall. That is not good to say the least. Enter Neural Networks and the Long Short Term Memory(LSTM) layer strucutre.

Determine the probability an EV is charging at a given interval

I did not have the answer if a EV was charging or not on the test data, given that it is test data. I surely could split up my training data though, for which I do know when EVs were charging or not. By treating this dataset as a time series and training an LSTM Neural Network on the train set, I was able to achieve a recall above 75% on some of the households in the training data. This result is far better than the less than 10% recall I was getting with other techniques.

Graph below:

  • Blue is training data and red is test data
  • As you can see the neural net captures the pattern including the spikes in usage very well

alt tag

Finally I trained my Neural Net on the average households usage over a 30 min interval. The probability that each a household in the test data owns an EV can be found in the pickled file found here.
https://github.com/ajduncan3/Electric_Vehicle_Detection/blob/master/data_files/predicted_kwh_probabilities.pkl

electric_vehicle_detection's People

Contributors

jimduncan avatar

Stargazers

 avatar

Watchers

James Cloos avatar  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.