Interface Terms


public interface Terms
Predefined terms.
  • Method Details

    • $

      static Term $(String x)
      Creates a variable.
      Parameters:
      x - the variable.
      Returns:
      the term.
    • dot

      static smile.data.formula.Dot dot()
      Returns the special term "." that means all columns not otherwise in the formula in the context of a data frame.
      Returns:
      the special term ".".
    • interact

      static FactorInteraction interact(String... factors)
      Factor interaction of two or more factors.
      Parameters:
      factors - the factors.
      Returns:
      the interaction term.
    • cross

      static FactorCrossing cross(String... factors)
      Factor crossing of two or more factors.
      Parameters:
      factors - the factors.
      Returns:
      the crossing term.
    • cross

      static FactorCrossing cross(int order, String... factors)
      Factor crossing of two or more factors.
      Parameters:
      order - the order of factor interactions.
      factors - the factors.
      Returns:
      the crossing term.
    • delete

      static Term delete(String x)
      Deletes a variable or the intercept ("1") from the formula.
      Parameters:
      x - the variable.
      Returns:
      the deleting term.
    • delete

      static Term delete(Term x)
      Deletes a term from the formula.
      Parameters:
      x - the term.
      Returns:
      the deleting term.
    • date

      static Date date(String x, DateFeature... features)
      Extracts date/time features.
      Parameters:
      x - the variable.
      features - the date features.
      Returns:
      the date term.
    • add

      static Term add(Term a, Term b)
      Adds two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a + b term.
    • add

      static Term add(String a, String b)
      Adds two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a + b term.
    • add

      static Term add(Term a, String b)
      Adds two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a + b term.
    • add

      static Term add(String a, Term b)
      Adds two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a + b term.
    • sub

      static Term sub(Term a, Term b)
      Subtracts two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a - b term.
    • sub

      static Term sub(String a, String b)
      Subtracts two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a - b term.
    • sub

      static Term sub(Term a, String b)
      Subtracts two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a - b term.
    • sub

      static Term sub(String a, Term b)
      Subtracts two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a - b term.
    • mul

      static Term mul(Term a, Term b)
      Multiplies two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a * b term.
    • mul

      static Term mul(String a, String b)
      Multiplies two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a * b term.
    • mul

      static Term mul(Term a, String b)
      Multiplies two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a * b term.
    • mul

      static Term mul(String a, Term b)
      Multiplies two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a * b term.
    • div

      static Term div(Term a, Term b)
      Divides two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a / b term.
    • div

      static Term div(String a, String b)
      Divides two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a / b term.
    • div

      static Term div(Term a, String b)
      Divides two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a / b term.
    • div

      static Term div(String a, Term b)
      Divides two terms.
      Parameters:
      a - the term.
      b - the term.
      Returns:
      the a / b term.
    • abs

      static Abs abs(String x)
      The abs(x) term.
      Parameters:
      x - the term.
      Returns:
      the abs(x) term.
    • abs

      static Abs abs(Term x)
      The abs(x) term.
      Parameters:
      x - the term.
      Returns:
      the abs(x) term.
    • ceil

      static DoubleFunction ceil(String x)
      The ceil(x) term.
      Parameters:
      x - the term.
      Returns:
      the ceil(x) term.
    • ceil

      static DoubleFunction ceil(Term x)
      The ceil(x) term.
      Parameters:
      x - the term.
      Returns:
      the ceil(x) term.
    • floor

      static DoubleFunction floor(String x)
      The floor(x) term.
      Parameters:
      x - the term.
      Returns:
      the floor(x) term.
    • floor

      static DoubleFunction floor(Term x)
      The floor(x) term.
      Parameters:
      x - the term.
      Returns:
      the floor(x) term.
    • round

      static smile.data.formula.Round round(String x)
      The round(x) term.
      Parameters:
      x - the term.
      Returns:
      the round(x) term.
    • round

      static smile.data.formula.Round round(Term x)
      The round(x) term.
      Parameters:
      x - the term.
      Returns:
      the round(x) term.
    • rint

      static DoubleFunction rint(String x)
      The rint(x) term.
      Parameters:
      x - the term.
      Returns:
      the rint(x) term.
    • rint

      static DoubleFunction rint(Term x)
      The rint(x) term.
      Parameters:
      x - the term.
      Returns:
      the rint(x) term.
    • exp

      static DoubleFunction exp(String x)
      The exp(x) term.
      Parameters:
      x - the term.
      Returns:
      the exp(x) term.
    • exp

      static DoubleFunction exp(Term x)
      The exp(x) term.
      Parameters:
      x - the term.
      Returns:
      the exp(x) term.
    • expm1

      static DoubleFunction expm1(String x)
      The exp(x) - 1 term.
      Parameters:
      x - the term.
      Returns:
      the exp(x) - 1 term.
    • expm1

      static DoubleFunction expm1(Term x)
      The exp(x) - 1 term.
      Parameters:
      x - the term.
      Returns:
      the exp(x) - 1 term.
    • log

      static DoubleFunction log(String x)
      The log(x) term.
      Parameters:
      x - the term.
      Returns:
      the log(x) term.
    • log

      static DoubleFunction log(Term x)
      The log(x) term.
      Parameters:
      x - the term.
      Returns:
      the log(x) term.
    • log1p

      static DoubleFunction log1p(String x)
      The log(1 + x) term.
      Parameters:
      x - the term.
      Returns:
      the log(1 + x) term.
    • log1p

      static DoubleFunction log1p(Term x)
      The log(1 + x) term.
      Parameters:
      x - the term.
      Returns:
      the log(1 + x) term.
    • log10

      static DoubleFunction log10(String x)
      The log10(x) term.
      Parameters:
      x - the term.
      Returns:
      the log10(x) term.
    • log10

      static DoubleFunction log10(Term x)
      The log10(x) term.
      Parameters:
      x - the term.
      Returns:
      the log10(x) term.
    • log2

      static DoubleFunction log2(String x)
      The log2(x) term.
      Parameters:
      x - the term.
      Returns:
      the log2(x) term.
    • log2

      static DoubleFunction log2(Term x)
      The log2(x) term.
      Parameters:
      x - the term.
      Returns:
      the log2(x) term.
    • signum

      static DoubleFunction signum(String x)
      The signum(x) term.
      Parameters:
      x - the term.
      Returns:
      the signum(x) term.
    • signum

      static DoubleFunction signum(Term x)
      The signum(x) term.
      Parameters:
      x - the term.
      Returns:
      the signum(x) term.
    • sign

      static IntFunction sign(String x)
      The sign(x) term.
      Parameters:
      x - the term.
      Returns:
      the sign(x) term.
    • sign

      static IntFunction sign(Term x)
      The sign(x) term.
      Parameters:
      x - the term.
      Returns:
      the sign(x) term.
    • sqrt

      static DoubleFunction sqrt(String x)
      The sqrt(x) term.
      Parameters:
      x - the term.
      Returns:
      the sqrt(x) term.
    • sqrt

      static DoubleFunction sqrt(Term x)
      The sqrt(x) term.
      Parameters:
      x - the term.
      Returns:
      the sqrt(x) term.
    • cbrt

      static DoubleFunction cbrt(String x)
      The cbrt(x) term.
      Parameters:
      x - the term.
      Returns:
      the cbrt(x) term.
    • cbrt

      static DoubleFunction cbrt(Term x)
      The cbrt(x) term.
      Parameters:
      x - the term.
      Returns:
      the cbrt(x) term.
    • sin

      static DoubleFunction sin(String x)
      The sin(x) term.
      Parameters:
      x - the term.
      Returns:
      the sin(x) term.
    • sin

      static DoubleFunction sin(Term x)
      The sin(x) term.
      Parameters:
      x - the term.
      Returns:
      the sin(x) term.
    • cos

      static DoubleFunction cos(String x)
      The cos(x) term.
      Parameters:
      x - the term.
      Returns:
      the cos(x) term.
    • cos

      static DoubleFunction cos(Term x)
      The cos(x) term.
      Parameters:
      x - the term.
      Returns:
      the cos(x) term.
    • tan

      static DoubleFunction tan(String x)
      The tan(x) term.
      Parameters:
      x - the term.
      Returns:
      the tan(x) term.
    • tan

      static DoubleFunction tan(Term x)
      The tan(x) term.
      Parameters:
      x - the term.
      Returns:
      the tan(x) term.
    • sinh

      static DoubleFunction sinh(String x)
      The sinh(x) term.
      Parameters:
      x - the term.
      Returns:
      the sinh(x) term.
    • sinh

      static DoubleFunction sinh(Term x)
      The sinh(x) term.
      Parameters:
      x - the term.
      Returns:
      the sinh(x) term.
    • cosh

      static DoubleFunction cosh(String x)
      The cosh(x) term.
      Parameters:
      x - the term.
      Returns:
      the cosh(x) term.
    • cosh

      static DoubleFunction cosh(Term x)
      The cosh(x) term.
      Parameters:
      x - the term.
      Returns:
      the cosh(x) term.
    • tanh

      static DoubleFunction tanh(String x)
      The tanh(x) term.
      Parameters:
      x - the term.
      Returns:
      the tanh(x) term.
    • tanh

      static DoubleFunction tanh(Term x)
      The tanh(x) term.
      Parameters:
      x - the term.
      Returns:
      the tanh(x) term.
    • asin

      static DoubleFunction asin(String x)
      The asin(x) term.
      Parameters:
      x - the term.
      Returns:
      the asin(x) term.
    • asin

      static DoubleFunction asin(Term x)
      The asin(x) term.
      Parameters:
      x - the term.
      Returns:
      the asin(x) term.
    • acos

      static DoubleFunction acos(String x)
      The acos(x) term.
      Parameters:
      x - the term.
      Returns:
      the acos(x) term.
    • acos

      static DoubleFunction acos(Term x)
      The acos(x) term.
      Parameters:
      x - the term.
      Returns:
      the acos(x) term.
    • atan

      static DoubleFunction atan(String x)
      The atan(x) term.
      Parameters:
      x - the term.
      Returns:
      the atan(x) term.
    • atan

      static DoubleFunction atan(Term x)
      The atan(x) term.
      Parameters:
      x - the term.
      Returns:
      the atan(x) term.
    • ulp

      static DoubleFunction ulp(String x)
      The ulp(x) term.
      Parameters:
      x - the term.
      Returns:
      the ulp(x) term.
    • ulp

      static DoubleFunction ulp(Term x)
      The ulp(x) term.
      Parameters:
      x - the term.
      Returns:
      the ulp(x) term.
    • val

      static Term val(boolean x)
      Returns a constant boolean term.
      Parameters:
      x - the value.
      Returns:
      the constant value term.
    • val

      static Term val(char x)
      Returns a constant char term.
      Parameters:
      x - the value.
      Returns:
      the constant value term.
    • val

      static Term val(byte x)
      Returns a constant byte term.
      Parameters:
      x - the value.
      Returns:
      the constant value term.
    • val

      static Term val(short x)
      Returns a constant short integer term.
      Parameters:
      x - the value.
      Returns:
      the constant value term.
    • val

      static Term val(int x)
      Returns a constant integer term.
      Parameters:
      x - the value.
      Returns:
      the constant value term.
    • val

      static Term val(long x)
      Returns a constant long integer term.
      Parameters:
      x - the value.
      Returns:
      the constant value term.
    • val

      static Term val(float x)
      Returns a constant single precision floating number term.
      Parameters:
      x - the value.
      Returns:
      the constant value term.
    • val

      static Term val(double x)
      Returns a constant double precision floating number term.
      Parameters:
      x - the value.
      Returns:
      the constant value term.
    • val

      static Term val(Object x)
      Returns a constant object term.
      Parameters:
      x - the object.
      Returns:
      the constant object term.
    • of

      static <T> Term of(String name, String x, ToIntFunction<T> f)
      Returns a term that applies a lambda on given variable.
      Type Parameters:
      T - the data type of input term.
      Parameters:
      name - the function name.
      x - the variable name.
      f - the lambda to apply on the variable.
      Returns:
      the term.
    • of

      static <T> Term of(String name, Term x, ToIntFunction<T> f)
      Returns a term that applies a lambda on given term.
      Type Parameters:
      T - the data type of input term.
      Parameters:
      name - the function name.
      x - the term.
      f - the lambda to apply on the term.
      Returns:
      the term.
    • of

      static <T> Term of(String name, String x, ToLongFunction<T> f)
      Returns a term that applies a lambda on given variable.
      Type Parameters:
      T - the data type of input term.
      Parameters:
      name - the function name.
      x - the variable name.
      f - the lambda to apply on the variable.
      Returns:
      the term.
    • of

      static <T> Term of(String name, Term x, ToLongFunction<T> f)
      Returns a term that applies a lambda on given term.
      Type Parameters:
      T - the data type of input term.
      Parameters:
      name - the function name.
      x - the term.
      f - the lambda to apply on the term.
      Returns:
      the term.
    • of

      static <T> Term of(String name, String x, ToDoubleFunction<T> f)
      Returns a term that applies a lambda on given variable.
      Type Parameters:
      T - the data type of input term.
      Parameters:
      name - the function name.
      x - the variable name.
      f - the lambda to apply on the variable.
      Returns:
      the term.
    • of

      static <T> Term of(String name, Term x, ToDoubleFunction<T> f)
      Returns a term that applies a lambda on given term.
      Type Parameters:
      T - the data type of input term.
      Parameters:
      name - the function name.
      x - the term.
      f - the lambda to apply on the term.
      Returns:
      the term.
    • of

      static <T, R> Term of(String name, String x, Class<R> clazz, Function<T,R> f)
      Returns a term that applies a lambda on given variable.
      Type Parameters:
      T - the data type of input term.
      R - the data type of output term.
      Parameters:
      name - the function name.
      x - the variable name.
      clazz - the class of return object.
      f - the lambda to apply on the variable.
      Returns:
      the term.
    • of

      static <T, R> Term of(String name, Term x, Class<R> clazz, Function<T,R> f)
      Returns a term that applies a lambda on given term.
      Type Parameters:
      T - the data type of input term.
      R - the data type of output term.
      Parameters:
      name - the function name.
      x - the term.
      clazz - the class of return object.
      f - the lambda to apply on the term.
      Returns:
      the term.
    • of

      static <T, U> Term of(String name, String x, String y, ToIntBiFunction<T,U> f)
      Returns a term that applies a lambda on given variables.
      Type Parameters:
      T - the data type of first input term.
      U - the data type of second input term.
      Parameters:
      name - the function name.
      x - the first parameter of function.
      y - the second parameter of function.
      f - the lambda to apply on the variables.
      Returns:
      the term.
    • of

      static <T, U> Term of(String name, Term x, Term y, ToIntBiFunction<T,U> f)
      Returns a term that applies a lambda on given terms.
      Type Parameters:
      T - the data type of first input term.
      U - the data type of second input term.
      Parameters:
      name - the function name.
      x - the first parameter of function.
      y - the second parameter of function.
      f - the lambda to apply on the terms.
      Returns:
      the term.
    • of

      static <T, U> Term of(String name, String x, String y, ToLongBiFunction<T,U> f)
      Returns a term that applies a lambda on given variables.
      Type Parameters:
      T - the data type of first input term.
      U - the data type of second input term.
      Parameters:
      name - the function name.
      x - the first parameter of function.
      y - the second parameter of function.
      f - the lambda to apply on the variables.
      Returns:
      the term.
    • of

      static <T, U> Term of(String name, Term x, Term y, ToLongBiFunction<T,U> f)
      Returns a term that applies a lambda on given terms.
      Type Parameters:
      T - the data type of first input term.
      U - the data type of second input term.
      Parameters:
      name - the function name.
      x - the first parameter of function.
      y - the second parameter of function.
      f - the lambda to apply on the terms.
      Returns:
      the term.
    • of

      static <T, U> Term of(String name, String x, String y, ToDoubleBiFunction<T,U> f)
      Returns a term that applies a lambda on given variables.
      Type Parameters:
      T - the data type of first input term.
      U - the data type of second input term.
      Parameters:
      name - the function name.
      x - the first parameter of function.
      y - the second parameter of function.
      f - the lambda to apply on the variables.
      Returns:
      the term.
    • of

      static <T, U> Term of(String name, Term x, Term y, ToDoubleBiFunction<T,U> f)
      Returns a term that applies a lambda on given terms.
      Type Parameters:
      T - the data type of first input term.
      U - the data type of second input term.
      Parameters:
      name - the function name.
      x - the first parameter of function.
      y - the second parameter of function.
      f - the lambda to apply on the terms.
      Returns:
      the term.
    • of

      static <T, U, R> Term of(String name, String x, String y, Class<R> clazz, BiFunction<T,U,R> f)
      Returns a term that applies a lambda on given variables.
      Type Parameters:
      T - the data type of first input term.
      U - the data type of second input term.
      R - the data type of output term.
      Parameters:
      name - the function name.
      x - the first parameter of function.
      y - the second parameter of function.
      clazz - the class of return object.
      f - the lambda to apply on the variables.
      Returns:
      the term.
    • of

      static <T, U, R> Term of(String name, Term x, Term y, Class<R> clazz, BiFunction<T,U,R> f)
      Returns a term that applies a lambda on given terms.
      Type Parameters:
      T - the data type of first input term.
      U - the data type of second input term.
      R - the data type of output term.
      Parameters:
      name - the function name.
      x - the first parameter of function.
      y - the second parameter of function.
      clazz - the class of return object.
      f - the lambda to apply on the terms.
      Returns:
      the term.