# Adaptive learning of user's IoT setting preferences

We are working on a project to Predict the settings of the IoT devices(fan/light/AC) the user is using, based on his: location, outside temperature, humidity, time of the day etc...

Training data is not available and the model should start building/adapting itself every time the user uses the IoT device, to predict his preferred settings in any new environment he goes. This model will be unique for each user. Possibly we can start off with a demo model but it should adapt itself as per each user's preferences.

Which (machine?)learning algorithm can be useful here? Any links to the same and some tips on implementation would be appreciated.

This sounds like a fun problem but it very open ended! I will provide some links from the Scikit-Learn User Guide. There are many more reading options, but the SKL Userguide has lots of examples and usually links to academic publications for more in-depth reading. Another great resource is: Introduction to Statistical Learning, and if you are good at math: Elements of Statistical Learning

Model Selection

The first big question is whether the settings you are trying to predict are ordinal values or continuous values? Continuous value will allow you to use regression methods, where as ordinal values will give you a choice between regression methods and classification schemes. I would suggest employing a couple of different models to start and then selecting the best one moving forward. Some possible candidates are:

1. Linear regression (with nonlinear features as appropriate) because linear models are usually insightful,
2. Support Vector Classification/Regression (SVC/SVR) as these are often very accurate classifiers. and either
3. Naive Bayes or Random Forests as these often give good results where other models fail.

Initial Training Data

You will need to prime your solution with some deterministic data or data from another dataset that you have adapted to fit your model. I suggest priming the system with common sense values and then employing some sort of algorithm to forget those values as the system becomes well-trained.

Moving Forward

You will have to decide whether each user's model will use other user's data or not. This is sometimes solved via clustering methods like k-means or DBSCAN), where by users are clustered into groups each cluster has a different model associated with it. I would suggest retraining (fitting) the model on regular time frames initially, and then investigating the possibility of moving to an online learning system.

I absolutely suggest using a well known library for your problem. Scikit-Learn is great for the reasons mentioned above and for prototyping, but doesn't scale particularly well. H20 and Mahout are high quality scalable libraries that I would recommend for a big data production system. Mahout in Action is a great book to learn from, also.

Hope this helps!

• Yeah, we are in a very initial phase of project so sorry for the very broad overview. We are also converting non-Iot devices to IoT along with user profiling. So these non-IoT devices will have ordinal values (sometimes probably on or off only) but the new actual IoT devices will run on continuous values. It will be a mix of both, probably thresholding continuous values can determine states for converted devices. Last section was an interesting look at the problem, but i am skeptical if we can determine that based on others preferences in same area/conditions. Thanks for the idea and links. Jul 30, 2015 at 4:10
• As a beginner, would you recommend me to use libraries directly or should I stick with naive but my own simple implementations which i understand thoroughly. Before your advice I had been working on simple online reinforcement learning for adaptive weight adjustment of features. And I did upvote, but stackexchange says it will accept my vote only after I have earned certain amount of 'reputation'. Jul 30, 2015 at 17:19
• As a learning tool, I think its really useful to code up your own implementation of the basics like (stochastic) gradient decent, linear regression, k-means, SVMs, decision trees. But you can probably do this as part of a MOOC separate from your actual work. I absolutely suggest using a well known library for your problem. Scikit-Learn is great for the reasons mentioned above and for prototyping, but doesn't scale particularly well. H20 and Mahout are high quality scalable libraries that I would recommend for a big data production system. Jul 30, 2015 at 17:26