How to measure the execution time for a classification algorithm in Python's scikit-learn?

Viewed 2114

How do I measure the time taken to train and test a classifier like SVM, KNN and Decision Treen in scikit-learn?

1 Answers

You can use the time module like so

import time
start = time.time()

# enter your code here

end = time.time()
print(end - start, "seconds")
Related