In [5]:
%matplotlib inline
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
In [6]:
# Load data from file
data = np.loadtxt('ex2data1.txt',dtype='float',delimiter=',')
X = data[:,:-1]; y = data[:,-1:]
print "Number of data points:", X.shape[0]
print "Number of features:",X.shape[1]
print "Sample data:"
print data[:5]
In [7]:
df = pd.DataFrame()
df['Exam1'] = X[:,0]
df['Exam2'] = X[:,1]
df['y'] = y[:,0]
df.head()
Out[7]:
In [30]:
sns.lmplot('Exam1', 'Exam2',
data=df,
fit_reg=False,
#logistic=True,
hue='y',
scatter_kws={"marker": "D",
"s": 100})
plt.title('Admittance')
Out[30]:
In [32]:
sns.pairplot(df,hue='y')
Out[32]:
In [ ]: