liveBook · Manning

Hyperparameter tuning

As explained in Causal Inference for Data Science

Hyperparameter tuning is the process of selecting model-training settings by evaluating candidate settings and choosing the best-performing configuration.

Hyperparameter tuning selects model-training settings by comparing candidate configurations. A poor choice can hurt performance, so each candidate is evaluated with cross-validation and the configuration with the lowest error is chosen. section 8.1.3

A practical tuning workflow is:

  • Specify candidate hyperparameter sets, such as different k values for k-nearest neighbors or regularization settings for linear regression. section 8.1.3
  • Run cross-validation for every candidate and compare its error. section 8.1.3
  • Choose the lowest-error configuration, train the model with it, and use that model for prediction. section 8.1.3
  • Within cross-fitted DML, tune separately on each training fold before predicting on the held-out fold; repeat after switching fold roles. section 8.1.3

Tuning an ATE analysis

For the right-heart catheterization dataset, estimate the average treatment effect and its confidence interval with DoubleML, using hyperparameter tuning with tune_on_folds=True. section 8.3.1

How Causal Inference for Data Science covers it

How deep it goes
Explains candidate evaluation, fold-specific integration, and DoubleML support while deferring exact R and Python syntax to package documentation.
Examples
Uses k-nearest-neighbor k values, linear-regression regularization, two-fold DML, and a right-heart catheterization treatment-effect exercise.
What it assumes
Assumes familiarity with machine-learning models, cross-validation, cross-fitting, and double machine learning.
What you can do after
Operate/configure DoubleML by supplying candidate hyperparameters and enabling fold-specific tuning for an ATE analysis.
How it connects
Connects hyperparameter tuning to cross-validation, cross-fitting, double machine learning, nuisance models, and the DoubleML package.

Also explained in

Compare how 18 books explain hyperparameter tuning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal Inference for Data Science. The section links point to the parts of the book it draws on.