Linear regression, inferring parameters from data

Sounds like a 2-step process (at least). For the “dividing” part, I might suggest checking out this notebook.