liveBook · Manning

Feature scaling

As explained in Build AI Drug Discovery Pipelines

Feature scaling transforms feature values to comparable numerical ranges before model fitting.

Feature scaling transforms molecular descriptors into comparable numerical ranges before model fitting. Without it, differently scaled variables distort the cost-function landscape, so gradient descent follows an inefficient path and converges slowly. section 4.2.3

Use feature scaling when:

  • Gradient-based models need similarly scaled inputs to avoid one feature dominating optimization. section 4.2.3
  • Distance-based methods such as support vector machines and k-nearest neighbors compare features on compatible scales. section 4.2.3
  • Decision trees and random forests generally do not require it because they are scale-invariant. section 4.2.3
  • Prefer StandardScaler for molecular data with extreme values; min-max scaling can squash most observations near zero when outliers are present. section 4.2.3

Scale solubility descriptors without leakage

Fit the scaler on training descriptors, then transform both training and validation descriptors with that fitted object. For example, StandardScaler(with_mean=True, with_std=True) can fit X_train before producing scaled_X_train and scaled_X_val. Never fit the scaler on validation or test rows. section 4.2.3 section 6.2.3

Figure 4.14 Effect of feature scaling on the convergence of gradient descent.

Visualizes how comparable feature scales make the gradient-descent path less elongated and more direct toward the optimum. section 4.2.3

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Explains optimization geometry, outlier effects, transformer choices, and training-only fitting, but does not derive scaling formulas.
Examples
Demonstrates molecular descriptors, logP validation data, StandardScaler transformations, and gradient-descent cost landscapes.
What it assumes
Assumes feature-based model fitting and introduces scaling through gradient descent, outliers, and train-test separation.
What you can do after
Apply it via Scikit-Learn transformers fitted on training data before transforming validation or test features.
How it connects
Connects gradient descent, StandardScaler, MinMaxScaler, outliers, support vector machines, k-nearest neighbors, decision trees, random forests, PCA, and data leakage.

Also explained in

Compare how 6 books explain feature scaling →

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.