Guest User

Untitled

a guest
Feb 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. outcomes = {'roy':1, 'mary':0, 'anne':1}
  2. data = {'roy': ['50to59', 'male', 'rx50111043303', 'dxN39.0', 'dxI50.9', 'px85025'],
  3. 'mary': ['50to59', 'female', 'labCO2_NS', 'rx68180052001'],
  4. 'anne': ['85+', 'female', 'labHDL', 'rx68180052001', 'pxV2025', 'px83721']}
  5.  
  6. import numpy as py
  7. from sklearn.naive_bayes import GaussianNB
  8.  
  9. # (data as listed above)
  10. clf = GaussianNB()
  11. clf.fit(data, outcomes)
  12.  
  13. print('Finished!')
Add Comment
Please, Sign In to add comment