There are variables X_train, X_test, y_train, y_test created through sklearn train_test_split. They contain text data in string format. Convert them to float numbers.
def cond_to_float(X_train, X_test, y_train, y_test): y_train = y_train.astype(np.float) y_test = y_test.astype(np.float) X_train = X_train.astype(np.float) X_test = X_test.astype(np.float) return (X_train, X_test, y_train, y_test)