Further understand of linear regression and stochastic gradient descent.
Conduct some experiments under small scale dataset.
Realize the process of optimization and adjusting parameters.
Dataset
Linear Regression uses Housing in LIBSVM Data, including 506 samples and each sample has 13 features. You are expected to download scaled edition. After downloading, you are supposed to divide it into training set, validation set.
Load the experiment data. You can use load_svmlight_file function in sklearn library.
Devide dataset. You should divide dataset into training set and validation set using train_test_split function. Test set is not required in this experiment.
Initialize linear model parameters. You can choose to set all parameter into zero, initialize it randomly or with normal distribution.
Choose loss function and derivation: Find more detail in slides.
Calculate gradient toward loss function from each sample.
enote the opposite direction of gradient as .
Update model: , where is learning rate, a hyper-parameter that we can adjust.
Get the loss under the training set and by validating under validation set.
Repeate step 5 to 8 for several times, get the value of as well as .
Finishing experiment report according to experiment result: The template of report can be found in here
Submission
Requirement for Submission
You only have to submit the experiment report. The experiment codes is not necessary for the submission.
The submission of experiment report should be in PDF format(The template of report may be not very fit for the experiments, please revise it by yourself)
please send all experiment reports to teaching assistant (jiaju.wu@qq.com, the email name should contain your name and your student number)
Deadline
24:00 on Jan. 7th, 2021,please send all experiment reports to teaching assistant (jiaju.wu@qq.com) before deadline.
P.S.
The reports can be written in Chinese or English, in LaTeX or Word(If you write reports in Word, you need to export them to PDF format.)