Logistic regression in Loan Prediction



I am working on Logistic Regression to predict Loan prediction, kindly assists what I am missing

check the Ipynb: http://nbviewer.jupyter.org/github/erigits/LR/blob/master/LogistiRegression.ipynb


Hi @erigits,

The problem may be that you are trying to run a classification algorithm on categorical data. You should preprocess it before giving to the classifier. The easiest way is to convert them to numerical values. Refer this article to understand how to deal with categorical variables.


Hi erigits, I see a problem in your code:

Logistic_Regression_Model = graphlab.logistic_classifier.create(train_data, target = loans_data, validation_set=None)

What is your target? What should be the target?



i was trying the random forest model on the loan prediction dataset

i have some query can we mtry as 2 as it is showing me the optimal value of mtry ?

thanks in advance

aman kapoor


Thank you @jalFaizy


Thank you @r_achar, now I see my problem


@aman1391, I am trying baseline algorithm before I go to random forest,
but I think the best approach is to show your code, and I think forums comrades will assist you


I tired logistic regression but it gave me an accuracy of 77.8
so later on i decided to go with the random forest but in random forest i am unable to execute because of the error Dependents_3+ object not found

plus my approach is simple i combine the co applicant and applicant income change them into log . then with the loan amount i did the same and create the levels and treat the missing value , also did one hot encoding on the variable like Gender , Dependent and so on then i ran the prediction model

Basically i follow the post : Learn data science from scratch in R

Thanks in advance

Aman kapoor


Hi @aman1391,

Could you post you question as a new topic in the forums? Thanks


Hi, i want to find credit score for each users using logistic regression… even i’m using same dataset… could you please help me regarding this…?