liveBook · Manning

Sparse model

As explained in Ensemble Methods for Machine Learning

A sparse linear model is a linear model with many coefficients constrained or estimated to be zero.

A sparse linear model uses many zero coefficients alongside nonzero ones. A zero weight removes that feature’s contribution, producing a leaner and more interpretable model. section 9.1.3

Read the learned coefficients as feature effects:

  • In logistic regression, convert weight wi to odds with e^wi: positive weights increase positive-class odds, negative weights decrease them, and zero weights have no effect. section 9.1.3
  • Use L1 regularization, including LASSO or elastic net, to encourage as many coefficients as possible to become zero. section 9.4.1
  • Scale features before interpreting coefficients; otherwise variables with larger numerical ranges can dominate weight learning. section 9.1.3

Breast-cancer diagnosis

Standardize the breast-cancer data, fit scikit-learn logistic regression with an L1 penalty, and inspect the coefficients. Positive, negative, and zero weights respectively show increased odds, decreased odds, and no contribution to diagnosis.

How Ensemble Methods for Machine Learning covers it

How deep it goes
Explains zero weights, odds, scaling, and L1-based sparsity, but does not develop regularization algorithms mathematically.
Examples
Demonstrates breast-cancer diagnosis and LIME explanations for a Bank Marketing prediction.
What it assumes
Assumes familiarity with linear or logistic regression while teaching how coefficient signs, magnitudes, and zeros affect predictions.
What you can do after
Apply via scikit-learn logistic regression with standardized features and an L1 penalty, then interpret nonzero coefficients.
How it connects
Connects logistic regression, linear regression, L1 regularization, elastic net, LIME, and model interpretability.

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.