# Prediction algorithm for traffic

I am working on making predictions about traffic trends in a big city. Traffic is very seasonnal, and depends on the time of the day (with peaks at 9am and 6pm), day of the week (Monday to Friday are alike compared to Sat and Sun), holidays (Xmas, school holidays etc). And I have 2 years (at hourly rate) of data.

I am using a RandomForestRegressor to make a prediction on the year to come. Is that a correct algorithm for this class of problem?

• Can you explain the data you have? The features and the labels. What kind of predictions you are interested in ? Apr 26, 2016 at 16:53
• I try to predict a debit, so a number of cars who pass by a certain street, every hour. I have 2 years of this value, and I try to predict the following year. The features that I have: - Calendar features: year, month, day, hour, day of the week, holiday, working day, school holiday. - Weather features: daily mean temperature, precipitation, wind. Basically I want to predict the patterns of the traffic for the next years. So I should see typical daily/weekly pattern, as well as specific patterns for holidays (which days can vary in the calendar), maybe detect a pattern with temperature... Apr 26, 2016 at 17:10
• @user2076688 Are you trying to predict a year forward what the traffic will be like? Or are you trying to predict a week in the future lets say? Predicting a full year into the future seems very hard and somewhat impossible due to the chaotic nature of your parameters (e.g. weather). I believe you should be able to predict a week or couple weeks forward in the future rather accurately. Apr 26, 2016 at 17:18
• @ArmenAghajanyan: I am trying to predict a year in the future. And I don't mind that I have some imprecision due to te chaotic nature of the weather: for example, I cannot say which day it is going to snow in advance, but I know that in the summer, the weather will be nice and people will stay out late, while in the winter the cold will make them come back home fast. Similarly to the fact that I cannot predict the exact temperature on the next July 15th, but I know July will be warm compared to January. Apr 26, 2016 at 17:50