I have run a Logistics Regression model in my data set. Below is the code:
classifier=glm(formula = Attrition~.,family = binomial,data=hr_train)
prob_pred=predict(classifier,type = 'response',newdata = hr_test[-2])
y_pred = ifelse(prob_pred>0.5,1,0)
cm=table(hr_test[,2],y_pred)
Here in my LR model, i have taken cutoff value randomly. I want to know how to find the cutoff value , which can maximize the sensitivity and specificity.
I saw some posts regarding this, as i am new to R programming i am not able to apply in my model. Could anyone please help me.