I have a data set like this. Here the first column is date, the second column is Temperature, third one is humidity, fourth and fifth column are two other boolean data. I have data of 6 years like this.


And the label (The variable I want to predict) for this data set is: (boolean)


Now I want to implement Machine Learning to predict from this data set for a future time frame. I have almost no knowledge on machine learning. I want to use python to do it. Which library or methodology will be best and easiest for this? And can I have a simple sample code?

  • $\begingroup$ Is the data periodic? $\endgroup$ – El Burro Apr 21 '17 at 12:32
  • $\begingroup$ Not always. But there is a pattern. $\endgroup$ – nsssayom Apr 21 '17 at 12:33

Your problem looks to me more like a classification problem than a time series problem. My suggestion: Split the date into several sub-variables (year, month, day, week-of-day (maybe). Then just use this and the other values as input for a classification algorithm. Ideally you try several. I can recommend sklearn for this (http://scikit-learn.org/stable/auto_examples/classification/plot_classifier_comparison.html)

One advice: Depending on the classification algorithm you need to first normalize your data. I find the following blog useful for entry-level problems (with code examples-- if you want to approach this from a time-series perspective he also talks about this) and documentation http://machinelearningmastery.com/blog/.

Hope that helps.

  • $\begingroup$ Okay! I am going to try this now... $\endgroup$ – nsssayom Apr 21 '17 at 12:44
  • $\begingroup$ It can be a bit overwhelming at the beginning - but this should be the right place if you run into more specific problems :). $\endgroup$ – El Burro Apr 21 '17 at 12:51

Welcome to the wonderful and sometimes intimidating world of machine learning! Building on El Burro's reply, I would start with a recurrent neural network, and put a logistic layer at the top.

Recurrent neural networks are times series models in machine learning. They take input (the value of a variable at each point in time), perform some transformations, and give an output (a class label, in your case, but they can also be used for sequence-to-sequence prediction).

One specifically relevant blog post for you might be sequence classification.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.