Professional Documents
Culture Documents
Kidney Stones Analysis %
Kidney Stones Analysis %
In [5]:
df=pd.read_csv(r"C:\Users\SRINIVASULU\Downloads\kindey stone urine analysis.csv")
df.head()
Out[5]:
gravity ph osmo cond urea calc target
In [27]:
f=df.drop('target',axis=1)
t=df.target
In [49]:
(F_train,F_test)=train_test_split(f,test_size=0.3,random_state=1)
(T_train,T_test)=train_test_split(t,test_size=0.3,random_state=1)
In [32]:
F_train.shape
Out[32]:
(63, 6)
In [33]:
F_test.shape
Out[33]:
(16, 6)
In [34]:
T_train.shape
Out[34]:
(63,)
In [35]:
T_test.shape
Out[35]:
(16,)
In [13]:
df1=df[df.target==0]
df1.head(5)
Out[13]:
gravity ph osmo cond urea calc target
In [14]:
df2=df[df.target==1]
df2.head()
Out[14]:
gravity ph osmo cond urea calc target
In [25]:
df3=df.drop('target',axis=1)
df4=df.drop('target',axis=1)
In [21]:
%matplotlib inline
plt.scatter(df1[''],df1['calc'],marker='*',color='green')
plt.scatter(df2['osmo'],df2['calc'],marker='*',color='blue')
Out[21]:
<matplotlib.collections.PathCollection at 0x1c1f5e77880>
In [50]:
model=SVC()
model.fit(F_train,T_train)
model.score(F_test,T_test)
Out[50]:
0.5
In [51]:
model=tree.DecisionTreeClassifier()
model.fit(F_train,T_train)
model.score(F_test,T_test)
Out[51]:
0.6666666666666666
In [52]:
model= GaussianNB()
model.fit(F_train,T_train)
model.score(F_test,T_test)
Out[52]:
0.8333333333333334