Question
Goal: In this assignment, we will experiment with three different algorithms to train a linear regression models: solving normal equations, batch gradient descent, stochastic gradient
Goal: In this assignment, we will experiment with three different algorithms to train a linear regression models: solving normal equations, batch gradient descent, stochastic gradient descent. Input Format: The datasets are given in tvs (tab-separated) format. The file format is:
- 1st row: the numer of data points N.
- 2nd row: the number of features D.
- 3rd row: the first column is the label, and following columns are feature names.
- N following rows: each has (D+1) columns where the the first column is the label and following D columns are features.
An example file can be found here. There are two dataset that we will work with in this assignment.
- data_10k_100.tsv: This dataset contains 10,000 points, each with 100 features.
- data_100k_300.tsv: This dataset contains 100,000 points, each with 300 features.
The dataset can be downloaded from here. Output Format: output must be given in tsv format, with (D+1) columns and two rows:
- The first row is the coefficient names of the linear regression model. The first D columns contain w1, w2 up to wD, where wi is the coefficient of the i-th feature. The bias term, named w0, is in the last column.
- The second row contains values corresponding to the coefficents of the regression model.
The sample output for the sample dataset above can be downloaded here. There are three questions in this assigment. The first and second question are worth 10 points each where the third question is worth 30 points, all of 50 points total. Question 2 (10 points): Implement the batch gradient descent algorithm, with T = 200 epochs, learning rate = 0.000001 (this is 10-6). For full score, your algorithm must run in less than 5 minutes on the dataset data_10k_100.tsv with loss value less than 270,000 (this is 27x104).
please get it here https://hunglvosu.github.io/res/pa2-data.zip
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started