Question: #Train/test split 80% train, 20% test X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) #Build a decision tree model dt = DecisionTreeClassifier(random_state=1) #Fit the tree

#Train/test split 80% train, 20% test X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2) #Build a decision tree model dt = DecisionTreeClassifier(random_state=1) #Fit the tree using X_train and y_train dt.fit(X_train, y_train) #Plot the decision tree

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