Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- outcomes = {'roy':1, 'mary':0, 'anne':1}
- data = {'roy': ['50to59', 'male', 'rx50111043303', 'dxN39.0', 'dxI50.9', 'px85025'],
- 'mary': ['50to59', 'female', 'labCO2_NS', 'rx68180052001'],
- 'anne': ['85+', 'female', 'labHDL', 'rx68180052001', 'pxV2025', 'px83721']}
- import numpy as py
- from sklearn.naive_bayes import GaussianNB
- # (data as listed above)
- clf = GaussianNB()
- clf.fit(data, outcomes)
- print('Finished!')
Add Comment
Please, Sign In to add comment