I'm trying to implement the Decision Tree Machine Learning Algorithm in Python but keep on getting this error. How do I fix this error in Python?
# DECISION TREE
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn import metrics
clf = DecisionTreeClassifier()
# Train Decision Tree classifier
clf.fit(x_train, y_train)
# Predict the response for the test dataset
y_pred = clf.predict(x_test)
ValueError Traceback (most recent call last) <ipython-input-240-dc549570do86> in <module>
9
1o # Train Decision Tree classifier > 11 clf = clf.fit(x_train, y_train) 12
13 # Predict the response for the test dataset
2 frames
/usr/local/lib/python3.7/dist-packages/sklearn/utils/multiclass.py in check_classification_targets(y) 195 "multilabel-sequences", 196 1: --> 197 raise ValueError("Unknown label type: %r" % y_type) 198 199
ValueError: Unknown label type: 'continuous