Feature Service API (1.0)
Tecton provides a low-latency feature server that exposes HTTP endpoints to retrieve feature values and metadata from the online store. These endpoints are typically used during model predictions. The feature servers retrieve data from the online store and perform any additional aggregations and filtering as necessary.
GetFeatures
Get Features API to retrieve feature values from Tecton's online store
Authorizations:
Request Body schema: application/json
object (GetFeaturesParameters) Parameters for get-features. Exactly one of | |||||||||||||||
|
Responses
Request samples
- Payload
{- "params": {
- "featureServiceName": "fraud_detection_feature_service",
- "workspaceName": "prod",
- "joinKeyMap": {
- "user_id": "A123",
- "ad_id": "5417"
}, - "requestContextMap": {
- "amount": 500
}, - "metadataOptions": {
- "includeSloInfo": true,
- "includeEffectiveTimes": true,
- "includeNames": true,
- "includeDataTypes": true,
- "includeServingStatus": true
}
}
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "result": {
- "features": [
- true,
- null,
- null,
- null,
- "669",
- 58.349395161290275,
- 40.13619047619047,
- 59.59825688073392,
- 28941.299999999977,
- 842.8599999999999,
- 90946.93999999996,
- [
- "892054b9598370dce846bb6e4b5805a1",
- "cc9f13814a736160984bc9896222e4d9",
- "43a9799c961de6ebb22c122d8c7eb340"
]
]
}, - "metadata": {
- "features": [
- {
- "name": "transaction_amount_is_higher_than_average.transaction_amount_is_higher_than_average",
- "dataType": {
- "type": "boolean"
}, - "status": "PRESENT"
}, - {
- "name": "merchant_fraud_rate.is_fraud_mean_1d_1d",
- "effectiveTime": "2023-05-03T00:00:00Z",
- "dataType": {
- "type": "float64"
}, - "status": "MISSING_DATA"
}, - {
- "name": "merchant_fraud_rate.is_fraud_mean_30d_1d",
- "effectiveTime": "2023-05-03T00:00:00Z",
- "dataType": {
- "type": "float64"
}, - "status": "MISSING_DATA"
}, - {
- "name": "merchant_fraud_rate.is_fraud_mean_90d_1d",
- "effectiveTime": "2023-05-03T00:00:00Z",
- "dataType": {
- "type": "float64"
}, - "status": "MISSING_DATA"
}, - {
- "name": "user_distinct_merchant_transaction_count_30d.distinct_merchant_transaction_count_30d",
- "effectiveTime": "2023-05-04T00:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": "PRESENT"
}, - {
- "name": "user_transaction_amount_metrics.amt_mean_1d_10m",
- "effectiveTime": "2023-05-04T15:50:00Z",
- "dataType": {
- "type": "float64"
}, - "status": "PRESENT"
}, - {
- "name": "user_transaction_amount_metrics.amt_mean_1h_10m",
- "effectiveTime": "2023-05-04T15:50:00Z",
- "dataType": {
- "type": "float64"
}, - "status": "PRESENT"
}, - {
- "name": "user_transaction_amount_metrics.amt_mean_3d_10m",
- "effectiveTime": "2023-05-04T15:50:00Z",
- "dataType": {
- "type": "float64"
}, - "status": "PRESENT"
}, - {
- "name": "user_transaction_amount_metrics.amt_sum_1d_10m",
- "effectiveTime": "2023-05-04T15:50:00Z",
- "dataType": {
- "type": "float64"
}, - "status": "PRESENT"
}, - {
- "name": "user_transaction_amount_metrics.amt_sum_1h_10m",
- "effectiveTime": "2023-05-04T15:50:00Z",
- "dataType": {
- "type": "float64"
}, - "status": "PRESENT"
}, - {
- "name": "user_transaction_amount_metrics.amt_sum_3d_10m",
- "effectiveTime": "2023-05-04T15:50:00Z",
- "dataType": {
- "type": "float64"
}, - "status": "PRESENT"
}, - {
- "name": "user_transaction_counts.transaction_id_last_3_1d_1d",
- "effectiveTime": "2023-05-03T00:00:00Z",
- "dataType": {
- "type": "array",
- "elementType": {
- "type": "string"
}
}, - "status": "PRESENT"
}
], - "sloInfo": {
- "sloEligible": true,
- "sloServerTimeSeconds": 0.015835683,
- "dynamodbResponseSizeBytes": 23722,
- "serverTimeSeconds": 0.016889888,
- "storeMaxLatency": 0.02687345,
- "storeResponseSizeBytes": 23722
}
}
}
GetFeaturesBatch
Batch GetFeatures API to retrieve feature values in batch from Tecton's online store. NOTE: The maximum batch size for a single batch request is 10.
Authorizations:
Request Body schema: application/json
object (GetFeaturesBatchParameters) Parameters for get-features-batch. Exactly one of | |||||||||||
|
Responses
Request samples
- Payload
{- "params": {
- "featureServiceName": "fraud_detection_feature_service",
- "requestData": [
- {
- "joinKeyMap": {
- "user_uuid": "6c423390-9a64-52c8-9bb3-bbb108c74198"
}, - "requestContextMap": {
- "amount": 2000
}
}, - {
- "joinKeyMap": {
- "user_uuid": "6c423390-9a64-52c8-9bb3-bbb108c74198"
}, - "requestContextMap": {
- "amount": 500
}
}
], - "workspaceName": "prod",
- "metadataOptions": {
- "includeSloInfo": true,
- "includeEffectiveTimes": true,
- "includeNames": true,
- "includeDataTypes": true,
- "includeServingStatus": true
}
}
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 503
- 504
{- "result": [
- {
- "features": [
- null,
- null,
- null,
- "37",
- "3",
- "138",
- "307",
- "37",
- "3",
- "138"
]
}, - {
- "features": [
- null,
- null,
- null,
- "43",
- null,
- "128",
- "254",
- "43",
- null,
- "128"
]
}
], - "metadata": {
- "features": [
- {
- "name": "user_ad_impression_counts.impression_count_1d_1h",
- "effectiveTime": "2023-05-26T18:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": [
- "MISSING_DATA",
- "MISSING_DATA"
]
}, - {
- "name": "user_ad_impression_counts.impression_count_1h_1h",
- "effectiveTime": "2023-05-26T18:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": [
- "MISSING_DATA",
- "MISSING_DATA"
]
}, - {
- "name": "user_ad_impression_counts.impression_count_3d_1h",
- "effectiveTime": "2023-05-26T18:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": [
- "MISSING_DATA",
- "MISSING_DATA"
]
}, - {
- "name": "user_click_counts.clicked_count_1d_1h",
- "effectiveTime": "2023-05-26T18:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": [
- "PRESENT",
- "PRESENT"
]
}, - {
- "name": "user_click_counts.clicked_count_1h_1h",
- "effectiveTime": "2023-05-26T18:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": [
- "PRESENT",
- "MISSING_DATA"
]
}, - {
- "name": "user_click_counts.clicked_count_3d_1h",
- "effectiveTime": "2023-05-26T18:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": [
- "PRESENT",
- "PRESENT"
]
}, - {
- "name": "user_distinct_ad_count_7d.distinct_ad_count",
- "effectiveTime": "2023-05-26T00:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": [
- "PRESENT",
- "PRESENT"
]
}, - {
- "name": "user_impression_counts.impression_count_1d_1h",
- "effectiveTime": "2023-05-26T18:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": [
- "PRESENT",
- "PRESENT"
]
}, - {
- "name": "user_impression_counts.impression_count_1h_1h",
- "effectiveTime": "2023-05-26T18:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": [
- "PRESENT",
- "MISSING_DATA"
]
}, - {
- "name": "user_impression_counts.impression_count_3d_1h",
- "effectiveTime": "2023-05-26T18:00:00Z",
- "dataType": {
- "type": "int64"
}, - "status": [
- "PRESENT",
- "PRESENT"
]
}
], - "sloInfo": [
- {
- "sloEligible": true,
- "sloServerTimeSeconds": 0.001231726,
- "dynamodbResponseSizeBytes": 1873,
- "serverTimeSeconds": 0.001231726,
- "storeMaxLatency": 0.000877174,
- "storeResponseSizeBytes": 1873
}, - {
- "sloEligible": true,
- "sloServerTimeSeconds": 0.001329688,
- "dynamodbResponseSizeBytes": 1937,
- "serverTimeSeconds": 0.001329688,
- "storeMaxLatency": 0.000791104,
- "storeResponseSizeBytes": 1937
}
], - "batchSloInfo": {
- "sloEligible": true,
- "sloServerTimeSeconds": 0.001329688,
- "serverTimeSeconds": 0.00181146,
- "storeMaxLatency": 0.000877174
}
}
}
Metadata
Get Metadata about the feature service from Tecton
Authorizations:
Request Body schema: application/json
object (FeatureServiceLocator) | |||||||
|
Responses
Request samples
- Payload
{- "params": {
- "featureServiceName": "fraud_detection_feature_service",
- "workspaceName": "prod"
}
}
Response samples
- 200
- 401
- 403
- 404
- 429
- 503
- 504
{- "featureServiceType": "DEFAULT",
- "inputJoinKeys": [
- {
- "name": "user_id",
- "dataType": {
- "type": "string"
}, - "type": "string"
}, - {
- "name": "merchant",
- "dataType": {
- "type": "string"
}, - "type": "string"
}
], - "inputRequestContextKeys": [
- {
- "name": "amt",
- "dataType": {
- "type": "float64"
}, - "type": "float64"
}
], - "featureValues": [
- {
- "name": "transaction_amount_is_higher_than_average.transaction_amount_is_higher_than_average",
- "dataType": {
- "type": "boolean"
}, - "type": "boolean"
}, - {
- "name": "merchant_fraud_rate.is_fraud_mean_1d_1d",
- "dataType": {
- "type": "float64"
}, - "type": "float64"
}, - {
- "name": "merchant_fraud_rate.is_fraud_mean_30d_1d",
- "dataType": {
- "type": "float64"
}, - "type": "float64"
}, - {
- "name": "merchant_fraud_rate.is_fraud_mean_90d_1d",
- "dataType": {
- "type": "float64"
}, - "type": "float64"
}, - {
- "name": "user_distinct_merchant_transaction_count_30d.distinct_merchant_transaction_count_30d",
- "dataType": {
- "type": "int64"
}, - "type": "int64"
}, - {
- "name": "user_transaction_amount_metrics.amt_mean_1d_10m",
- "dataType": {
- "type": "float64"
}, - "type": "float64"
}, - {
- "name": "user_transaction_amount_metrics.amt_mean_1h_10m",
- "dataType": {
- "type": "float64"
}, - "type": "float64"
}, - {
- "name": "user_transaction_amount_metrics.amt_mean_3d_10m",
- "dataType": {
- "type": "float64"
}, - "type": "float64"
}, - {
- "name": "user_transaction_amount_metrics.amt_sum_1d_10m",
- "dataType": {
- "type": "float64"
}, - "type": "float64"
}, - {
- "name": "user_transaction_amount_metrics.amt_sum_1h_10m",
- "dataType": {
- "type": "float64"
}, - "type": "float64"
}, - {
- "name": "user_transaction_amount_metrics.amt_sum_3d_10m",
- "dataType": {
- "type": "float64"
}, - "type": "float64"
}, - {
- "name": "user_transaction_counts.transaction_id_last_3_1d_1d",
- "dataType": {
- "type": "array",
- "elementType": {
- "type": "string"
}
}, - "type": "string_array"
}
]
}