from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score

class CancerMetrics:
    @staticmethod
    def calculate_all(y_true, y_pred, y_proba=None):
        return {
            "accuracy": accuracy_score(y_true, y_pred),
            "precision": precision_score(y_true, y_pred, average="weighted", zero_division=0),
            "recall": recall_score(y_true, y_pred, average="weighted", zero_division=0),
            "f1_score": f1_score(y_true, y_pred, average="weighted", zero_division=0)
        }
