How do I measure the time taken to train and test a classifier like SVM, KNN and Decision Treen in scikit-learn?
Asked
Active
Viewed 2,674 times
2
-
2Does this answer your question? [How to measure elapsed time in Python?](https://stackoverflow.com/questions/7370801/how-to-measure-elapsed-time-in-python) – alift Jun 02 '20 at 09:03
1 Answers
1
You can use the time
module like so
import time
start = time.time()
# enter your code here
end = time.time()
print(end - start, "seconds")

Eeshaan
- 1,557
- 1
- 10
- 22