Question 32
Consider the following block of code:
from sklearn.datasets import load_breast_cancerfrom sklearn.tree import DecisionTreeClassifierfrom sklearn.model_selection import train_test_splitX,y = load_breast_cancer(as_frame = True, return_X_y = True)X_train,X_test,y_train,y_test = train_test_split(X,y, test_size = 0.2, random_state = 1)clf = DecisionTreeClassifier(min_samples_split = 5, min_samples_leaf = 3, random_state = 5)clf.fit(X_train, y_train)print(clf.score(X_test, y_test))In which of the following scenarios, the split will NOT be made at node N?
Number of samples at node N = 10. If it is split, it will result in 2 nodes in the left child and 8 nodes in the right child.
Number of samples at node N = 6. If it is split, it will result in 3 nodes in the left child and 3 nodes in the right child.
Number of samples at node N = 12. If it is split, it will result in 5 nodes in the left child and 7 nodes in the right child.
Number of samples at node N = 4. If it is split, it will result in 3 nodes in the left child and 1 node in the right child.