ListModel.fit method has an option for fitting the continuum in each step.