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. 
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. 
Re: Homework#6 Q2
Thank you so much. This was very clear. I got the right answers. :)

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? 
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. 
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... :( 
Re: Homework#6 Q2
Quote:

Re: Homework#6 Q2
Quote:
It doesn't work for small sets of points, so I created a big set with 250 points, just as in the out.dta and, to my surprise... it works! The code had nothing wrong after all. Maybe there was some dirt undeleted variables, or maybe I am just stupid. Thanks kkkkk! :) 
Re: Homework#6 Q2
My first thought on reading this question, and "What values are closest" was how could two values be closest. When I found the answer, it was reasonably obvious, but there are some possible values where the first is closest for one answer, and the second for a different answer.
It could, instead, ask to round to two decimal places and then choose the appropriate answer. 
All times are GMT 7. The time now is 11:19 AM. 
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. AbuMostafa, Malik MagdonIsmail, and HsuanTien Lin, and participants in the Learning From Data MOOC by Yaser S. AbuMostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.