cleverly.bases.Interactions#
- class cleverly.bases.Interactions(basis: Additive, order: int = 2)[source]#
An additive basis with the products of its components up to an interaction order.
Order 1 is the additive basis. Order 2 adds, for every pair of components, the products of their non-intercept columns; order 3 every triple; and so on.
Methods#
- Interactions.evaluate(frame: Any, modifiers: Modifiers | None = None) ndarray[source]#
The additive design, then the product columns.
- Interactions.named(modifiers: Modifiers | None) Interactions[source]#
This basis with every level set resolved from
modifiers.- Parameters:
- Returns:
InteractionsA basis whose terms carry the level names.
- Interactions.truncate(k: int) Interactions[source]#
The additive basis cut to
k, with the same order.- Parameters:
- k
int A size of at least one.
- k
- Returns:
InteractionsThe truncated basis.
Attributes#
- Interactions.basis_kind#
The additive basis’s declaration.
- Interactions.columns#
The modifier columns the components read.
- Interactions.max_size#
The additive basis’s size.
- Interactions.n_terms#
The number of design columns.
- Interactions.terms#
The additive terms, then one name per product column.