![]() |
*ANSWER* questions w linear regression & weight decay
I have been running the weight decay examples Q2-6, but haven't seen any real improvement in the out-of-sample error compared to no regularization at all. Is that just a feature of this particular problem, or should I recheck my calculations?
Unfortunately (or not), the answers I've been getting do appear as options on the multiple choices. |
Re: *ANSWER* questions w linear regression & weight decay
|
Re: *ANSWER* questions w linear regression & weight decay
|
Re: *ANSWER* questions w linear regression & weight decay
As I suspected, all my answers on these were wrong. Does anyone have code (R if possible) to show, that I could use for comparison? I'm suspecting my problem was something dumb; even the original linear regression was wrong, and I compared that one with the same answer from the R lm() function.
I'm especially concerned since HW 7 uses all the same data again - so I really need to track this down. |
Re: *ANSWER* questions w linear regression & weight decay
Quote:
|
Re: *ANSWER* questions w linear regression & weight decay
Michael:
Here you go: Code:
#READ IN THE FILES. |
Re: *ANSWER* questions w linear regression & weight decay
Thanks!
Yes, Elroch, I used the full range of lambda. I think my mistake is elsewhere. |
Re: *ANSWER* questions w linear regression & weight decay
Quote:
ok, I'm going to expose most of my insult to the art of programming for these questions. Don't use it as a style guide (especially that nasty bit of unvectorised code. Also I suspect the as.matrix's may be superfluous.) The data format should be clear, I hope. Code:
WeightDecayLinearRegressionSolver <- function(inputs, outputs, lambda) { |
Re: *ANSWER* questions w linear regression & weight decay
I am really stuck starting with problem 2 on homework 6. I want to find out where I went wrong before I start on homework 7, since I got 3/10 on homework 6. Is there anybody here who reads Clojure who can tell me where I went wrong?
Code:
(ns hw6.core Many many thanks in advance to whomever can straighten me out!! |
All times are GMT -7. The time now is 01:10 PM. |
Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.