Class FactorCrossing

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

public class FactorCrossing extends Object implements Term
Factor crossing. The crossing of a*b interpreted as a+b+a:b. The ^ operator indicates crossing to the specified degree. For example (a+b+c)^2 is identical to (a+b+c)*(a+b+c) which in turn expands to a formula containing the main effects for a, b and c together with their second-order interactions.
See Also:
  • Constructor Details

    • FactorCrossing

      public FactorCrossing(String... factors)
      Constructor.
      Parameters:
      factors - the factors to be crossed.
    • FactorCrossing

      public FactorCrossing(int order, String... factors)
      Constructor.
      Parameters:
      order - the order of interactions.
      factors - the factors to be crossed.
  • Method Details

    • 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.
    • expand

      public List<Term> expand()
      Description copied from interface: Term
      Expands the term (e.g. FactorCrossing).
      Specified by:
      expand in interface Term
      Returns:
      the expanded terms.
    • 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.