Regression user Kantale
From PyPedia
Contents |
[edit] Documentation
Returns the points of a regression curve (if degree == 1 then line). Adapted from: http://www.scipy.org/Cookbook/LinearRegression
[edit] Parameters
<inputs> </inputs>
[edit] Return
[edit] See also
[edit] Code
def Regression_user_Kantale( input_filename=None, degree = 1, points = 50, x_from = 0, x_to = 1, ): try: from scipy import linspace, polyval, polyfit except ImportError as inst: print "Could not import scipy" raise inst try: import numpy except ImportError as inst: print "Could not import numpy" raise inst data = numpy.genfromtxt(filename) if degree == 1: (ar,br)=polyfit(data[:,0], data[:,1], 1) else: polyfit_return = polyfit(data[:,0], data[:,1], degree) t=linspace(x_from, x_to, points) if degree==1: xr = polyval([ar,br],t) else: xr = polyval(polyfit_return, t) return (t, xr)
[edit] Unit Tests
def uni1(): return True
[edit] Development Code
def Regression_user_Kantale(): pass
[edit] Permissions
[edit] Documentation Permissions
Kantale
[edit] Code Permissions
Kantale
[edit] Unit Tests Permissions
Kantale