LinMixin

Contents

LinMixin#

class liesel_gam.LinMixin[source]#

Bases: object

Mixin that adds formula metadata to linear-term classes.

Examples

>>> import pandas as pd
>>> import liesel_gam as gam
>>> df = pd.DataFrame({"x": [0.0, 1.0], "z": [1.0, 2.0]})
>>> term = gam.TermBuilder.from_df(df).lin("x + z")
>>> term.column_names
['x', 'z']

Attributes

column_names

List of column names for this term.

mappings

A dictionary of label-integer mappings for all categorical variables in this term.

model_spec

The model spec used internally by formulaic to set up the basis matrix.