Problem B
Linear Regression
Implement simple linear regression in
In other words, choose the values
Input
Input for your submission is a training set of
The first line contains two integers
It is guaranteed that no feature is constant and each pair
of features is not collinear. Specifically, let
(no feature is constant), and also that for any pair of
features
(no pair of features is collinear).
Output
Implement an algorithm to create a linear model that fits the training data. Recommended approaches are gradient descent, least-squares estimation using the Moore-Penrose pseudoinverse, or ridge regression.
Output
Note that the sample output shown is actually the test data on which a model would be evaluated (see below). It is in the same format as the input. A reasonable output for the given sample input might be:
8.60271 1.19910
which would give a score of about
Scoring
For each test file, the output of your submission will be used to construct a linear model to evaluate on another set of data, called the testing set. The test set comes from a distribution similar to the training set, but is not known to your submission.
Assume that the test data has
where
The overall score for your submission is the average score over all hidden test files. The sample data is excluded from this average.
Sample Input 1 | Sample Output 1 |
---|---|
5 1 1 10 2 11 3 12 4 13 5 15 |
5 1 0 9.5 2 10 6 16.5 7 17.5 8 18 |