Guest User

Untitled

a guest
Mar 17th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #These data sets are randomly generated. They are not scientifically real !
  2. from sklearn import tree
  3. clf = tree.DecisionTreeClassifier()
  4. Gender = ["F","M","F","M","M","F","M","F","M","F","M","F","F","M","M","M","M","F","F","F",
  5. "M","F","M","F","M","F","F","F","M","F","M","M","F","M","F","M","M","F","M","M"]
  6. Age = [[24],[31],[20],[74],[52],[30],[81],[19],[76],[82],[49],[39],[54],[27],[80],[69],[58],[23],[58],[49],
  7. [45],[21],[23],[67],[86],[45],[34],[36],[67],[28],[21],[93],[89],[48],[51],[61],[82],[24],[42],[43]]
  8. clf = clf.fit(Age, Gender) #Training Data Sets
  9. prediction = clf.predict([[21]]) #Predicting
  10. print(prediction) #Output
Add Comment
Please, Sign In to add comment