Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. fun {BuildDecisionTree ListOfPerson}
  2.  
  3. local Tree MakeTree Question in
  4. fun {MakeTree ListQ LOPR BQ}
  5. BQ = {BestQ ListQ LOPR}
  6. if {Valeur BQ LOPR} < {Length LOPR} then leaf(LOPR true:leaf false:leaf)
  7. else question(BQ true:{MakeTree ListQ {ListOfPersonTrue LOPR BQ} BQ} false:{MakeTree ListQ {ListOfPersonFalse LOPR BQ} BQ})
  8. end
  9. end
  10.  
  11. Tree = Question({BestQ LOQ ListOfPerson} true:{MakeTree LOQ {ListOfPersonTrue ListOfPerson {BestQ LOQ ListOfPerson}} {BestQ LOQ ListOfPerson}} false:{MakeTree LOQ {ListOfPersonFalse ListOfPerson {BestQ LOQ ListOfPerson}} {BestQ LOQ ListOfPerson}})
  12. end
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement