1

I have following .ipynb file loaded with Jupyter. I can run it, and it seems to work fine.

enter image description here

However, I don't know how to watch variable values. For example, for following lines, how do I see the value of gain ?

gain = calculate_information_gain(train_data, train_labels)

print(gain)

I am using Windoes 10 and Python 3.5. Thanks a lot.

Nick X Tsui
  • 2,737
  • 6
  • 39
  • 73

1 Answers1

0
  1. print is always an option
  2. Memory usage

What's up with print ? do you want to track memory usage in whole. If that's the case you will be needing a library like memory_profiler.

  1. Simple profiling memory size of objects

Simpler profiling memory size when using other data structures something like is useful http://code.activestate.com/recipes/577504-compute-memory-footprint-of-an-object-and-its-cont/


But finally your question is similar to this one answered in https://stackoverflow.com/a/13404866/1951298

Curcuma_
  • 851
  • 2
  • 12
  • 37