Getting ready

Linear regression can be represented as a set of matrix equations, say . Here, we are interested in solving the coefficients in matrix x. We have to be careful if our observation matrix (design matrix) A is not square. The solution to solving x can be expressed as . To show that this is indeed the case, we will generate two-dimensional data, solve it in TensorFlow, and plot the result.

Get TensorFlow Machine Learning Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.