Skip to content

johnstonskj/rml-decisiontrees

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Racket Machine Learning - Decision Trees

GitHub release Travis Status Coverage Status raco pkg install rml-core Documentation GitHub stars MIT License

This Package is part of a set of packages implementing machine learning capabilities for Racket. This particular package implements support for classification of individuals using decision trees.

Modules

  • Support for classifying an individual against a known tree.

Examples

(require rml/individual
         rml-decision-trees)

(define test-tree
 (make-decision-tree
   (make-decision
    "size"
    (list [cons (curryr < 5) (make-terminal 'small)]
          [cons (curryr > 10) (make-terminal 'large)])
    #:else (make-decision
            "color"
            (list [cons (curry string=? "black") (make-terminal 'cocktail)])
                  #:else (make-terminal 'medium)))))

(define test-individual (make-hash (list (cons "size" 3) (cons "color" "black"))))

(tree-classify test-tree test-individual)

Racket Langaueg