matlab代写-DATA 603
时间:2021-11-16
MSML/DATA 603 Fall 2021 Project 1
Page 1 of 3


Working with peers is not allowed for the projects
Sorry. You need to work on your own for the project.

TASK:
You are required to use linear regression to predict the price of cars. Your training data is a CSV file called
CarPrice_Training.csv with the following headers for 11 columns:
Instance
Number
(discard)
Number
of doors
Wheel
base
Car
Width
Car
Height
Number
of
cylinders
Engine
size
Peak
RPM
City
miles
per
gallon
Highway
miles
per
gallon
Price

The first column is just the row number or number of each instance (you can discard it). The next 9 columns are
training features. The last column is the training price.
Reserve a subset of these training instances to test your data.
The rest should be used to train your linear regression machine learning algorithm. You should use the training
data to arrive to a MMSE weight vector, so we can use it to predict prices for the testing feature vectors.
Your report should include:
 Your decisions (learning rate, iteration threshold... what is it and what value you used, what proportion you
reserved as testing data versus training data, how you selected each subset, initial conditions for training
vector), and why you decided each one.
 If you used scaling and normalization
 Results: final weight 10x1 vector, number of iterations it took to converge, final cost
 Plot of cost with respect to iterations (it should be decreasing at every step)
 Testing results: average MSE cost when applying your final weight vector to your test data. So feed your
testing data (and prices) along with your last (and best) weight vector into your MSE cost function. Provide
this result in your report.
 Plot your testing data (horizontal axis should be index number, vertical axis should be true price as well as
your estimate of the price).
o So, if you reserved 70 instances as testing data (with indexes i=1:70),
= [
1 1
(1) ⋯
(1)
⋮ ⋮ ⋯ ⋮
1 1
(70) ⋯
(70)
]
o And the last weighting vector you converged to was
⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ = [
0


]
o Then, the 1x 70 vector of your prediction for the test data will be:
_⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ = ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗


= [⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗

(1)⃗⃗ ⃗⃗ ⃗⃗ ⃗ ⋯ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗

(70)⃗⃗ ⃗⃗ ⃗⃗ ⃗⃗ ⃗]
o The 1x70 vector of actual prices for your test data is
MSML/DATA 603 Fall 2021 Project 1
Page 2 of 3

= [1 ⋯70]
o To plot them together in Matlab:
plot(1:70, test_predictions,’b+’) %blue “+” for your predicted prices
hold on % don’t overwrite previous plot with next plot
plot(1:70, p,’ro’) %red “o” for actual prices
legend(‘predicted car prices’,’actual car prices’)
xlabel(‘test car index’)
ylabel(‘price [$]’)
title(‘Comparing Linear Regression Prices to Actual Prices on Test Data’)
 Fill in the green text in the template with background, introductions, and conclusions.

How to hand in your work:
(1) Please, use the template provided (Project_1_template.docx) to explain how your project works. Replace the
green text with the information requested. Note: Do not explain where you went wrong and tried to fix it, nor
that you got sick and had to do it on the last night. Imagine you are delivering this report to your manager, and
you just need to explain what method you used, how to run it, and the results you got. See the template for
guidelines. Once it’s done, save your template as a PDF file to include among your deliverables.

(2) Please, sign and scan the next page (UMD OSC’s Honor Pledge) and include it among your submission
files.

(3) Provide your scripts in individual working m files.

 Collect all your files into one ZIP file with the name Project1.zip

 Upload the ZIP file to the Canvas Assignment called Project 1. If Canvas is down, or if Canvas prevents you
from uploading your ZIP file, only then you may email your submission to the grader at this email address:
anakra@terpmail.umd.edu Note: your grader will check Canvas for submissions, and only view his email if
your submission is missing from Canvas.

When to hand in your work:
Due date: November 21, 2021
Due time: 9pm

Note: Late submissions will receive a reduced grade: 5% from the first half hour until the end of the day. Then,
afterwards 10% per day, cumulatively.

MSML/DATA 603 Fall 2021 Project 1
Page 3 of 3



Honor Pledge:
“I understand that all work handed in must be my own, individual work. I pledge on my honor that I have not
given or received any unauthorized assistance on this project.”


Student Signature: _______________________________________________________


Student Name: _______________________________________________________________


Student UID:________________










































































































Project1.zip

 Upload the ZIP file to the Canvas Assignment called Project 1. If Canvas is down, or if Canvas prevents you
from uploading your ZIP file, only then you may email your submission to the grader at this email address:
anakra@terpmail.umd.edu Note: your grader will check Canvas for submissions, and only view his email if
your submission is missing from Canvas.

When to hand in your work:
Due date: November 21, 2021
Due time: 9pm

Note: Late submissions will receive a reduced grade: 5% from the first half hour until the end of the day. Then,
afterwards 10% per day, cumulatively.

MSML/DATA 603 Fall 2021 Project 1
Page 3 of 3



Honor Pledge:
“I understand that all work handed in must be my own, individual work. I pledge on my honor that I have not
given or received any unauthorized assistance on this project.”


Student Signature: _______________________________________________________


Student Name: _______________________________________________________________


Student UID:________________

学霸联盟


essay、essay代写