/Binary_decision_tree

Make binary decision tree. Branching criteria - tree depth. Make split using Gini formula. Also make random forest.

Primary LanguagePython

                    -> class : 0
                -> 18
                    -> class : 1
            -> 18
                -> 0
        -> 18
            -> 0
    -> 18
        -> 0
-> 49
                    -> class : 0
                -> 2
                    -> class : 1
            -> 6
                    -> class : 0
                -> 4
                    -> class : 0
        -> 21
                    -> class : 1
                -> 8
                    -> class : 0
            -> 15
                    -> class : 1
                -> 7
                    -> class : 0
    -> 31
                    -> class : 0
                -> 4
                    -> class : 1
            -> 4
                -> 0
        -> 10
                    -> class : 0
                -> 2
                    -> class : 1
            -> 6
                    -> class : 0
                -> 4
                    -> class : 0

-> 60 -> class : 1 -> 4 -> class : 1 -> 4 -> 0 -> 4 -> 0 -> 9 -> class : 1 -> 1 -> class : 1 -> 1 -> 0 -> 5 -> class : 1 -> 4 -> class : 1 -> 4 -> 0 -> 11 -> class : 0 -> 2 -> class : 1 -> 2 -> 0 -> 2 -> 0 -> 2 -> 0 Tree overfitted and remember all train selection Accuracy at tree with depth = 7: 0.9666666666666667 Make new tree using all train selection: Accuracy: 0.6875 Create random forest for binary classification. Forest accuracy: 0.734375 Try this method on other dataset Accuracy: 0.9883381924198251 Create random forest for binary classification. Forest accuracy: 0.9883381924198251

Process finished with exit code 0