Question: 3. Using the linear regression function in NumPy (see page 66 of the ML book) to solve the following problem. You should submit your code


3. Using the linear regression function in NumPy (see page 66 of the ML book) to solve the following problem. You should submit your code in a notebook file through canvas, which should include the implementation and the input data as well as a short discussion about your result. The table below lists the top ten colleges based on mid-career salary and the associated yearly tuition costs. Use the data to check if the higher cost of tuition translate into higher-paying jobs. School Mid-Career Salary (in thousands) Yearly Tuition Princeton 137 28,540 Harvey Mudd 135 40,133 CalTech 127 39,900 US Naval Academy 122 0 West Point 120 0 MIT 118 42,050 Lehigh University 118 43,220 NYU-Poly 117 39,565 Babson College 117 40,400 Stanford 114 54,506 = def linreg(inputs,targets): inputs np.concatenate((inputs,-np.ones((np.shape(inputs)[0],1))),2 axis=1) beta = np.dot(np.dot(np.linalg.inv(np.dot(np.transpose(inputs),2 inputs)),np.transpose(inputs)), targets) outputs np.dot (inputs,beta) 3. Using the linear regression function in NumPy (see page 66 of the ML book) to solve the following problem. You should submit your code in a notebook file through canvas, which should include the implementation and the input data as well as a short discussion about your result. The table below lists the top ten colleges based on mid-career salary and the associated yearly tuition costs. Use the data to check if the higher cost of tuition translate into higher-paying jobs. School Mid-Career Salary (in thousands) Yearly Tuition Princeton 137 28,540 Harvey Mudd 135 40,133 CalTech 127 39,900 US Naval Academy 122 0 West Point 120 0 MIT 118 42,050 Lehigh University 118 43,220 NYU-Poly 117 39,565 Babson College 117 40,400 Stanford 114 54,506 = def linreg(inputs,targets): inputs np.concatenate((inputs,-np.ones((np.shape(inputs)[0],1))),2 axis=1) beta = np.dot(np.dot(np.linalg.inv(np.dot(np.transpose(inputs),2 inputs)),np.transpose(inputs)), targets) outputs np.dot (inputs,beta)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
