Apply model for each variable or leave them as factor? Imagine you want to predict ice-cream stock in your factory (by flavor). You have data like this:

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?

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.
