Observe t_computed is very different from the values t
The issue can be plotted as follows:
import matplotlib.pyplot as plt
plt.plot(n, t, "-", n, t_computed, "--")
plt.show()
In blue is t, the original function. In orange is t_computed.
Observe that, while t is consistent with a polynomial function, the t_computed line is negative and roughly linear/constant. The t_computed line is not consistent with a polynomial.
Expected Behavior:
Result of big_o.complexities.Polynomial() and big_o.complexities.Exponential() should resemble a polynomial/exponential function that matches the fitted data.
Description
big_o.complexities.Polynomial.compute()
andbig_o.complexities.Exponential.compute()
consistently return unreasonable values.This issue is present both when the class is used by itself, and when it is returned by
big_o.big_o()
Steps to reproduce:
Run the following example code to test the
Polynomial
class:Observe
t_computed
is very different from the valuest
The issue can be plotted as follows:
In blue is
t
, the original function. In orange ist_computed
. Observe that, whilet
is consistent with a polynomial function, thet_computed
line is negative and roughly linear/constant. Thet_computed
line is not consistent with a polynomial.Expected Behavior:
Result of
big_o.complexities.Polynomial()
andbig_o.complexities.Exponential()
should resemble a polynomial/exponential function that matches the fitted data.