Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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?

image text in transcribed

#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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Design Operation And Evaluation Of Mobile Communications

Authors: Gavriel Salvendy ,June Wei

1st Edition

3030770249, 978-3030770242

More Books

Students also viewed these Programming questions

Question

6. Name and describe three order-picking systems.

Answered: 1 week ago

Question

1. What are four objectives of warehouse operation?

Answered: 1 week ago

Question

3. What are cube utilization and accessibility?

Answered: 1 week ago