Page 81 - Data Science Algorithms in a Week
P. 81

Decision Trees


                    └── [Wind=Breeze]
                        └── [Play=Yes]

            Classification:
            Now that we have constructed the decision tree, we would like to use it to classify a data
            sample (warm,strong,sunny,?) into one of the two classes in the set {no,yes}.

            We start at the root. What value does the attribute temperature have in that instance?
            Warm, so we go to the middle branch. What value does the attribute wind have in that
            instance? Strong, so the instance would fall into the class no since we have arrived already
            in the leaf node.

            So, our friend would not want to play chess with us in the park according to the decision
            tree classification algorithm. Please note that the Naive Bayes' algorithm stated otherwise.
            An understanding of the problem is required to choose the best possible method. At other
            times, a method with a greater accuracy is the one that takes into consideration results of
            several algorithms or several classifiers, as in the case of random forest algorithm in the next
            chapter.



            Going shopping - dealing with data

            inconsistency

            We have the following data about the shopping preferences of our friend, Jane:

             Temperature Rain     Shopping

             Cold          None   Yes
             Warm          None   No
             Cold          Strong Yes

             Cold          None   No
             Warm          Strong No

             Warm          None   Yes
             Cold          None   ?








                                                     [ 69 ]
   76   77   78   79   80   81   82   83   84   85   86