confusion_matrix_metrics
Compute malignant-class precision, recall, accuracy, and confusion matrix counts for Logistic Regression and KNN on a held-out test set to compare model performance.
Instructions
Compute the confusion matrix plus accuracy/precision/recall for both models on the test set. Precision and recall are for the malignant class. Confusion matrix order is [malignant, benign]; rows = actual, columns = predicted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| test_size | No | Fraction of the data held out for testing. | |
| request_id | No | Your own id for this call; recorded in the audit log. | unknown |
| random_state | No | Random seed for the train/test split. | |
| knn_neighbors | No | Number of neighbors for the KNN model. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |