Skip to content

PolynomialDGP

The target is a polynomial expansion of a subset of the features. Useful for separating methods that can represent curvature and interactions from ones that cannot: a linear model will leave a lot on the table here, and how much it leaves is the interesting quantity.

complexity raises the polynomial degree and switches on cross-terms:

Complexity Degree Interactions Informative features
"low" 2 no max(2, p // 3)
"medium" 3 yes max(2, p // 2)
"high" 4 yes max(2, p)

Noise is fixed at σ = 0.5 across all three, so complexity here really does mean signal complexity rather than a worse signal-to-noise ratio. Terms are constructed directly rather than through scikit-learn's PolynomialFeatures, which keeps the term set explicit and the output reproducible.

from synthbench import BenchPipeline, PolynomialDGP

dgp = PolynomialDGP(complexity="high", task_type="regression", random_state=0)
result = BenchPipeline(dgp).run(n_samples=500, n_features=10, random_state=42)

print(result.X.shape)  # (500, 10)
print(sum(result.metadata["signal_feature_importances"].values()))  # 1.0

Every informative raw feature gets equal importance, 1 / n_informative, regardless of how many polynomial terms it appears in. This is structural ground truth — which inputs the formula uses — not a measure of how much each term contributes to the variance. Features outside the informative set get exactly 0.0.

n_classes > 2 produces ordinal classes here

This DGP is built on a fixed term basis, so it has one signal and no honest way to emit a separate score per class. Above two classes that signal is cut into ordered bins instead, which means only neighbouring classes are confusable. That is a fine model of a genuinely ordinal target — a severity grade, a credit rating — and a poor general multiclass benchmark, because a method that internally regresses a single score will score better than it deserves. metadata["label_mechanism"] reads "ordinal", so a result always says which kind it is. For unordered classes use LinearDGP, SparseDGP, TreeDGP, or RandomNeuralDGP.

Full parameter list: PolynomialDGP in the API reference.