In [1]:
from ahh import exp, sci, vis

In [2]:
x, y = exp.arr_1d(25, xy=True) # random data

In [6]:
y1 = sci.get_regression(x, y, deg=1) # linear get_regressionion
y4 = sci.get_regression(x, y, deg=4)
y8 = sci.get_regression(x, y, deg=8)
y12 = sci.get_regression(y, deg=12) # don't need to provide x

In [14]:
# just to see how well these get_regressionions fit

vis.plot(x, y, 'Origin', 'l/k',
         x, y1, '1st', 'l/b',
         x, y4, '4th', 'l/g',
         x, y8, '8th', 'l/r',
         x, y12, '12th', 'l/orange',
         ylabel='y', xlabel='x',
         title='Get Regression Vis')


/home/solactus/anaconda3/lib/python3.5/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
  warnings.warn(message, mplDeprecation, stacklevel=1)
Out[14]:
[<matplotlib.axes._subplots.AxesSubplot at 0x7fce1ad38940>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7fce1ad38940>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7fce1ad38940>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7fce1ad38940>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7fce1ad38940>]
<matplotlib.figure.Figure at 0x7fce1c3f23c8>

In [ ]: