2

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

Aqee
  • 153
  • 1
  • 9
  • 2
    Does 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 Answers1

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