terms.Term
terms.Term(*components)Model term.
Terms are made of one or more components. Components are instances of Variable or Call. Terms with only one component are known as main effects and terms with more than one component are known as interaction effects. The order of the interaction is given by the number of components in the term.
Parameters
Attributes
Methods
| Name | Description |
|---|---|
| eval_new_data | Evaluates the term with new data. |
| get_component | Returns a component by name. |
| set_data | Obtains and stores the final data object related to this term. |
| set_type | Set type of the components in the term. |
eval_new_data
terms.Term.eval_new_data(data)Evaluates the term with new data.
Calls .eval_new_data() method on each component in the term and combines the results appropriately.
Parameters
Returns
get_component
terms.Term.get_component(name)Returns a component by name.
Parameters
name : str-
The name of the component to return.
Returns
set_data
terms.Term.set_data(spans_intercept)Obtains and stores the final data object related to this term.
Calls .set_data() method on each component in the term. Then, it uses the .data attribute on each of them to build self.data.
Parameters
set_type
terms.Term.set_type(data, env)Set type of the components in the term.
Calls .set_type() method on each component in the term. For those components of class Variable it only passes the data mask. For Call objects it also passes the evaluation environment.