Logistic regression-sklearn

ipython
python
jupyter_notebook
sklearn

#1

what might be the problem with the following code

import sklearn.linear_model
predictors =[‘Credit_History’,‘Education’,‘Gender’]
x_train = train_modified[predictors].values
y_train = train_modified[‘Loan_Status’].values

error:
NameError Traceback (most recent call last)
in ()
5 predictors =[‘Credit_History’,‘Education’,‘Gender’]
6 # Converting predictors and outcome to numpy array
----> 7 x_train = train_modified[predictors].values
8 y_train = train_modified[‘Loan_Status’].values

NameError: name ‘train_modified’ is not defined


#2

@erigits you have to defined train_modified before using it. Can you please share your full code?
Regards,
Ankit Gupta