@akki wrote:
Hey Authors,
I am getting an error while executing the LogisticRegression classifier. Please help. I have attached the code and error.> #Logistic Regression
outcome_var = 'Loan_Status' model = LogisticRegression() predictor_var = ['Credit_History'] classification_model(model, train, predictor_var, outcome_var)
The part of error is follows:
> TypeError Traceback (most recent call last)<ipython-input-273-bb7bf01a98a4> in <module>() 3 model = LogisticRegression() 4 predictor_var = ['Credit_History'] ----> 5 classification_model(model, train, predictor_var, outcome_var) <ipython-input-272-4e3d579b0cea> in classification_model(model, data, predictors, outcome) 21 model.fit(train_predictors, train_target) 22 ---> 23 error.append(model.score(data[predictors].iloc[test,:],data[outcome].iloc[test1])) 24 25
It seems the error is in the line where we append the error values to error list.
Posts: 1
Participants: 1