{"record":{"id":"0c9cb875732877cb","repo":"keras-team/keras","slug":"invalid-auc-summation-method-value-key-expec","errorCode":null,"errorMessage":"Invalid AUC summation method value: \"{key}\". Expected values are [\"interpolation\", \"majoring\", \"minoring\"]","messagePattern":"Invalid AUC summation method value: \"(.+?)\"\\. Expected values are \\[\"interpolation\", \"majoring\", \"minoring\"\\]","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/metrics/metrics_utils.py","lineNumber":92,"sourceCode":"      summation for decreasing intervals.\n    * 'majoring': Applies right summation for increasing intervals and left\n      summation for decreasing intervals.\n    \"\"\"\n\n    INTERPOLATION = \"interpolation\"\n    MAJORING = \"majoring\"\n    MINORING = \"minoring\"\n\n    @staticmethod\n    def from_str(key):\n        if key in (\"interpolation\", \"Interpolation\"):\n            return AUCSummationMethod.INTERPOLATION\n        elif key in (\"majoring\", \"Majoring\"):\n            return AUCSummationMethod.MAJORING\n        elif key in (\"minoring\", \"Minoring\"):\n            return AUCSummationMethod.MINORING\n        else:\n            raise ValueError(\n                f'Invalid AUC summation method value: \"{key}\". '\n                'Expected values are [\"interpolation\", \"majoring\", \"minoring\"]'\n            )\n\n\ndef _update_confusion_matrix_variables_optimized(\n    variables_to_update,\n    y_true,\n    y_pred,\n    thresholds,\n    multi_label=False,\n    sample_weights=None,\n    label_weights=None,\n    thresholds_with_epsilon=False,\n):\n    \"\"\"Update confusion matrix variables with memory efficient alternative.\n\n    Note that the thresholds need to be evenly distributed within the list, eg,","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/metrics/metrics_utils.py#L74-L110","documentation":"AUC's summation_method controls how area under the curve is approximated. AUCSummationMethod.from_str() accepts only 'interpolation', 'majoring' or 'minoring' (case-insensitive) and raises this ValueError otherwise. Strings like 'trapezoid' or 'interpolate' are rejected.","triggerScenarios":"Calling keras.metrics.AUC(summation_method='trapezoid') or summation_method='interpolate' - anything other than the three accepted keys.","commonSituations":"Assuming numpy.trapz-style naming ('trapezoid') transfers to Keras; typos in hyperparameter configs.","solutions":["Use exactly 'interpolation', 'majoring', or 'minoring'.","Keep the default summation_method='interpolation' unless you specifically need Riemann majoring/minoring behavior."],"exampleFix":"# before\nauc = keras.metrics.AUC(summation_method='trapezoid')\n\n# after\nauc = keras.metrics.AUC(summation_method='interpolation')","handlingStrategy":"validation","validationCode":"VALID_SUMMATION = {'interpolation', 'majoring', 'minoring'}\ndef check_summation(s):\n    if s.lower() not in VALID_SUMMATION:\n        raise ValueError(f'summation_method must be one of {sorted(VALID_SUMMATION)}')\n    return s","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy exact strings from the AUC docstring when configuring.","Reject unknown strings early in config loaders."],"tags":["keras","metrics","auc","enum","invalid-argument"],"backgroundTag":"invalid-enum-value","analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}