Training our model
Next, we are going to actually train, or fit, our linear regression model. If you remember, this just means that we are finding the slope (m) and intercept (b) for the line that minimizes the sum of the squared errors. To perform this training, we will use a really great package from Sajari: github.com/sajari/regression. Sajari is a web search company that relies heavily on Go and machine learning, and they use github.com/sajari/regression in production.
To train a regression model using github.com/sajari/regression, we need to initialize a regression.Regression value, set a couple of labels, and fill the regression.Regression value with labeled training data points. After this, training our linear regression model is as ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access