Decision Tree Exp 5 DWM
Decision Tree Exp 5 DWM
1 #replacing the categories of target variable with the actual names of the species 23.target = np.unique(iris.target)
2 target = np.unique(iris.target)
3 target_n = np.unique(iris.target_names)
4 target_dict = dict(zip(target, target_n))
5 data['Species'] = data['Species'].replace(target_dict)
▾ DecisionTreeClassifier
DecisionTreeClassifier(max_depth=3, random_state=93)
https://colab.research.google.com/drive/1Hf0408-6iqvmzvC8D56OUapKts0UudKa#scrollTo=CyQ3zvPSE2j-&printMode=true 1/2
08/09/2023, 10:19 Decision tree exp 5 DWM - Colaboratory
https://colab.research.google.com/drive/1Hf0408-6iqvmzvC8D56OUapKts0UudKa#scrollTo=CyQ3zvPSE2j-&printMode=true 2/2