Question 20
The following code produces an output of 0.9125. How is the output expected to change if we increase the max_depth value?:
from sklearn.datasets import load_winefrom sklearn.tree import DecisionTreeClassifierfrom sklearn.model_selection import train_test_splitX,y = load_wine(as_frame = True, return_X_y = True)
X_train,X_test,y_train,y_test = train_test_split(X, y, test_size = 0.10, random_state = 12)
clf = DecisionTreeClassifier(max_depth = 2, min_samples_split = 2, min_samples_leaf=3, random_state = 81)
clf.fit(X_train, y_train)print(clf.score(X_train, y_train))Output score is likely to increase.
Output score is likely to decrease.
Output score may increase or decrease.
Output score will remain the same.