# How to best forecast simple binary data? [closed]

I have a set of timeseries binary (boolean) data, with intervals of 1 day. Each day can either be 1 or 0 (true/false). What is the best way to forecast the next day/week's data based on the data I already have?

• Do you just have the historic 1s and 0s? Or is there other information available? – Jan van der Vegt Apr 11 '16 at 7:26
• I have the historic 1s and 0s yes. – mkelley82 Apr 11 '16 at 18:09
• I also have their associated dates. – mkelley82 Apr 11 '16 at 19:35
• @Jan van der Vegt Any insight? – mkelley82 Apr 12 '16 at 2:53
• Are these things more/less likely to happen on weekend days? Or when the weather is hot? Are they getting more frequent or rarer? Do they happen in clusters or independent? These are all questions you need to ask of the data and of experts who know about the data before you can think about formulating a predictive model. – Spacedman Apr 12 '16 at 7:21

1. Do some feature engineering. As they told you in the comments, try to see if the event is more likely to happen during weekends or weekdays, during certain months, during a certain season or quarter, etc. To read some more on this topic.

https://machinelearningmastery.com/discover-feature-engineering-how-to-engineer-features-and-how-to-get-good-at-it/

2. Explore different machine learning models. I suggest to start with a Random Forest.

3. Check your model accuracy (confusion matrix).

4. Iterate. Try other features, other models...

Just to get you up and running, you can take a look at the Titanic dataset in Kaggle. It will help you understand a bit more of the problem you are trying to solve.

I would seriously consider using the bsts package (in R), with 'logistic' as the model family. That will give you a forecast of the probability of 1's and 0's, based on past trends or periodicities (depending on how you construct the model). You can also add covariates, i.e. other things that change in a way related to your 1/0 observations, to act as predictors.