How to calculate the model building and predicting time of a classifier .
Answers
Answered by
1
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
import numpy as np
clf = GaussianNB() # gaussian model #3140
clf.fit(features_train,labels_train) # model building
ypred=clf.predict(features_test) #predicting on test data
x=accuracy_score(labels_test, ypred) # accuracy of a model
print(x)
Answered by
0
Explanation:
from sklearn. naive_ bayes import
GaussianNB
from sklearn.metrics import
accuracy_score
import numpy as np
clf=Gaussian NB() # gaussian model # 3140
clf. fit (features_ train , labels_train) # model building
ypred=clf.predict (features_test) # predicting on test data
x= accuracy_score (labels_test, ypred) # accuracy of a model
print (x)
Similar questions
Math,
5 months ago
Environmental Sciences,
5 months ago
Social Sciences,
5 months ago
Hindi,
9 months ago
Science,
11 months ago
Chemistry,
11 months ago
Biology,
11 months ago