Skip to content

[EXTERNAL] Correct multi-class loss function to categorical_crossentropy#3028

Merged
MSilva95 merged 1 commit into01-edu:masterfrom
Mohamed-2196:patch-2
Oct 27, 2025
Merged

[EXTERNAL] Correct multi-class loss function to categorical_crossentropy#3028
MSilva95 merged 1 commit into01-edu:masterfrom
Mohamed-2196:patch-2

Conversation

@Mohamed-2196
Copy link
Copy Markdown

Why?

The README incorrectly stated that binary_crossentropy is the extension of log loss for multi-class classification. This is misleading because binary_crossentropy is only appropriate for binary or multi-label tasks, not single-label multi-class tasks.

Solution Overview

Updated the README to specify that categorical_crossentropy (or sparse_categorical_crossentropy if labels are integers) is the correct loss function for multi-class classification in Keras.

Implementation Details

Replaced reference to binary_crossentropy in the multi-class section with categorical_crossentropy.

Added a brief clarification on when to use sparse_categorical_crossentropy.

Left binary classification explanation unchanged.

correct multi-class loss function to categorical_crossentropy
@Oumaimafisaoui Oumaimafisaoui added the 📕 AI Artificial Intelligence label Aug 26, 2025
@HarryVasanth HarryVasanth changed the title CON-#### | [EXTERNAL] Correct multi-class loss function to categorical_crossentropy [EXTERNAL] Correct multi-class loss function to categorical_crossentropy Aug 27, 2025
@MSilva95 MSilva95 self-assigned this Oct 27, 2025
@MSilva95 MSilva95 merged commit 3e6d773 into 01-edu:master Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📕 AI Artificial Intelligence

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants