Suppose that you work for a well-known restaurant chain and your task was to build a linear regression model that would predict how much will a client tip the restaurant based on some information about their order.
You have successfully built a model. Here is the vector of the coefficients that you've obtained:
.
Tonight, three orders have been placed so far. Here is the data regarding these orders, written in a matrix form:
.
How much tips, according to your model, will the restaurant get from these three orders together?
You can use one of the online matrix calculators, for example https://matrixcalc.org, or your favorite programming language for matrix calculations.
Tip: Find and then sum all the elements of the vector.
The input as numpy arrays
w = np.array([-1.8, 2, -4, 0.2])
x = np.array([[1, 2, -3, 5], [1, 0.2, -3, 4], [1, 1, 0, 6]])