Question 31
In the given block of code, the Iris dataset having shape (150,4) has been loaded for model training. What do you think will be the output of the code given below?
from sklearn.datasets import load_irisfrom sklearn.tree import DecisionTreeClassifierfrom sklearn.model_selection import train_test_splitX,y = load_iris(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(max_features=2, max_depth = 6, min_samples_split = 2, min_samples_leaf = 3, random_state = 81 )
clf.fit(X_train, y_train)print(clf.n_features_in_)