Message-ID: <3ce5adb7-b099-4398-9b65-8477727bde35@w19g2000yqk.googlegroups.com>
Date: 2009-11-18T22:06:31Z
From: John
Subject: GLM: Classification problem. Help!
Hello,
I need help with this. Let's say that I have n features that I want to
use to predict which class an observation belongs to. Using training
data I try to do the following:
> training$result <- as.factor(training$result)
> model <- glm(result ~., family=binomial("logit"), data = training)
However, when I run the model on my test data I receive predictions
that have continuous values. I.e. if I have the classes 0 and 1 in
"results" I get predictions of 0.234235 and so on.
How do I force the output to be just 0 or 1? What am I missing?
Thanks!
John