What is Model Fitting ?

Model Fitting is running an algorithm to learn the relationship between predictors and outcome so that you can predict the future values of the outcome.
It proceeds in three steps:
First, you need a function that takes in a set of parameters and returns a predicted data set.
Second you need an ‘error function’ that provides a number representing the difference between your data and the model’s prediction for any given set of model parameters.
Third, you need to find the parameters that minimize this difference. Once you set things up properly, this third step is easy.