Complete the code to import the function that generates a classification report.
from sklearn.metrics import [1]
The classification_report function from sklearn.metrics provides detailed metrics for classification models.
Complete the code to generate predictions from the model on test data.
y_pred = model.[1](X_test)evaluate which returns loss and metricsfit which trains the modelThe predict method generates predicted labels or probabilities from the model.
Fix the error in the code to correctly generate a classification report for true and predicted labels.
report = classification_report(y_true, [1]) print(report)
y_true twiceX_test instead of predictionsThe classification report requires the true labels and predicted labels as inputs. Here, y_pred holds the predicted labels.
Fill both blanks to create a classification report with target names for classes 'cat' and 'dog'.
report = classification_report(y_true, y_pred, target_names=[1]) print([2])
The target_names parameter expects a list of class names. The variable report holds the generated report to print.
Fill all three blanks to generate predictions, convert probabilities to class labels, and print the classification report.
y_prob = model.[1](X_test) y_pred = y_prob.argmax(axis=[2]) print(classification_report(y_true, [3]))
predict instead of predict_proba for probabilitiesUse predict_proba to get probabilities, then use argmax along axis 1 to get class labels, and finally print the report with predicted labels.