We used sp_execute_external_script to build a model and generate some number of days worth of predictions. Now I’d like to break that up into two operations: training a model and generating predictions. The biggest reason I might want to do this is if model generation is very expensive relative to prediction generation. It’s obviously not very expensive to build a random number generator following a Poisson distribution, but imagine we had a complicated neural net that took hours or days to train—we’d want to use that model over and over, as long as the model came close enough to representing the underlying reality.
So now we’re going to create a model.
Click through to see a more complete example, something closer to production-ready.