cleverly.bases.Constant#

class cleverly.bases.Constant(intercept: bool = True)[source]#

The intercept alone: the projection onto it is the average effect.

Parameters:
interceptbool

Always True; a constant basis is its intercept.

Methods#

Constant.evaluate(frame: Any, modifiers: Modifiers | None = None) → ndarray[source]#

A column of ones, one row per row of frame.

Parameters:
framedataframe or mapping

Rows; only their number is read.

modifiersModifiers, optional

Ignored, accepted for the common signature.

Returns:
ndarray

(n, 1) ones.

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

Return this basis; a constant has nothing to truncate.

Parameters:
kint

Any non-negative size.

Returns:
Constant

This basis.

Attributes#

Constant.columns: Any#

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

Constant.intercept: bool = True#
Constant.max_size#

0: the constant has no size to truncate.