# Accuracy improvement for logistic regression model

I have achieved 68% accuracy with my logistic regression model. I want to increase the accuracy of the model. How can I apply stepwise regression in this code and how beneficial it would be for my model? What changes shall I make in my code to get more accuracy with my data set. I have attached my dataset below. Following is my code:

library(dplyr)
train<- data1[1:116,]
VALUE<-as.numeric(rownames(train))
testset<- data1[1:116,]
mylogit <- glm(VALUE ~ POINT1 + POINT2 + POINT3 + POINT4 , data = data1, family ="binomial")
testset$predicted.value = predict(mylogit, newdata = testset, type="response") for (i in 1: nrow(testset)){ if(testset$predicted.value[i] <= 0.50)
testset$outcome[i] <- 0 else testset$outcome[i] <- 1
}
print(testset)
tab = table(testset$VALUE, testset$outcome) %>% as.matrix.data.frame()
accuracy = sum(diag(tab))/sum(tab)
print(accuracy)
print(tab)
table(testset$VALUE, testset$outcome) Following is my dataset: Link 1: http://www.filedropper.com/hj_2

Try:

mylogit <- glm(VALUE ~ POINT1 * POINT2 * POINT3 * POINT4, data = data1, family ="binomial")

• Thanks a lot. It works. What are you actually doing by multiplying the features? Is it an important step in telling us that combination of more polynomial values will increase the accuracy further? – Swordsman Feb 15 '17 at 9:45
• @ArindamMukherjee It means all the coefficients including the interaction terms. – HelloWorld Feb 15 '17 at 11:46
• Hi. Can you check the bottom-most part of this post. I have added my doubts there. Thanks :) – Swordsman Mar 1 '17 at 11:36
• @ArindamMukherjee My answer already includes all interactions (the * operators). The other answer is invalid because we're talking about logistic, no need to go to random-forest. Random forest will reduce your accuracy, not improve. – HelloWorld Mar 1 '17 at 11:38
• Okay. So what about a scenario in which I have a list of applications which should be getting classified as 1(important) in my testing set but is not doing so through the algorithm because the data doesnot back it up to get a 1(important) and it's probability is coming way beyond the threshold value. What should I do in such a situation to get it classified as 1(important)? – Swordsman Mar 1 '17 at 11:52

Try all possible combinations of interaction terms. Have you checked co-linearity of variables? Have you checked all variables interaction? Why do you stick to LR? Try Random Forest also. See what gives u best accuracy on k-fold validation.

• Based on my dataset, which algorithm should best work according to you? And for enhancing accuracy further, can you suggest anything? – Swordsman Feb 28 '17 at 16:32
• compare accuracy with Random Forest. – Arpit Sisodia Mar 1 '17 at 9:00
• Okay I ll check that. 1 more thing I want to add here about the present scenario : I have 8 applications in my training set which are being marked manually as important but I'm not able to get those apps under the Important bracket while testing because they are coming up with an importance probability of less than 40% based on the data we have gathered. – Swordsman Mar 1 '17 at 11:21
• I want the algorithm to fit all the cases of apps which are marked as important in my training set as important, to fall under the Important bracket only keeping in mind the fact that it will increase the number of apps under the Important bracket. But how will I put these 8 apps under Important list when the data is saying otherwise? – Swordsman Mar 1 '17 at 11:21
• Can you help in answering this? – Swordsman Mar 1 '17 at 11:23