Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How to calculate the model building and predicting time of a classifier in python?

$
0
0

@hinduja1234 wrote:

I am currently solving one classification problem using naive Bayes algorithm in python, I have built the model, but I want to how to calculate the model building and predicting the time of a model.

from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
import numpy as np
clf = GaussianNB() # gaussian model
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)

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles