liveBook · Manning

Multiclass logistic loss

As explained in Ensemble Methods for Machine Learning

Softmax loss is the multiclass negative log-likelihood loss applied to predicted class probabilities.

Multiclass logistic loss scores predictions across several classes by extending binary logistic loss to multiclass classification. Its softmax form is commonly used for multinomial logistic regression, neural networks, and tree-based classifiers. section 5.5.2 section 6.5.2

Use the loss as part of a practical training and evaluation workflow:

  • Train multiclass LightGBM models with multiclass logistic loss and monitor multi_logloss on a held-out test set. section 5.5.2
  • Select learning and complexity hyperparameters through five-fold RandomizedSearchCV rather than testing every combination. section 5.5.2 section 6.5.2
  • Keep multiclass error for evaluation rather than optimization when using XGBoost, because merror is not differentiable and cannot provide gradients or Hessians. section 6.5.2

LightGBM evaluation setup

A LightGBM classifier can monitor multiclass logistic loss with eval_metric='multi_logloss', evaluate on (Xtst, ytst), and stop early after 25 rounds without improvement. section 5.5.2

fixed_params = {'early_stopping_rounds': 25, 
               'eval_metric' : 'multi_logloss', 
               'eval_set' : [(Xtst, ytst)],
               'eval_names': ['test set'],
               'verbose': 100}

Inspect the compact LightGBM configuration for multi_logloss, held-out evaluation, and early stopping. section 5.5.2

How Ensemble Methods for Machine Learning covers it

How deep it goes
Defines the multiclass extension and explains metric selection, but does not derive the softmax likelihood or its gradients.
Examples
Demonstrates multi_logloss in LightGBM and contrasts it with merror as the XGBoost multiclass evaluation metric.
What it assumes
Assumes multiclass classification and binary logistic loss, while treating the multiclass extension as the main concept.
What you can do after
Apply it via LightGBM or XGBoost while separating differentiable training objectives from evaluation metrics.
How it connects
Connects softmax loss with binary logistic loss, multinomial logistic regression, neural networks, gradient boosting, and multiclass error.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Ensemble Methods for Machine Learning. The section links point to the parts of the book it draws on.