Reputation: 590
I am using the interpolate package from scipy. In the documentation of the splprep function, it says that amongst the return values, there is also the variable "fp" that contains the residuals of the spline fit. http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.splprep.html
I don't know how to retrieve the fp value because I cannot call the function with more than two return variables.
Here is some sample code I use:
from scipy import interpolate
[tck_poly, u] = interpolate.splprep([[1.,2.,3.,4.,5.]])
Does anybody know how to get this residual or another easy way to determine the fit quality?
Upvotes: 2
Views: 969
Reputation: 879093
Specify full_output=True
:
(tck, u), fp, ier, msg = interpolate.splprep([[1.,2.,3.,4.,5.]], full_output=True)
Upvotes: 4