python - % in pandas invalid literal for float(): -
i tried running random forest model on loan data set, loaded csv file pandas dataframe, , used variable loan_amnt
,int_rate
feature, loan_status_b
1
or 0
label.
my dataframe looks this:
traning_set = train[['loan_amnt','int_rate','loan_status_b']] features_train = array(traning_set[['loan_amnt','int_rate']]) labels_train = array(traning_set[['loan_status_b']])
i created test set in same way
#random forest sklearn.ensemble import randomforestclassifier clf = randomforestclassifier(n_estimators=10) clf = clf.fit(features_train, labels_train) pred = clf.predict(features_test) sklearn.metrics import accuracy_score print accuracy_score(labels_test, pred)
this produced valueerror: invalid literal float(): 19.20%
has encountered problem before or knows how fix it? thank you!
Comments
Post a Comment