Question: This is a linear programming question: For the purpose of that exercise, the dataset (data.txt) contains N = 10,000 rows and 11 columns. The first

This is a linear programming question:

For the purpose of that exercise, the dataset ("data.txt") contains N = 10,000 rows and 11 columns. The first column in every row i gives the label (yi), and the remaining 10 columns forms the vector (xi) of features.

We are interested in predicting the dependent variable y using the following Linear Regression model

  • y* = wTx + b where x = (x1, x2, ..., x10) and y* is our estimate of the label

Question 1:

  • Our goal is to determine the values of the estimators of w and b that minimize the L-infinity norm of the residuals. In other words, you want to choose w , b that minimize the following objective function:

maxi[1,...,N]|yi(wxi+b)|

  • Formulate the problem as a Linear Program, implement it, and solve it with Gurobi. Return the optimal value of the maximum absolute residual, the optimal value of the intercept (b) and the vector (w).

Hint: Try adding variables and constraints to find an equivalent LP formulation that allows you to remove the absolutes values and the max function. For example z = |x| could be modeled by the following constraints: z >= x and z >= -x

  • For question 1, the "construct_lp_model" code has been provided to you below to construct the Gurobi model of a Linear Program in the following form:

maxcx

Subject to:

Axd

the data is large so I just give some data sample, some sample from Data.txt is given below:

36,5,8,-10,30,-17,-29,11,41,-42,-26 -4077,-3,0,-8,-37,30,-35,37,46,-7,-58 8176,0,-14,18,-25,-41,-33,-22,66,-34,56 2190,2,3,20,7,-43,-52,46,26,-38,1 -10938,4,-10,23,-14,40,-50,19,6,-29,-88 -856,2,9,-28,-8,-42,42,-19,-19,76,-35 5703,3,4,-25,-16,-35,-13,30,69,-47,16 6923,0,-9,3,7,14,37,-60,-62,72,94 -3628,7,-17,30,-30,22,13,20,48,-67,-31 -2882,-9,-11,-13,16,49,34,43,-17,-33,-13 8054,3,-16,-19,-3,41,23,-7,-13,16,92 12856,-10,-5,-30,5,-3,-42,-40,56,77,69 -9442,6,11,26,-14,11,13,-54,-5,15,-76 12577,-10,-20,-19,-37,-13,58,59,60,-44,91

Thank you! Please help!

Formulate the problem as a Linear Program, implement it, and solve it with Gurobi.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!