Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. from sklearn.datasets import load_iris
  2. import pandas as pd
  3. import numpy as np
  4. import operator
  5.  
  6. #load the dataset
  7. iris = load_iris()
  8. x=iris.data
  9. y=iris.target
  10. data=np.c_[x,y]
  11. class_name = {0.0: 'sesota', 1.0: 'versicolor', 2.0: 'virginica'}
  12.  
  13. #build the tree
  14. tree = build_tree(data)
  15.  
  16. #visualize our tree structure
  17. print_tree(tree)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement