<jupyter_start><jupyter_text>Decision Trees  Question 1 *Screenshot taken from [Coursera](https://www.coursera.org/learn/ml-classification/exam/c4ssq/decision-trees)* ** Answer**- We are picking feature x3, because it has the lowest classification error    - At row 3, x3 = 1, y = -1, only 1 error compare to other features.  Question 2 *Screenshot taken from [Coursera](https://www.coursera.org/learn/ml-classification/exam/c4ssq/decision-trees)* ** Answer **<jupyter_code>import graphlab
graphlab.canvas.set_target('ipynb')

x = graphlab.SFrame({'x1':[1,0,1,0],'x2':['1','1','0','0'],'x3':['1','0','1','1'],'y':['1','-1','-1','1']})
x
features = ['x1','x2','x3']
target = 'y'   

decision_tree_model = graphlab.decision_tree_classifier.create(x, validation_set=None,
                                target = target, features = features)<jupyter_output><empty_output><jupyter_text>- The best feature to split on first is x3- In this tree below you will see that starting from x3 = 1, the depth of the tree is 3.<jupyter_code>decision_tree_model.show()
decision_tree_model.show(view="Tree")<jupyter_output><empty_output><jupyter_text>Question 3 *Screenshot taken from [Coursera](https://www.coursera.org/learn/ml-classification/exam/c4ssq/decision-trees)*<jupyter_code># Accuracy 
print decision_tree_model.evaluate(x)['accuracy']<jupyter_output>1.0
StarcoderdataJupyterStructuredCleanDedup