Standard Transformer Expressions
Last updated
Last updated
Standard Transformer provides several built-in functions that are useful for common ML use-cases. These built-in functions are accessible from within expression context.
Categories | Functions |
---|---|
Geohash calculates geohash of latitude
and longitude
with the given precision
.
Geohash of location with the given precision.
S2ID calculates S2ID cell of latitude
and longitude
with the given level
.
S2ID cell of the location in certain level.
HaversineDistance calculates Haversine distance of two points (given by their latitude and longitude).
The haversine distance between 2 points in kilometer.
HaversineDistanceWithUnit calculates Haversine distance of two points (given by their latitude and longitude) and given the distance unit
The haversine distance between 2 points.
PolarAngle calculates polar angles between two points (given by their latitude and longitude) in radian.
The polar angles between 2 points in radian.
GeohashDistance will calculate haversine distance between two geohash. It will convert a geohash into the center point (latitude, longitude) of that geohash and calculate haversine distance based on that point.
Haversine Distance between two geohash calculated from the center point of that geohash
GeohashAllNeighbors will find all neighbors of geohash from all directions
List of neighbors of given geohash
GeohashNeighborForDirection will find a neighbor of geohash given the direction
Neighbor of given geohash
Given a JSON string as value, you can use JsonExtract to extract JSON value from that JSON string.
JSON value within a JSON string pointed by the first JSONPath argument.
CumulativeValue is a function that accumulates values based on the index and its predecessors. E.g., [1, 2, 3] => [1, 1+2, 1+2+3] => [1, 3, 6]
.
Array of cumulative values.
Return current local timestamp.
None
Current local timestamp.
Return number representations of the day in a week, given the timestamp and timezone.
SUNDAY(0), MONDAY(1), TUESDAY(2), WEDNESDAY(3), THURSDAY(4), FRIDAY(5), SATURDAY(6).
Day number.
Return 1 if given timestamp is weekend (Saturday or Sunday), otherwise 0.
1 if weekend, 0 if not
FormatTimestamp converts timestamp in given location into formatted date time string.
Date time.
ParseTimestamp converts timestamp in integer or string format to time.
Parsed timestamp.
ParseDateTime converts datetime given with specified format layout (e.g. RFC3339) into time.
Parsed date time.
Series expression is function that can be invoked by series (column) values in a table
Get
will retrieve a row in series based on the given index
Single series row
Suppose users have table yourTableName
Users try to retrieve index 2 for series avg_order_1_day
Standard Transformer Config:
Output: 4000
IsIn
checks whether value in a row is part of the given array, the result will be a new series that has boolean type
New Series that has boolean type and same dimension with original series
Suppose users have table yourTableName
Standard Transformer Config:
Output:
StdDev
is a function to calculate standard deviation from series values. The output will be single value
No Input
Single value with float type
Suppose users have table yourTableName
Standard Transformer Config:
Output: 0.0068475461947247
Mean
is a function to calculate mean value from series values. The output will be single value
No Input
Single value with float type
Suppose users have table yourTableName
Standard Transformer Config:
Output: 3000
Median
is a function to calculate median value from series values. The output will be single value
No Input
Single value with float type
Suppose users have table yourTableName
Standard Transformer Config:
Output: 3000
Max
is a function to find max value from series values. The output will be single value
No Input
Single value with float type
Suppose users have table yourTableName
Standard Transformer Config:
Output: 4000
MaxStr
is a function to find max value from series values. The output will be single value in string type
No Input
Single value with string type
Suppose users have table yourTableName
Standard Transformer Config:
Output: "4000"
Min
is a function to find minimum value from series values. The output will be single value in float type
No Input
Single value with float type
Suppose users have table yourTableName
Standard Transformer Config:
Output: 2000
MinStr
is a function to find minimum value from series values. The output will be single value in string type
No Input
Single value with string type
Suppose users have table yourTableName
Standard Transformer Config:
Output: "2000"
Quantile
is a function to returns the sample of x such that x is greater than or equal to the fraction p of samples
Fraction in float type
Single value with float type
Suppose users have table yourTableName
Standard Transformer Config:
Output: 9
Sum
is a function to sum all the values in the seriess. The output will be single value in float type
No Input
Single value with float type
Suppose users have table yourTableName
Standard Transformer Config:
Output: 9000
Flatten
is a function to flatten all values in a series, this is suitable for series that has list type, for non list the result will be the same with the original seriess
No Input
New Series that the value already flatten
Suppose users have table yourTableName
Standard Transformer Config:
Output:
Unique
is a function to return all values without duplication.
No Input
New Series that has unique value for each row
Suppose users have table yourTableName
Standard Transformer Config:
Output:
Output:
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
Name | Description |
---|---|
restaurant_id | avg_order_1_day | avg_cancellation_rate_30_day |
---|---|---|
Name | Description |
---|---|
restaurant_id | avg_order_1_day | avg_cancellation_rate_30_day |
---|---|---|
bool_series |
---|
restaurant_id | avg_order_1_day | avg_cancellation_rate_30_day |
---|---|---|
restaurant_id | avg_order_1_day | avg_cancellation_rate_30_day |
---|---|---|
restaurant_id | avg_order_1_day | avg_cancellation_rate_30_day |
---|---|---|
restaurant_id | avg_order_1_day | avg_cancellation_rate_30_day |
---|---|---|
restaurant_id | avg_order_1_day | avg_cancellation_rate_30_day |
---|---|---|
restaurant_id | avg_order_1_day | avg_cancellation_rate_30_day |
---|---|---|
restaurant_id | avg_order_1_day | avg_cancellation_rate_30_day |
---|---|---|
rank |
---|
restaurant_id | avg_order_1_day | avg_cancellation_rate_30_day |
---|---|---|
restaurant_id | nearby_restaurant_ids |
---|---|
restaurant_ids |
---|
restaurant_id | rating |
---|---|
unique_restaurant_id |
---|
rating |
---|