0

Sklearn says about decision trees:

The cost of using the tree (i.e., predicting data) is logarithmic 
in the number of data points used to train the tree.

I know a logarithm as the inverse to an exponential function. What does it mean in this context? I have the feeling that it references an exponential function such as 2**n possible nodes or such.

However, my understanding it quite vague and I want to get a better picture.

shredding
  • 4,875
  • 3
  • 41
  • 70

2 Answers2

2

See What is a plain English explanation of "Big O" notation? or many other similar explanations first for what O(f(N)) means. In this case you have O(log N): when the number of data points doubles, the cost increases by a constant.

Alexey Romanov
  • 160,869
  • 33
  • 291
  • 457
0

Very briefly:

O(1) < O(log N) < O(N) 

Logarithmic is cheaper than a linear (i.e. O(N)) cost.

Wikipedia has a nice table that orders the different big-O costs.

Phylyp
  • 1,594
  • 11
  • 15