Guest User

Untitled

a guest
Aug 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. 0,Week,Date,B1,B2,B3,B4,B5,B6
  2. 1,1140,15/08/2018,3,10,15,18,25,43
  3. 2,1139,11/08/2018,9,15,16,21,32,33
  4. 3,1139,11/08/2018,9,15,16,21,32,33
  5.  
  6. dataset = pd.read_csv('son.csv')
  7.  
  8. # fit a Naive Bayes model to the data
  9. model = GaussianNB()
  10. y = dataset.values[:,9].reshape(1143,-1143)
  11.  
  12. X_train, X_test, y_train, y_test = train_test_split(dataset, y, test_size=0.2)
  13. model.fit(X_train, y_train)
  14. print(model)
  15. # make predictions
  16. expected = X_test
  17. predicted = model.predict(y_test)
  18. # summarize the fit of the model
  19. print(metrics.classification_report(expected, predicted))
  20. print(metrics.confusion_matrix(expected, predicted))
Add Comment
Please, Sign In to add comment