In this challenge, we practice using multiple linear regression. Check out the Tutorial tab for learning materials!
Andrea has a simple equation:
for real constants (, , , , ). We can say that the value of depends on features. Andrea studies this equation for different feature sets and records each respective value of . If she has new feature sets, can you help Andrea find the value of for each of the sets?
Note: You are not expected to account for bias and variance trade-offs.
The first line contains space-separated integers, (the number of observed features) and (the number of feature sets Andrea studied), respectively.
Each of the subsequent lines contain space-separated decimals; the first elements are features , and the last element is the value of for the line's feature set.
The next line contains a single integer, , denoting the number of feature sets Andrea wants to query for.
Each of the subsequent lines contains space-separated decimals describing the feature sets.
For each feature set in one test case, we will compute the following:
. We will permit up to a margin of error.
The normalized score for each test case will be: . If the challenge is worth points, then your score will be .
For each of the feature sets, print the value of on a new line (i.e., you must print a total of lines).