Thought I would just post an update. I have been testing out the neural network cluster for a few months with the one set up and despite some promising initial readings, I was only getting around 80% accuracy. So I spent a few weeks running machine learning algorithms and parameters through an evolutionary algorithm and I am happy to say I am achieving a much higher accuracy score. Mostly reporting around 99.74% which is beyond my best expectations (humans are pretty hard to predict).
The newer algorithm is now much more flexible. Not only is it getting much higher results, but it is also a multi-classification algorithm. So instead of just knowing if something should be on or off, it can say what setting it should be set too - it even predicted the humidity for today (5% off but pretty damn close).
Additionally, I have re-written the historical/training data code so it can dynamically figure out what data you have and format it correctly - no more writing a custom SQL query for your house.
Lastly, the new algorithm is much much much faster. It can train 3 months of data and find a prediction in a few seconds. if you save the training run it will make a prediction within a few milliseconds.
As an example, this is the current prediction for the fan in the room I’m writing this from. As you can see the fan has 4 settings and it has accurately guessed what it should be (and is 99.096% sure):
Bedroom Fan:
LOW : 99.096%
MEDIUM : 0.702%
OFF : 0.202%
HIGH : 0.0%
Best Guess : LOW (99.096%)
Currently : LOW
Study Light:
OFF : 0.0%
ON : 100.0%
Best Guess : ON (100.0%)
Currently : ON
TV Source:
HDMI1 : 100.0%
TV : 0.0%
Best Guess : HDMI1 (100.0%)
Currently : HDMI1
It was actually pretty hard to find anything that was <100% or incorrect.
So, I am pretty confident in how things are now currently running and I am trying to clean up some of the code and writing some documentation so I can publish it on GitHub for other people to test out and improve on.
If you are interested in testing it out in the near future, here are some of the requirements:
- Code is written in python 2.7 and tested on a Linux operating system (can be run on the same machine as openhab or a different machine)
- It currently uses MySQL for historical/training data but it was fairly easy to modify this to use SQLite too. However, if you are not a developer I suggest setting up MySQL data now.
- Currently I have been running with approximately 3 months worth of training data. I suspect accuracy would be much lower with an only a few weeks worth of historical readings.
- Haven’t tested this on a raspberry pi yet. It will likely work fine, but not sure how fast it will be.
Can’t wait to share this with the rest of the OpenHab community. I’m really hoping that we can almost stop writing rules(or at least drastically reduce them) and get our houses to learn from us. I personally feel like this could be the future of home automation.