Logistic Exp1
Logistic Exp1
# Split the dataset into training and testing sets. Chosen standard
70/30 ratio for data split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size
=0.3, random_state=42)
http://localhost:8833/nbconvert/html/Desktop/MTECH/2ndsem/exp1/logistic-exp1.ipynb?download=false Page 1 of 2
logistic-exp1 26/8/24, 1:04 PM
# Calculate accuracy
accuracy = accuracy_score(y_test, y_pred)
print("Accuracy:", accuracy)
Accuracy: 0.8432835820895522
http://localhost:8833/nbconvert/html/Desktop/MTECH/2ndsem/exp1/logistic-exp1.ipynb?download=false Page 2 of 2