dfp_inference_pipe
此模块功能允许将多个与推理过程相关的 DFP 管道模块整合到一个模块中。
参数 |
类型 |
描述 |
示例值 |
默认值 |
---|---|---|---|---|
batching_options |
字典 | 批处理文件的选项。 | 请参考下方 | - |
cache_dir |
字符串 | 用于缓存中间结果的目录。 | "/tmp/cache" |
- |
detection_criteria |
字典 | 用于过滤检测结果的标准。 | - | - |
inference_options |
字典 | 用于配置推理过程的选项。 | 请参考下方 | - |
preprocessing_options |
字典 | 用于预处理数据的选项。 | - | - |
stream_aggregation_options |
字典 | 用于按流聚合数据的选项。 | 请参考下方 | - |
timestamp_column_name |
字符串 | 包含时间戳的列的名称。 | "timestamp" |
- |
user_splitting_options |
字典 | 用于按用户拆分数据的选项。 | 请参考下方 | - |
write_to_file_options |
字典 | 用于将结果写入文件的选项。 | - | - |
batching_options
参数 |
类型 |
描述 |
示例值 |
默认值 |
---|---|---|---|---|
end_time |
字符串 | 要处理的时间范围的结束时间。 | "2022-01-01T00:00:00Z" |
- |
iso_date_regex_pattern |
字符串 | ISO 日期正则表达式模式。 | "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z" |
- |
parser_kwargs |
字典 | 传递给解析器的关键字参数。 | - | - |
period |
字符串 | 用于批处理数据的时间周期。 | "1D" |
- |
sampling_rate_s |
浮点数 | 采样率,单位为秒。 | "1.0" |
- |
start_time |
字符串 | 要处理的时间范围的开始时间。 | "2021-01-01T00:00:00Z" |
- |
user_splitting_options
参数 |
类型 |
描述 |
示例值 |
默认值 |
---|---|---|---|---|
fallback_username |
字符串 | 如果找不到用户的模型,则使用的备用用户。 | "generic_user" |
"generic_user" |
include_generic |
布尔值 | 在结果中包含通用模型。 | True |
True |
include_individual |
布尔值 | 在结果中包含个体模型。 | True |
False |
only_users |
列表 | 要包含在结果中的用户列表。 | ["user_a","user_b"] |
- |
skip_users |
列表 | 要从结果中排除的用户列表。 | ["user_c"] |
- |
userid_column_name |
字符串 | 列 | "用户 ID 的名称。" |
"user_id" |
参数 |
类型 |
描述 |
示例值 |
默认值 |
---|---|---|---|---|
cache_mode |
字符串 | 用于管理用户缓存的模式。设置为 batch 会在满足触发条件时刷新缓存。否则,继续聚合用户的历史记录。 |
"batch" |
batch |
min_history |
整数 | 触发新训练事件的最小历史记录 | 1 |
1 |
max_history |
整数 | 新训练事件中包含的最大历史记录 | 0 |
0 |
timestamp_column_name |
字符串 | 包含时间戳的列的名称 | "timestamp" |
timestamp |
aggregation_span |
字符串 | 新训练事件中训练数据的回溯时间跨度 | "60d" |
60d |
cache_to_disk |
布尔值 | 是否将流数据缓存到磁盘 | False |
False |
cache_dir |
字符串 | 用于缓存流数据的目录 | "./.cache" |
"./.cache" |
参数 |
类型 |
描述 |
示例值 |
默认值 |
---|---|---|---|---|
model_name_formatter |
字符串 | 模型名称的格式化程序 | "user_{username}_model" |
[必需] |
fallback_username |
字符串 | 如果找不到用户的模型,则使用的备用用户 | "generic_user" |
"generic_user" |
timestamp_column_name |
字符串 | 时间戳列的名称 | "timestamp" |
"timestamp" |
{
"timestamp_column_name": "timestamp",
"cache_dir": "/tmp/cache",
"batching_options": {
"end_time": "2022-01-01T00:00:00Z",
"iso_date_regex_pattern": "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z",
"parser_kwargs": {},
"period": "1D",
"sampling_rate_s": 1.0,
"start_time": "2021-01-01T00:00:00Z"
},
"user_splitting_options": {
"fallback_username": "generic",
"include_generic": true,
"include_individual": true,
"only_users": [
"user_a",
"user_b"
],
"skip_users": [
"user_c"
],
"userid_column_name": "user_id"
},
"stream_aggregation_options": {
"timestamp_column_name": "timestamp",
"cache_mode": "batch",
"trigger_on_min_history": true,
"aggregation_span": "1D",
"trigger_on_min_increment": true,
"cache_to_disk": false
},
"preprocessing_options": {},
"inference_options": {
"model_name_formatter": "{model_name}",
"fallback_username": "generic",
"timestamp_column_name": "timestamp"
},
"detection_criteria": {},
"write_to_file_options": {}
}