A class probability distribution is the model’s probability estimate for every possible class. Its entries form a vector whose values sum to 1, with one entry per class. section 4.2.5 section 4.2.3
Reading predictions
For a 46-topic classifier, predict() returns one 46-entry vector for each input. The largest entry identifies the predicted topic. In the digit example, predictions[1, 8] is 0.9993394, so class 8 receives the highest score. section 4.2.5
A distribution communicates more than the single winning class:
- Each position corresponds to a different output class. section 4.2.3
- Softmax produces scores that sum to 1, allowing the entries to be read as probabilities. section 2.1 section 4.2.5
- Categorical crossentropy compares the predicted distribution with the true label distribution during training. section 4.2.3
predictions <- model |> predict(x_test)
Inspect the R prediction call that generates class probability distributions for new samples. section 4.2.5

