liveBook · Manning

RandomizedSearchCV

As explained in Build AI Drug Discovery Pipelines

Randomized search is a hyperparameter optimization method that evaluates configurations sampled from specified parameter distributions or candidate ranges.

RandomizedSearchCV optimizes model hyperparameters by sampling a user-defined number of configurations from discrete candidates or continuous distributions, then evaluating them with cross-validation. It is especially useful when exhaustive grid search is too expensive or when the promising parameter values are uncertain. section 3.4.3

Use randomized search when you need to:

  • Explore a wider or higher-dimensional hyperparameter space with fewer evaluations than exhaustive grid search. section 3.4.3
  • Sample continuous values, such as regularization strength, instead of restricting evaluation to a fixed list. section 3.4.3
  • Retrieve the selected configuration through best_params_ and inspect evaluated configurations through cv_results_. section 3.4.3

Nonlinear cardiotoxicity model

A pipeline generates molecular fingerprints, adds degree-two interaction features, and trains an SGDClassifier. RandomizedSearchCV samples 20 configurations, scores them with five-fold cross-validation using F1, and searches L1 or L2 regularization, a continuous alpha value, fingerprint radii 2 or 4, and fingerprint sizes of 64, 128, or 256 bits. One selected configuration uses 128 bits, radius 2, and alpha 0.364. section 3.4.3

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Explains sampling, cross-validation, pipeline parameters, and result access, but does not develop randomized-search theory.
Examples
Demonstrates an SGDClassifier pipeline using fingerprints, interaction features, five-fold F1 scoring, and twenty sampled configurations.
What you can do after
Apply it via Scikit-Learn to select configurations and retrieve the best parameters for subsequent prediction.
How it connects
Connects hyperparameter tuning with grid search, cross-validation, pipelines, regularization, molecular fingerprints, and polynomial features.

Also explained in

Compare how 2 books explain RandomizedSearchCV →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI Drug Discovery Pipelines. The section links point to the parts of the book it draws on.