Question: What's wrong with my code? I Got the following feedback : Test Failed: The SVM classifier evaluation metrics are not found because evaluate _ svm

What's wrong with my code?
I Got the following feedback :
"Test Failed: The SVM classifier evaluation metrics are not found because evaluate_svm_classifier function is not implemented or not working as intended."
In [4]: from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score, precision_score, recall_score, confusion_matrix
def evaluate_svm_classifier(X_train, y_train, X_test, y_test):
evaluate_svm_classifier = SVC(kernel = 'linar')
evaluate_svm_classifier.fit(X_train, y_train)
y_pred =-evaluate_svm_classifier.predict(X_test)
precision = precision_score (y_test, y_pred)
recall = recall_score (y_test, y_pred)
accuracy = accuracy_score (y_test, y_pred)
slope = evaluate_svm_classifier.coef_[0][0]/ evaluate_svm_classifier.coef_[0][1]
intercept =- ev\bar (a) lu\bar (a) e_svm_classifir.intercept_[0]/valuate_svm_classifier.coef_[0][1]
false_positives, false_negatives = confusion_matrix(y_test, y_pred).ravel()
"""
Trains an SVM classifier with a linear kernel on the training set and evaluates its performance on the test set.
Parameters:
x_train: Training data features.
y_train: Training data labels.
X_test: Test data features.
y_test: Test data labels.
Returns:
slope and intercept of the decision boundary.
Accuracy, precision, recall on the test set.
Number of false positives and false negatives.
"""
return slope, intercept, accuracy, precision, recall, false_positives, false_negatives
 What's wrong with my code? I Got the following feedback :

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!