cleverly.bases.Indicators#

class cleverly.bases.Indicators(column: str, levels: Sequence[Any] = (), intercept: bool = True)[source]#

Indicators of the declared levels of one categorical modifier.

Under an intercept the reference level, the first declared one, is dropped.

Parameters:
columnstr

The categorical modifier.

levelssequence, optional

The levels carried by the basis itself, which take precedence over the schema’s.

interceptbool

Whether to prepend the intercept column.

Methods#

Indicators.level_set(column: str) → tuple[Any, ...] | None[source]#

The levels this basis carries for column, or None.

Parameters:
columnstr

A modifier column.

Returns:
tuple or None

The levels, or None when the basis carries none.

Indicators.named(modifiers: Modifiers | None) → Indicators[source]#

This basis with its levels resolved from modifiers.

Parameters:
modifiersModifiers or None

The declared schema.

Returns:
Indicators

A basis that carries its levels, so its terms are named.

Indicators.truncate(k: int) → Indicators[source]#

Return this basis: a categorical modifier enters whole at every size.

Parameters:
kint

A size of at least one.

Returns:
Indicators

This basis.

Attributes#

Indicators.columns: Any#

The modifier columns the basis reads: a field or a property of each subclass.

Indicators.intercept: bool = True#
Indicators.levels: Sequence[Any] = ()#
Indicators.column: str#