@warrior wrote:
Hello all.
I ran the LabelEncoder code from the Tutorial along with
X_train = train_data.drop(‘Loan_Status’, axis=1)
y_train = train_data[‘Loan_Status’]
X_test = test_datafrom sklearn.tree import DecisionTreeClassifier
clf = DecisionTreeClassifier()
clf.fit(X_train, y_train)but when I run:
clf.predict(X_test)
I get ValueError:could not convert string to float: ‘Rural’ even though when I look at the dataframe the Property_Area variable was encoded.
Posts: 5
Participants: 2