Package smile.data.formula
Interface Terms
public interface Terms
Predefined terms.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Term
Creates a variable.static Abs
Theabs(x)
term.static Abs
Theabs(x)
term.static DoubleFunction
Theacos(x)
term.static DoubleFunction
Theacos(x)
term.static Term
Adds two terms.static Term
Adds two terms.static Term
Adds two terms.static Term
Adds two terms.static DoubleFunction
Theasin(x)
term.static DoubleFunction
Theasin(x)
term.static DoubleFunction
Theatan(x)
term.static DoubleFunction
Theatan(x)
term.static DoubleFunction
Thecbrt(x)
term.static DoubleFunction
Thecbrt(x)
term.static DoubleFunction
Theceil(x)
term.static DoubleFunction
Theceil(x)
term.static DoubleFunction
Thecos(x)
term.static DoubleFunction
Thecos(x)
term.static DoubleFunction
Thecosh(x)
term.static DoubleFunction
Thecosh(x)
term.static FactorCrossing
Factor crossing of two or more factors.static FactorCrossing
Factor crossing of two or more factors.static Date
date
(String x, DateFeature... features) Extracts date/time features.static Term
Deletes a variable or the intercept ("1") from the formula.static Term
Deletes a term from the formula.static Term
Divides two terms.static Term
Divides two terms.static Term
Divides two terms.static Term
Divides two terms.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.static DoubleFunction
Theexp(x)
term.static DoubleFunction
Theexp(x)
term.static DoubleFunction
Theexp(x) - 1
term.static DoubleFunction
Theexp(x) - 1
term.static DoubleFunction
Thefloor(x)
term.static DoubleFunction
Thefloor(x)
term.static FactorInteraction
Factor interaction of two or more factors.static DoubleFunction
Thelog(x)
term.static DoubleFunction
Thelog(x)
term.static DoubleFunction
Thelog10(x)
term.static DoubleFunction
Thelog10(x)
term.static DoubleFunction
Thelog(1 + x)
term.static DoubleFunction
Thelog(1 + x)
term.static DoubleFunction
Thelog2(x)
term.static DoubleFunction
Thelog2(x)
term.static Term
Multiplies two terms.static Term
Multiplies two terms.static Term
Multiplies two terms.static Term
Multiplies two terms.static <T,
R> Term Returns a term that applies a lambda on given variable.static <T,
U, R> Term Returns a term that applies a lambda on given variables.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.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.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.static <T> Term
of
(String name, String x, ToDoubleFunction<T> f) Returns a term that applies a lambda on given variable.static <T> Term
of
(String name, String x, ToIntFunction<T> f) Returns a term that applies a lambda on given variable.static <T> Term
of
(String name, String x, ToLongFunction<T> f) Returns a term that applies a lambda on given variable.static <T,
R> Term Returns a term that applies a lambda on given term.static <T> Term
of
(String name, Term x, ToDoubleFunction<T> f) Returns a term that applies a lambda on given term.static <T> Term
of
(String name, Term x, ToIntFunction<T> f) Returns a term that applies a lambda on given term.static <T> Term
of
(String name, Term x, ToLongFunction<T> f) Returns a term that applies a lambda on given term.static <T,
U, R> Term Returns a term that applies a lambda on given terms.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.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.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.static DoubleFunction
Therint(x)
term.static DoubleFunction
Therint(x)
term.static smile.data.formula.Round
Theround(x)
term.static smile.data.formula.Round
Theround(x)
term.static IntFunction
Thesign(x)
term.static IntFunction
Thesign(x)
term.static DoubleFunction
Thesignum(x)
term.static DoubleFunction
Thesignum(x)
term.static DoubleFunction
Thesin(x)
term.static DoubleFunction
Thesin(x)
term.static DoubleFunction
Thesinh(x)
term.static DoubleFunction
Thesinh(x)
term.static DoubleFunction
Thesqrt(x)
term.static DoubleFunction
Thesqrt(x)
term.static Term
Subtracts two terms.static Term
Subtracts two terms.static Term
Subtracts two terms.static Term
Subtracts two terms.static DoubleFunction
Thetan(x)
term.static DoubleFunction
Thetan(x)
term.static DoubleFunction
Thetanh(x)
term.static DoubleFunction
Thetanh(x)
term.static DoubleFunction
Theulp(x)
term.static DoubleFunction
Theulp(x)
term.static Term
val
(boolean x) Returns a constant boolean term.static Term
val
(byte x) Returns a constant byte term.static Term
val
(char x) Returns a constant char term.static Term
val
(double x) Returns a constant double precision floating number term.static Term
val
(float x) Returns a constant single precision floating number term.static Term
val
(int x) Returns a constant integer term.static Term
val
(long x) Returns a constant long integer term.static Term
val
(short x) Returns a constant short integer term.static Term
Returns a constant object term.
-
Method Details
-
$
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
Factor interaction of two or more factors.- Parameters:
factors
- the factors.- Returns:
- the interaction term.
-
cross
Factor crossing of two or more factors.- Parameters:
factors
- the factors.- Returns:
- the crossing term.
-
cross
Factor crossing of two or more factors.- Parameters:
order
- the order of factor interactions.factors
- the factors.- Returns:
- the crossing term.
-
delete
Deletes a variable or the intercept ("1") from the formula.- Parameters:
x
- the variable.- Returns:
- the deleting term.
-
delete
Deletes a term from the formula.- Parameters:
x
- the term.- Returns:
- the deleting term.
-
date
Extracts date/time features.- Parameters:
x
- the variable.features
- the date features.- Returns:
- the date term.
-
add
Adds two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a + b
term.
-
add
Adds two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a + b
term.
-
add
Adds two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a + b
term.
-
add
Adds two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a + b
term.
-
sub
Subtracts two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a - b
term.
-
sub
Subtracts two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a - b
term.
-
sub
Subtracts two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a - b
term.
-
sub
Subtracts two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a - b
term.
-
mul
Multiplies two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a * b
term.
-
mul
Multiplies two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a * b
term.
-
mul
Multiplies two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a * b
term.
-
mul
Multiplies two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a * b
term.
-
div
Divides two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a / b
term.
-
div
Divides two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a / b
term.
-
div
Divides two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a / b
term.
-
div
Divides two terms.- Parameters:
a
- the term.b
- the term.- Returns:
- the
a / b
term.
-
abs
Theabs(x)
term.- Parameters:
x
- the term.- Returns:
- the
abs(x)
term.
-
abs
Theabs(x)
term.- Parameters:
x
- the term.- Returns:
- the
abs(x)
term.
-
ceil
Theceil(x)
term.- Parameters:
x
- the term.- Returns:
- the
ceil(x)
term.
-
ceil
Theceil(x)
term.- Parameters:
x
- the term.- Returns:
- the
ceil(x)
term.
-
floor
Thefloor(x)
term.- Parameters:
x
- the term.- Returns:
- the
floor(x)
term.
-
floor
Thefloor(x)
term.- Parameters:
x
- the term.- Returns:
- the
floor(x)
term.
-
round
Theround(x)
term.- Parameters:
x
- the term.- Returns:
- the
round(x)
term.
-
round
Theround(x)
term.- Parameters:
x
- the term.- Returns:
- the
round(x)
term.
-
rint
Therint(x)
term.- Parameters:
x
- the term.- Returns:
- the
rint(x)
term.
-
rint
Therint(x)
term.- Parameters:
x
- the term.- Returns:
- the
rint(x)
term.
-
exp
Theexp(x)
term.- Parameters:
x
- the term.- Returns:
- the
exp(x)
term.
-
exp
Theexp(x)
term.- Parameters:
x
- the term.- Returns:
- the
exp(x)
term.
-
expm1
Theexp(x) - 1
term.- Parameters:
x
- the term.- Returns:
- the
exp(x) - 1
term.
-
expm1
Theexp(x) - 1
term.- Parameters:
x
- the term.- Returns:
- the
exp(x) - 1
term.
-
log
Thelog(x)
term.- Parameters:
x
- the term.- Returns:
- the
log(x)
term.
-
log
Thelog(x)
term.- Parameters:
x
- the term.- Returns:
- the
log(x)
term.
-
log1p
Thelog(1 + x)
term.- Parameters:
x
- the term.- Returns:
- the
log(1 + x)
term.
-
log1p
Thelog(1 + x)
term.- Parameters:
x
- the term.- Returns:
- the
log(1 + x)
term.
-
log10
Thelog10(x)
term.- Parameters:
x
- the term.- Returns:
- the
log10(x)
term.
-
log10
Thelog10(x)
term.- Parameters:
x
- the term.- Returns:
- the
log10(x)
term.
-
log2
Thelog2(x)
term.- Parameters:
x
- the term.- Returns:
- the
log2(x)
term.
-
log2
Thelog2(x)
term.- Parameters:
x
- the term.- Returns:
- the
log2(x)
term.
-
signum
Thesignum(x)
term.- Parameters:
x
- the term.- Returns:
- the
signum(x)
term.
-
signum
Thesignum(x)
term.- Parameters:
x
- the term.- Returns:
- the
signum(x)
term.
-
sign
Thesign(x)
term.- Parameters:
x
- the term.- Returns:
- the
sign(x)
term.
-
sign
Thesign(x)
term.- Parameters:
x
- the term.- Returns:
- the
sign(x)
term.
-
sqrt
Thesqrt(x)
term.- Parameters:
x
- the term.- Returns:
- the
sqrt(x)
term.
-
sqrt
Thesqrt(x)
term.- Parameters:
x
- the term.- Returns:
- the
sqrt(x)
term.
-
cbrt
Thecbrt(x)
term.- Parameters:
x
- the term.- Returns:
- the
cbrt(x)
term.
-
cbrt
Thecbrt(x)
term.- Parameters:
x
- the term.- Returns:
- the
cbrt(x)
term.
-
sin
Thesin(x)
term.- Parameters:
x
- the term.- Returns:
- the
sin(x)
term.
-
sin
Thesin(x)
term.- Parameters:
x
- the term.- Returns:
- the
sin(x)
term.
-
cos
Thecos(x)
term.- Parameters:
x
- the term.- Returns:
- the
cos(x)
term.
-
cos
Thecos(x)
term.- Parameters:
x
- the term.- Returns:
- the
cos(x)
term.
-
tan
Thetan(x)
term.- Parameters:
x
- the term.- Returns:
- the
tan(x)
term.
-
tan
Thetan(x)
term.- Parameters:
x
- the term.- Returns:
- the
tan(x)
term.
-
sinh
Thesinh(x)
term.- Parameters:
x
- the term.- Returns:
- the
sinh(x)
term.
-
sinh
Thesinh(x)
term.- Parameters:
x
- the term.- Returns:
- the
sinh(x)
term.
-
cosh
Thecosh(x)
term.- Parameters:
x
- the term.- Returns:
- the
cosh(x)
term.
-
cosh
Thecosh(x)
term.- Parameters:
x
- the term.- Returns:
- the
cosh(x)
term.
-
tanh
Thetanh(x)
term.- Parameters:
x
- the term.- Returns:
- the
tanh(x)
term.
-
tanh
Thetanh(x)
term.- Parameters:
x
- the term.- Returns:
- the
tanh(x)
term.
-
asin
Theasin(x)
term.- Parameters:
x
- the term.- Returns:
- the
asin(x)
term.
-
asin
Theasin(x)
term.- Parameters:
x
- the term.- Returns:
- the
asin(x)
term.
-
acos
Theacos(x)
term.- Parameters:
x
- the term.- Returns:
- the
acos(x)
term.
-
acos
Theacos(x)
term.- Parameters:
x
- the term.- Returns:
- the
acos(x)
term.
-
atan
Theatan(x)
term.- Parameters:
x
- the term.- Returns:
- the
atan(x)
term.
-
atan
Theatan(x)
term.- Parameters:
x
- the term.- Returns:
- the
atan(x)
term.
-
ulp
Theulp(x)
term.- Parameters:
x
- the term.- Returns:
- the
ulp(x)
term.
-
ulp
Theulp(x)
term.- Parameters:
x
- the term.- Returns:
- the
ulp(x)
term.
-
val
Returns a constant boolean term.- Parameters:
x
- the value.- Returns:
- the constant value term.
-
val
Returns a constant char term.- Parameters:
x
- the value.- Returns:
- the constant value term.
-
val
Returns a constant byte term.- Parameters:
x
- the value.- Returns:
- the constant value term.
-
val
Returns a constant short integer term.- Parameters:
x
- the value.- Returns:
- the constant value term.
-
val
Returns a constant integer term.- Parameters:
x
- the value.- Returns:
- the constant value term.
-
val
Returns a constant long integer term.- Parameters:
x
- the value.- Returns:
- the constant value term.
-
val
Returns a constant single precision floating number term.- Parameters:
x
- the value.- Returns:
- the constant value term.
-
val
Returns a constant double precision floating number term.- Parameters:
x
- the value.- Returns:
- the constant value term.
-
val
Returns a constant object term.- Parameters:
x
- the object.- Returns:
- the constant object term.
-
of
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
-