I'm trying to predict the % attendance of people to gym classes that have previously been booked. It is heavily dependent on the time of day and also a load of other features (is it raining, fraction of class that booked yesterday compared to a week ago, etc.). Random forest alone performs very poorly.

Instead, I tried to predict the difference from the mean for the hour of the day using random forest. Then I just add that on to the mean to recover the desired estimate.

This again performs worse than just the mean itself.

  1. Is this approach (predicting the difference from the mean) a bad idea?
    I can't find people using similar methods which makes me think it isn't a good idea.

  2. Is there a better algorithm suited to this task?

  • $\begingroup$ You added that your MAPE is ~60% but it is hard to judge that. Have you calculated the MAPE of simply using the average attendance as a predictor to have a baseline of quality? If the MAPE of your current model is the same/worse than the baseline you might have an issue of code error / wrong model / wrong parameters, etc. If it is already better however you just need to improve further by deploying parameter optimization, feature engineering, etc. $\endgroup$ – Fnguyen Apr 23 '20 at 12:21

With random forest there is no need to modify your output variable (i.e difference from the mean) when performing a regression.

It may be that the features you have are not relevant, or that you don't have enough data. Also try different model parameterisations (num trees, num layers etc).

Try to do some feature engineering to create intelligent features that might help the classifier.

  • $\begingroup$ You mean i should just try to predict the attendance fraction? Rather than difference from the mean for that hour? Because if i do that i get poor accuracy (MAPE=~60%) . It seems to not handle the time series aspect very well. $\endgroup$ – user148980 Aug 26 '18 at 14:32
  • $\begingroup$ Please can you give a single example of the input vector, and a single example of the output you want. $\endgroup$ – Jinglesting Aug 26 '18 at 15:01
  • $\begingroup$ Yes, sorry. Input vector would be time and date of bookable slot, whether it is raining (1 or 0), percentage of attendees that booked today, percentage of attendees that booked a week ago, percentage that booked longer than a week ago. Then the target would be the percentage of people who attended out of the spaces that were booked. $\endgroup$ – user148980 Aug 26 '18 at 15:31
  • $\begingroup$ And the time and date would refer go up in hour slots. E.g 26/08/2018 1pm next slot would be 26/08/2018 2pm. Ive split this into hour of day and day of week $\endgroup$ – user148980 Aug 26 '18 at 15:46
  • $\begingroup$ Ok, are you including the date in the input, or only the day of week and hour? $\endgroup$ – Jinglesting Aug 26 '18 at 18:28

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.