PolynomialInteraction#
- class superglm.PolynomialInteraction(poly1_name: str, poly2_name: str)#
Bases:
objectCross-product of two polynomial bases.
Single group of
n1 * n2columns formed by all pairwise products of the two parents’ orthonormal components (constant excluded). Both margins evaluate through the parents’ stored factors (deep copies of the fitted parent specs) — never re-orthogonalized.Note the parents’ weight-orthonormality does not transfer to this block: pairwise products of two weight-orthonormal margins are not weight-orthonormal unless the margins are independent under the weights, so the standardized-group-lasso argument is a main-effect property and does not extend to the product columns.
- reconstruct(
- beta: NDArray,
- n_points: int = 50,
Evaluate the surface on a grid without materialising a cross design.
The product structure gives
f(x1_i, x2_j) = P1[i] C P2[j], so the(n_points**2, n1*n2)meshgrid design is never formed.surface[j, i] = f(x1[i], x2[j])(np.meshgrid’s default"xy"indexing), reached by the associationTensorInteractionuses.