0

I have written my code in python (using numpy). It is a simple code for classification problems, but I would really like to compare how for instance Neural Nets performs in comparison to decision trees. I would like to measure the time taken to run my function and the memory cost, I have tried to find a numpy function for this, and have tried timeit, but it seems not to be exactly what im looking for.

I would like to simply have a function that I can say time(NeuralNets()) and then it tells me how long running that function with its given input takes.

any help would be very welcome!

SaraH
  • 1
  • if you're using linux you could use top to give memory and cpu. You can also get loads of info using cprofile – paddyg Apr 22 '15 at 21:22
  • 1
    What is the problem with timeit? That should be exactly what you need for timing profiling. – too honest for this site Apr 22 '15 at 21:24
  • possible duplicate of [Which Python memory profiler is recommended?](http://stackoverflow.com/questions/110259/which-python-memory-profiler-is-recommended) – Roman Kutlak Apr 22 '15 at 22:09
  • I think this is answered [here](http://stackoverflow.com/questions/7370801/measure-time-elapsed-in-python) and [here](http://stackoverflow.com/questions/110259/which-python-memory-profiler-is-recommended) – Roman Kutlak Apr 22 '15 at 22:11
  • Whenever you say *"I have tried X, but it seems not to be exactly what I'm looking for"*, please explain *why* you think it isn't what you're looking for. Maybe we can explain how to achieve what you want using X, or at least we can get a better idea of what your actual needs are. – ali_m Apr 23 '15 at 00:00

0 Answers0