reset password
Author Message
msargent
Posts: 519
Posted 17:41 Feb 13, 2016 |

Updated:

I felt your pain, people. I did HW3 today. I do not vouch for these results absolutely (you can look at what I did tomorrow and compare notes). I used no loops in the cost function and gradient; I multiplied matrices instead (you can use loops if you want to, but don't use a loop to calculate h_theta(x) --- use a dot product). 

Columns I used: Smog Rating, Greenhouse Gas Score, DisplMunged, CylMunged, TransNumber, DriveNumber, FuelNumber, ClassNumber, SmartNumber, Mpg (combined)

I performed feature scaling and mean normalization as described by Ng and given in lecture.

Cost before training thetas: 

866.57590361445796

Cost after training:

28.503855265508022

My learning curve:

 

Last edited by msargent at 20:04 Feb 13, 2016.
skim144
Posts: 63
Posted 18:24 Feb 13, 2016 |

That's a very small value. Did you happen to scale y?

Here is mine.

rkmx52
Posts: 23
Posted 18:46 Feb 13, 2016 |

My cost before training thetas was about 866.

Last edited by rkmx52 at 18:53 Feb 13, 2016.
msargent
Posts: 519
Posted 19:22 Feb 13, 2016 |
You are not supposed to scale y.
skim144
Posts: 63
Posted 19:31 Feb 13, 2016 |

I didn't. I was just asking if you did, because I also got 0.01 - 0.001 range for cost too, when I scaled y.

msargent wrote:
You are not supposed to scale y.

 

Last edited by skim144 at 19:34 Feb 13, 2016.
msargent
Posts: 519
Posted 19:47 Feb 13, 2016 |
skim144 wrote:

I didn't. I was just asking if you did, because I also got 0.01 - 0.001 range for cost too, when I scaled y.

msargent wrote:
You are not supposed to scale y.

 

Let me check.

msargent
Posts: 519
Posted 19:48 Feb 13, 2016 |

You are right, I did. A Plato dollar for you. See updated post for new values. 

Last edited by msargent at 20:06 Feb 13, 2016.
skim144
Posts: 63
Posted 20:52 Feb 13, 2016 |

Thank you! 

msargent wrote:

You are right, I did. A Plato dollar for you. See updated post for new values.