ti#

superglm.ti(
left: str,
right: str,
*,
n_knots: tuple[int, int] | None = None,
decompose: bool = False,
) → BoundInteraction#

Declare a tensor interaction between two smooth effects.

Both columns must have spline terms in the same predictor. For example, use s("age"), s("value"), ti("age", "value") together. The tensor describes their interaction; the two s terms provide the main effects.

Parameters:
left, rightstr

Names of two columns with declared spline terms.

n_knotstuple of int, optional

Interior-knot counts for the left and right tensor margins. By default, inherit the parent terms’ counts.

decomposebool, default=False

Separate the bilinear direction from the wiggly interaction so their penalties can be controlled separately.

Returns:
BoundInteraction

A declaration named "left:right" using the supplied column names.

See also

TensorInteraction

Tensor construction and penalty details.

interaction

Other supported interaction specifications.