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
  • 15,634
  • 17
  • 33
  • 53
Kirsten
  • 12,891
  • 31
  • 150
  • 276

1 Answers1

1

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

Dean MacGregor
  • 7,861
  • 7
  • 32
  • 61