I’m trying to create a model to forecast demand/expenditure for an individual based on historical data of many individuals over time, but I’m having trouble finding examples of this.

To give a simple example of what I’m trying to do:

Let’s say there’s an ice-cream store that children in the surrounding area visit every week. We’ve got the history of all purchases at the store and details of who made the purchase, so we can track the purchase history of each individual. We also have details about each individual, e.g. age, gender, school, no. of siblings etc.

We can assume that a child will buy from the store once a week until they ‘leave’ for good and stop purchasing.

What I want to do is create purchase forecasts for each child over a few weeks. The bit I’m struggling with is where a new child, say Timmy, has only been purchasing for a few weeks and so doesn't have enough of a history to forecast based solely on his own data (but we do have his details).

My assumption is that demand can be better predicted by taking a child's details into account, so I'd like to find a group in the historical data that best represents Timmy, and leverage their data in some way when creating Timmy's forecast. Are there any standard methods/practices for this type of forecasting?

Any advice or guidance would be much appreciated.

  • $\begingroup$ It seems appropriate to match Timmy with the closest feature cluster and predict via that until you have enough data to change models. $\endgroup$
    – Dave
    Dec 1, 2015 at 21:47
  • $\begingroup$ Knn approaches seem worth a try, yes. $\endgroup$ Dec 2, 2015 at 7:28

1 Answer 1


I think you are doing a supervised classification problem. You have labelled data — previous customers, which you could label as different groups (e.g. high spend / low spend) along with predictors about the customer — their details (e.g. age).

You could think of each of these customer details representing dimensions on a plot, wth your task being to find out where different groups of customers are clustered along these dimensions. Once you know that you can predict what group a new customer will likely belong to, based on their details.

There are many methods for solving this sort of problem, including but not limited to support vector machines, gradient descent and nearest neighbour. Which one you choose will depend on the amount and sort of data you have. A really good guide if you are starting out is this flowchart in the SciKit learn documentation, which isn't exhaustive, but gives a useful overview.


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.