exp9-10
exp9-10
# Evaluation
cm = confusion_matrix(y_test, y_pred)
print("Confusion matrix is as follows\n", cm)
print("Accuracy Metrics")
print(classification_report(y_test, y_pred))
print("Correct prediction:", accuracy_score(y_test, y_pred))
print("Wrong prediction:", 1 - accuracy_score(y_test, y_pred))
OUTPUT:
10) SUPPORT VECTOR MACHINE ALGORITHM
# Split the X and y Dataset into the Training set and Test set
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=0)
# Predict accuracy
print("Accuracy:", accuracy_score(y_test, y_pred))
OUTPUT: