Class FactorInteraction

java.lang.Object
smile.data.formula.FactorInteraction
All Implemented Interfaces:
Serializable, Term

public class FactorInteraction extends Object implements Term
The interaction of all the factors appearing in the term. The interaction of one factor with another is that each of its levels is tested in each level of the other factor. For example, in a test of influences on crop yield, a watering regime factor (W: wet and dry) is crossed with a sowing density factor (D: high and low) when the response to the wet regime is tested at both high and low sowing density, and so is the response to the dry regime. If each of the four combinations of levels has replicate observations, then a cross-factored analysis can test for an interaction between the two treatment factors in their effect on the response.
See Also:
  • Constructor Details

    • FactorInteraction

      public FactorInteraction(String... factors)
      Constructor.
      Parameters:
      factors - the factors of interaction.
  • Method Details

    • size

      public int size()
      Returns the number of factors in the interaction.
      Returns:
      the number of factors in the interaction.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • variables

      public Set<String> variables()
      Description copied from interface: Term
      Returns the set of variables used in this term.
      Specified by:
      variables in interface Term
      Returns:
      the set of variables used in this term.
    • bind

      public List<Feature> bind(StructType schema)
      Description copied from interface: Term
      Binds the term to a schema.
      Specified by:
      bind in interface Term
      Parameters:
      schema - the schema to bind the term with.
      Returns:
      the feature list.