In [1]:
%pylab inline
import linreg
import pandas as pd
Populating the interactive namespace from numpy and matplotlib
In [13]:
linreg.lab_experiments()
In [14]:
linreg.linreg_example()
Slope = 1.965552
Intercept = 0.789555
In [15]:
linreg.make_data_points()
Out[15]:
(array([ 0.        ,  0.26315789,  0.52631579,  0.78947368,  1.05263158,
        1.31578947,  1.57894737,  1.84210526,  2.10526316,  2.36842105,
        2.63157895,  2.89473684,  3.15789474,  3.42105263,  3.68421053,
        3.94736842,  4.21052632,  4.47368421,  4.73684211,  5.        ]),
 array([  0.39764617,   1.26578746,   1.29291222,   1.80108222,
         3.58815344,   3.82828186,   3.70434868,   4.3250836 ,
         5.0950376 ,   5.86005947,   6.26675257,   5.64136313,
         6.95328529,   7.4565617 ,   8.54487947,   8.83795151,
         7.92023398,   9.26144715,  10.80819687,  10.28071513]))
In [16]:
linreg.lab_experiments()
In [17]:
linreg.lab_experiments(1000,2003)
In [18]:
x,y = linreg.make_data_points()
linreg.make_single_plot(x,y,'Force','Acceleration','Lab Experiment')
Out[18]:
<matplotlib.axes.AxesSubplot at 0x10cba92d0>
In [19]:
linreg.lab_experiment()
Out[19]:
<matplotlib.axes.AxesSubplot at 0x10bb77c10>

data exploration

In [20]:
import pandas as pd
#loansDataRaw = pd.read_csv('https://spark-public.s3.amazonaws.com/dataanalysis/loansData.csv')
loansmin = pd.read_csv('../datasets/loanf.csv')
In [21]:
loansmin.head()
Out[21]:
Interest.Rate FICO.Score Loan.Length Monthly.Income Loan.Amount
6 15.31 670 36 4891.67 6000
11 19.72 670 36 3575.00 2000
12 14.27 665 36 4250.00 10625
13 21.67 670 60 14166.67 28000
21 21.98 665 36 6666.67 22000

data analysis

In [39]:
a = pd.scatter_matrix(loansmin,alpha=0.6,figsize=(9,9), diagonal='kde')
In [38]:
a = pd.scatter_matrix(loansmin,alpha=0.05,figsize=(9,9), diagonal='kde')
In [45]:
 
In [ ]: