Advertisement
AndreiS

Untitled

Apr 2nd, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 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 y) (create-tree
  6. x
  7. (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))))
  8. class-attribute
  9. )))
  10. (Sieves examples
  11. (first (max-IG-atribute (gains examples attributes class-attribute) attributes (my-max (associate attributes (gains examples attributes class-attribute))) examples (first class-attribute)))
  12. (rest (max-IG-atribute (gains examples attributes class-attribute) attributes (my-max (associate attributes (gains examples attributes class-attribute))) examples (first class-attribute))))
  13. (rest (max-IG-atribute (gains examples attributes class-attribute) attributes (my-max (associate attributes (gains examples attributes class-attribute))) examples (first class-attribute)))
  14. ))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement