Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to check accuracy of Logistic Regression model

$
0
0

@j.akhil.j wrote:

After doing some feature engineering, i applied the LR model on my training set ( after removing the loan ID colum)

train=train[,c(-1)]
fit = glm(as.factor(Loan_Status) ~ ., data = train, family = binomial)

Now, i have the model, and I want to check its accuracy
So i created a duplicate training set, named it check, and applied the model on it

check=train
check$Loan_Status = 0
Prediction = predict(fit, check,type=“response”)

Now, there are some problems:

  1. the model doesnt get applied to check dataset. there are no errors, but the value of loan_status does not change
  2. how do i check accuracy? i wanted to use confusion matrix
    confusionMatrix(train$Loan_Status, check$Loan_Status)
    but i got an error: the data cannot have more levels than the reference

can anybody help me out?

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles