Logistic regression example by hand. Thanks for looking at this, I've been tearing my hair out for a day or so now. I have done a multiple variable logistic regression in R, and obtained my coefficients. I am able to make predictions for the training data in R without problem. But now I would like to create a prediction model in Ruby (that was the original point of doing the regression) and I'm having some trouble. Basically, my equation is: But it always seems to either give 1.0 or 0.0! The output of predict() in R is generally something nice and soft like 0.5578460! I realize not everyone knows Ruby, but I'll include my code here for reference: Edit Thanks to everyone who helped out! Turns out I had done exp(coef(period_logit)) to get the coefficients instead of coef(period_logit)! It's good to understand what you type before you hit enter. closed as off-topic by Michael Chernick, Peter Flom ♦ Aug 14 at 13:46. This question appears to be off-topic. The users who voted to close gave this specific reason: "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – Michael Chernick, Peter Flom If this question can be reworded to fit the rules in the help center, please edit the question.
Комментариев нет:
Отправить комментарий