Professional Documents
Culture Documents
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df= pd.read_csv('/content/drive/MyDrive/Datasets/kyphosis.csv')
df.head()
x=df.iloc[:,1:4]
y=df.iloc[:,0]
0 absent
1 absent
2 present
3 absent
4 absent
...
76 present
77 absent
78 absent
79 present
80 absent
Name: Kyphosis, Length: 81, dtype: object
LogisticRegression()
y_pred=logmodel.predict(X_test)
y_pred
array(['present', 'absent', 'absent', 'absent', 'present', 'absent',
'absent', 'absent', 'present', 'absent', 'present', 'absent',
'absent', 'absent', 'absent', 'absent', 'absent', 'present',
'absent', 'absent', 'absent', 'present', 'absent', 'absent',
'absent'], dtype=object)
accuracy 0.72 25
macro avg 0.64 0.63 0.64 25
weighted avg 0.71 0.72 0.71 25