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

Two different results on confusion matrix using random Forest on loan prediction data

$
0
0

@Surya1987 wrote:

n<-as.data.frame(a.out$imputations[[i]])
s<-randomForest(Loan_Status~Gender+Married+Dependents+Education+Self_Employed+Property_Area+ApplicantIncome+CoapplicantIncome+LoanAmount+Loan_Amount_Term+Credit_History,data=n)
print(s)
plot(s)
testPred <- predict(s, newdata = n)
table(testPred, n$Loan_Status)
}

print(s) gives following result.

Confusion matrix:
N Y class.error
N 71 77 0.52027027
Y 18 314 0.05421687

However table(testPred, n$Loan_Status) gives following result.

testPred N Y
N 1 87 0
Y 5 422
Why is there difference in result?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles