AndreiS

Untitled

Apr 2nd, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. (define create-tree
  2. (λ (examples attributes class-attribute)
  3. ;Prima oara, pe post de root inserez elementul cu IG-ul cel mai mare
  4. (list (first (max-IG-atribute (gains examples attributes class-attribute) attributes (my-max (associate attributes (gains examples attributes class-attribute))) examples (first class-attribute)))
  5. (map (lambda (x y) (append (list x) y))
  6.  
  7. (rest (max-IG-atribute (gains examples attributes class-attribute) attributes (my-max (associate attributes (gains examples attributes class-attribute))) examples (first class-attribute)))
  8.  
  9. (map (lambda (x) (create-tree
  10. x
  11. (rest-attributes attributes (first (max-IG-atribute (gains examples attributes class-attribute) attributes (my-max (associate attributes (gains examples attributes class-attribute))) examples (first class-attribute))))
  12. class-attribute
  13. ))
  14. (Sieves examples
  15. (first (max-IG-atribute (gains examples attributes class-attribute) attributes (my-max (associate attributes (gains examples attributes class-attribute))) examples (first class-attribute)))
  16. (rest (max-IG-atribute (gains examples attributes class-attribute) attributes (my-max (associate attributes (gains examples attributes class-attribute))) examples (first class-attribute))))
  17. ;(rest (max-IG-
Advertisement
Add Comment
Please, Sign In to add comment