0

I am expecting to see labels output here but I see probabilities Why?

train <- read.csv("ClassTrain.csv")
glm.fit <- glm(Salary ~ .,data=train,family=binomial)
predict.label <- predict(glm.fit,train, type = 'response')
head(predict.label) 

The labels in the Salary column are True and False

I recall the code used to work. I have since upgraded to be running R version 3.6.1

Output

camille
  • 16,432
  • 18
  • 38
  • 60
Kirsten
  • 15,730
  • 41
  • 179
  • 318

1 Answers1

1

You can convert the probability response into a boolean with predict.label>0.5

Dean MacGregor
  • 11,847
  • 9
  • 34
  • 72