
#1




Homework#6 Q2
hi everyone,
Can anyone please explain me how to transform the data using the nonlinear transformation is given by phi(x1, x2) = (1, x1, x2, x21, x22 , x1x2, x1 − x2, x1 + x2) I am just confused how to use that in my code. I mean for the new values which function to use for transformation? is it x1=x1^2 and x2=x^2 and so on or something else. I am sure i am missing a big concept here. Any help would be great. Thanks in advance. 
#2




Re: Homework#6 Q2
Quote:
But basically you have the right idea. You are given a data vector with two values. Create a larger data vector of 8 terms, seven of which are dependent on the original two values you are given. In the new vector the first three terms are 1, x1, x2. The remaining 5 terms are obtained by applying "transformations" to x1 and x2. For example, the sixth term is x1*x2. Then you do linear regression on the new x matrix you have built which is (for the given in.data) an 8x35 matrix. 35 data vectors, each with 8 terms as above. 
#3




Re: Homework#6 Q2
Thank you so much. This was very clear. I got the right answers.

#4




Re: Homework#6 Q2
I have a question on the Eout. Should we create a new z or should we use the given test set to compute Eout?
In time, I have used the formula: E_In_Sample = sum (sign (z*w)~= y)) / N is this ok for Eout too? 
#5




Re: Homework#6 Q2
Quote:
The formula for Ein and Eout has to be the same so that we can compare them, only the set of test points  in or out of sample, differs. 
#6




Re: Homework#6 Q2
Thanks kkkkk.
I did both cases, either generate new points and also used out.dta (no together, just for for comparison) and I'm using the same formula for E_in and E_out. My E_in is approx. 0.03, but I just can't get E_out to go near 0.08.... I'll check the code again, but it doesn't make sense, it's such a simple formula... 
Tags 
hw6 #2 
Thread Tools  
Display Modes  

