Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.datasets import load_iris
- import pandas as pd
- import numpy as np
- import operator
- #load the dataset
- iris = load_iris()
- x=iris.data
- y=iris.target
- data=np.c_[x,y]
- class_name = {0.0: 'sesota', 1.0: 'versicolor', 2.0: 'virginica'}
- #build the tree
- tree = build_tree(data)
- #visualize our tree structure
- print_tree(tree)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement