3

Imagine you want to predict ice-cream stock in your factory (by flavor). You have data like this:

ice-cream stock

Which makes more sense / is better?

  • Make flavor a factor and train the whole dataset
  • Group by flavor and train each flavor independently

Is there any difference?

patagonicus
  • 2,540
AleG
  • 33

2 Answers2

2

In general this appears as an important issue in practical ML applications in business, i.e., monolithic model vs. per-factor model. If target variable's distribution changes significantly within factors, i.e., categories, then building per-factor models would be better.

patagonicus
  • 2,540
2

Yes, there is a difference between the two approaches. If you include the flavor as a factor and apply a model to the whole data set, you have a lot more data used in the estimation of each coefficient (e.g. for month and temperature, which I just assumed you wanted to include as explanatory variables) which can lead to lower standard errors. If the stock of each flavor is very different and depends differently on the other explanatory variables, applying the same model to all of them could give you bad predictors. The choice between the two approaches often also depends on the sample size, as you might not want to run separate models for all factors if you only have a few data points on each factor.

A way to figure out what is best for your data could be to run separate models and compare whether the coefficients differ a lot between the different models for each flavor and if they don't, one model for all flavors is advisable.