O'Reilly logo

Python Machine Learning - Second Edition by Vahid Mirjalili, Sebastian Raschka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a regression model

Since we've explored placeholders and variables, let's build an example model for regression analysis, similar to the one we created in Chapter 13, Parallelizing Neural Network Training with TensorFlow, where our goal is to implement a linear regression model: Building a regression model.

In this model, w and b are the two parameters of this simple regression model that need to be defined as variables. Note that x is the input to the model, which we can define as a placeholder. Furthermore, recall that for training this model, we need to formulate a cost function. Here, we use the Mean Squared Error (MSE) cost function that we defined in Chapter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required