Question: I'm trying to implement the Decision Tree Machine Learning Algoin Python but keep on getting this error. How Do I fix this error in Python?

I'm trying to implement the Decision Tree Machine Learning Algoin 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 # Import

#DECISION TREE import pandas as pd from sklearn.tree import DecisionTreeClassifier # Import Decision Tree Classifier from sklearn.model_selection import train_test_split # Import train_test_split function from sklearn import metrics #Import scikit-learn metrics module for accuracy calculation clf = DecisionTree Classifier() # Train Decision Tree Classifer clf = clf.fit(x train, y train) #Predict the response for test dataset y_pred = clf.predict(X_test) Traceback (most recent call last) ValueError in () 9 10 # Train Decision Tree Classifer ---> 11 clf = clf.fit(x_train, y_train) 12 13 #Predict the response for test dataset 2 frames /usr/local/lib/python3.7/dist-packages/sklearn/utils/multiclass.py in check_classification_targets(y) 195 196 ]: --> 197 198 199 "multilabel-sequences", raise ValueError("Unknown label type: %r" % y_type) ValueError: Unknown label type: 'continuous'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!