I'm doing logistic regression on Boston data with a column high.medv (yes/no) which indicates if the median house pricing given by column medv is either more than 25 or not.
Below is my code for logistic regression.
train_boston_new = train_boston
train_boston_new$high.medv <- NA
train_boston_new$high.medv[train_boston_new$medv <= 25] <- "no"
train_boston_new$high.medv[train_boston_new$medv > 25] <- "yes"
head(train_boston_new)
train_boston_new.glm <- glm(high.medv ~ lstat, family = binomial,
data = train_boston_new)
Now I'm required to use the misclassification rate as the measure of error for the two cases:
using lstat as the predictor, and
using all predictors except high.medv and medv.
I read the ISL book by Hastie, Tibshirani and did search but not clear on what misclassification rate is and how it is calculated?
P^(yes>0.5|X
is very inadvisable to use. At least replace0.5
with the prior class probability. $\endgroup$