liveBook · Manning

Polynomial feature interaction

As explained in Build AI Drug Discovery Pipelines

A polynomial feature is a feature formed by applying powers or products of original input features to represent nonlinear interactions.

Polynomial feature interaction transforms input features into powers and products, allowing a linear model to represent nonlinear relationships in the original feature space. For features a and b, degree-two expansion produces 1, a, b, a², ab, and b²; products such as ab are interaction terms because they represent combined effects. section 3.4.2

The workflow transforms training data, fits a linear model in the expanded space, and applies the same transformation before predicting new data. Higher degrees increase flexibility but can cause feature-count growth, computation, and overfitting. section 3.4.2

Use polynomial interactions with attention to representation and evaluation:

  • Tune the transformation or its hyperparameters through cross-validation within the training set, not by repeatedly consulting the test set. section 3.4.2
  • Treat molecular fingerprints cautiously: multiplying binary bits often adds redundant information, while sparse interactions can be nearly always zero. section 3.4.4

hERG Blocking Prediction

For hERG blocking prediction, polynomial features derived from molecular fingerprint bits were not informative in randomized search. A final regularized linear model achieved a test F1 score of 0.866, compared with cross-validated F1 of 0.881. section 3.4.4

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Explains degree-two and degree-three terms, workflow, interaction meaning, feature explosion, overfitting, and test-set leakage.
Examples
Uses two-feature expansions, molecular fingerprint bits, hERG blocking prediction, and test-set F1 evaluation.
What it assumes
Assumes familiarity with features and linear models while defining nonlinear feature spaces, powers, products, and interaction terms.
What you can do after
Apply polynomial feature transforms with Scikit-Learn, tune them within training data, and evaluate generalization on a held-out test set.
How it connects
Connects linear models with nonlinear feature spaces, interaction terms, cross-validation, molecular fingerprints, sparsity, regularization, and overfitting.

Also explained in

Compare how 3 books explain polynomial feature interaction →

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.