reset password
Author Message
wsakura
Posts: 64
Posted 05:56 Feb 13, 2015 |

I seem to be confused. When passing in the X values to the calculate_prediction function, should I be passing in each row of X (since the formula is x(i)) to the sigmoid formula. If so, when Theta is transposed and multiplied with X, this doesn't work mathematically. I get Theta as (1x2) and x_val as (4x1). I think I'm misunderstanding the formula.

htheta(x) = 1 / ( 1 + e^(-THETAT*x) )

 

msargent
Posts: 519
Posted 13:06 Feb 13, 2015 |

You have to change the number of thetas so that it matches the number of features you have, plus 1 for the y intercept.

Last edited by msargent at 13:11 Feb 13, 2015.
wsakura
Posts: 64
Posted 14:51 Feb 13, 2015 |

I'm just making sure, but X is the features we're importing and Y is our survived vector. Is this correct?

msargent
Posts: 519
Posted 15:51 Feb 13, 2015 |

That's right.

jpatel43
Posts: 11
Posted 15:09 Feb 19, 2015 |

Here in the formula , I'm getting 0.5 values for all the values of X. I'm taking THETA as np.zeros((3,1)) . How do I find theta values for this function.?

msargent
Posts: 519
Posted 15:13 Feb 19, 2015 |

What would Theta transpose X be if all the thetas are zero? What would g(z) have to be? 

Thetas for which function? You're supposed to run gradient descent to find the thetas for your model. 

 

Last edited by msargent at 15:15 Feb 19, 2015.