Computer Science, asked by AaryanAgarwal3547, 9 months ago

How to calculate the model building and predicting time of a classifier .

Answers

Answered by 3140
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 sagarlanarsimha
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