diff --git a/src/UserGuide/Master/Table/AI-capability/AINode_Upgrade_apache.md b/src/UserGuide/Master/Table/AI-capability/AINode_Upgrade_apache.md index 548c22f69..ddaac11b6 100644 --- a/src/UserGuide/Master/Table/AI-capability/AINode_Upgrade_apache.md +++ b/src/UserGuide/Master/Table/AI-capability/AINode_Upgrade_apache.md @@ -117,7 +117,13 @@ CREATE DATABASE etth; CREATE TABLE eg (hufl FLOAT FIELD, hull FLOAT FIELD, mufl FLOAT FIELD, mull FLOAT FIELD, lufl FLOAT FIELD, lull FLOAT FIELD, ot FLOAT FIELD) ``` -Prepare source data [ETTh1-tab](/img/ETTh1-tab.csv) +Prepare source data [ETTh1-tab](/img/ETTh1-tab.csv). + +You can import the raw data using the [import-data](../Tools-System/Data-Import-Tool_apache.md#_2-2-csv-format) script. For example: + +```bash +./tools/import-data.sh -ft csv -sql_dialect table -db etth -table eg -s ~/Desktop/model-compare-html/ETTh1-tab.csv +``` Forecast 96 future values of sensor `ot` using its latest 96 historical records: diff --git a/src/UserGuide/Master/Table/AI-capability/AINode_Upgrade_timecho.md b/src/UserGuide/Master/Table/AI-capability/AINode_Upgrade_timecho.md index c8e52b386..781be1461 100644 --- a/src/UserGuide/Master/Table/AI-capability/AINode_Upgrade_timecho.md +++ b/src/UserGuide/Master/Table/AI-capability/AINode_Upgrade_timecho.md @@ -92,19 +92,19 @@ SELECT * FROM FORECAST( * Built-in model inference does not require a registration process. By using the forecast function and specifying model_id, you can use the inference function of the model. * Parameter description -| Parameter Name | Parameter Type | Parameter Attributes | Description | Required | Notes | -|----------------|----------------|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|-------| -| model_id | Scalar parameter | String type | Unique identifier of the prediction model | Yes | | -| targets | Table parameter | SET SEMANTIC | Input data for the target variables to be predicted. IoTDB will automatically sort the data in ascending order of time before passing it to AINode. | Yes | Use SQL to describe the input data with target variables. If the input SQL is invalid, corresponding query errors will be reported. | +| Parameter Name | Parameter Type | Parameter Attributes | Description | Required | Notes | +|----------------|----------------|----------------------|-------------|----------|-------| +| model_id | Scalar parameter | String type | Unique identifier of the prediction model | Yes | | +| targets | Table parameter | SET SEMANTIC | Input data for the target variables to be predicted. IoTDB will automatically sort the data in ascending order of time before passing it to AINode. | Yes | Use SQL to describe the input data with target variables. If the input SQL is invalid, corresponding query errors will be reported. | | history_covs | Scalar parameter | String type (valid table model query SQL), default: none | Specifies historical data of covariates for this prediction task, which are used to assist in predicting target variables. AINode will not output prediction results for historical covariates. Before passing data to the model, AINode will automatically sort the data in ascending order of time. | No | 1. Query results can only contain FIELD columns; 2. Other: Different models may have specific requirements, and errors will be thrown if not met. | -| future_covs | Scalar parameter | String type (valid table model query SQL), default: none | Specifies future data of some covariates for this prediction task, which are used to assist in predicting target variables. Before passing data to the model, AINode will automatically sort the data in ascending order of time. | No | 1. Can only be specified when history_covs is set; 2. The covariate names involved must be a subset of history_covs; 3. Query results can only contain FIELD columns; 4. Other: Different models may have specific requirements, and errors will be thrown if not met. | -| auto_adapt | Scalar parameter | Boolean type, default value: true | Whether to enable adaptive processing for covariate inference.(Support from V2.0.8.2) | No | When adaptive mode is enabled: 1. If the set of future covariates (`future_covs`) is not a subset of the historical covariates (`history_covs`), any future covariates not present in the historical set will be automatically discarded. 2. If the length of any historical covariate does not match the length of the input target variable: a. If shorter, pad zeros at the beginning; b. If longer, discard the earliest data points. 3. If the length of any future covariate does not match the prediction length (`output_length`): a. If shorter, pad zeros at the end; b. If longer, discard the most recent data points. | -| output_start_time | Scalar parameter | Timestamp type. Default value: last timestamp of target variable + output_interval | Starting timestamp of output prediction points [i.e., forecast start time] | No | Must be greater than the maximum timestamp of target variable timestamps | -| output_length | Scalar parameter | INT32 type. Default value: 96 | Output window size | No | Must be greater than 0 | -| output_interval | Scalar parameter | Time interval type. Default value: (last timestamp - first timestamp of input data) / n - 1 | Time interval between output prediction points. Supported units: ns, us, ms, s, m, h, d, w | No | Must be greater than 0 | -| timecol | Scalar parameter | String type. Default value: time | Name of time column | No | Must be a TIMESTAMP column existing in targets | -| preserve_input | Scalar parameter | Boolean type. Default value: false | Whether to retain all original rows of target variable input in the output result set | No | | -| model_options | Scalar parameter | String type. Default value: empty string | Key-value pairs related to the model, such as whether to normalize the input. Different key-value pairs are separated by ';'. | No | | +| future_covs | Scalar parameter | String type (valid table model query SQL), default: none | Specifies future data of some covariates for this prediction task, which are used to assist in predicting target variables. Before passing data to the model, AINode will automatically sort the data in ascending order of time. | No | 1. Can only be specified when history_covs is set; 2. The covariate names involved must be a subset of history_covs; 3. Query results can only contain FIELD columns; 4. Other: Different models may have specific requirements, and errors will be thrown if not met. | +| auto_adapt | Scalar parameter | Boolean type, default value: true | Whether to enable adaptive processing for covariate inference.(Support from V2.0.8.2) | No | When adaptive mode is enabled: 1. If the set of future covariates (`future_covs`) is not a subset of the historical covariates (`history_covs`), any future covariates not present in the historical set will be automatically discarded. 2. If the length of any historical covariate does not match the length of the input target variable: a. If shorter, pad zeros at the beginning; b. If longer, discard the earliest data points. 3. If the length of any future covariate does not match the prediction length (`output_length`): a. If shorter, pad zeros at the end; b. If longer, discard the most recent data points. | +| output_start_time | Scalar parameter | Timestamp type. Default value: last timestamp of target variable + output_interval | Starting timestamp of output prediction points [i.e., forecast start time] | No | Must be greater than the maximum timestamp of target variable timestamps | +| output_length | Scalar parameter | INT32 type. Default value: 96 | Output window size | No | Must be greater than 0 | +| output_interval | Scalar parameter | Time interval type. Default value: (last timestamp - first timestamp of input data) / n - 1 | Time interval between output prediction points. Supported units: ns, us, ms, s, m, h, d, w | No | Must be greater than 0 | +| timecol | Scalar parameter | String type. Default value: time | Name of time column | No | Must be a TIMESTAMP column existing in targets | +| preserve_input | Scalar parameter | Boolean type. Default value: false | Whether to retain all original rows of target variable input in the output result set | No | | +| model_options | Scalar parameter | String type. Default value: empty string | Key-value pairs related to the model, such as whether to normalize the input. Different key-value pairs are separated by ';'. | No | | Notes: * **Default behavior**: Predict all columns of targets. Currently, only supports INT32, INT64, FLOAT, DOUBLE types. @@ -130,7 +130,13 @@ create database etth; create table eg (hufl FLOAT FIELD, hull FLOAT FIELD, mufl FLOAT FIELD, mull FLOAT FIELD, lufl FLOAT FIELD, lull FLOAT FIELD, ot FLOAT FIELD) ``` -Prepare original data [ETTh1-tab](/img/ETTh1-tab.csv) +Prepare original data [ETTh1-tab](/img/ETTh1-tab.csv). + +You can import the raw data using the [import-data](../Tools-System/Data-Import-Tool_timecho.md#_2-2-csv-format) script. For example: + +```bash +./tools/import-data.sh -ft csv -sql_dialect table -db etth -table eg -s ~/Desktop/model-compare-html/ETTh1-tab.csv +``` Use the first 96 rows of data from column ot in table eg to predict its future 96 rows of data. diff --git a/src/UserGuide/latest-Table/AI-capability/AINode_Upgrade_apache.md b/src/UserGuide/latest-Table/AI-capability/AINode_Upgrade_apache.md index 548c22f69..ddaac11b6 100644 --- a/src/UserGuide/latest-Table/AI-capability/AINode_Upgrade_apache.md +++ b/src/UserGuide/latest-Table/AI-capability/AINode_Upgrade_apache.md @@ -117,7 +117,13 @@ CREATE DATABASE etth; CREATE TABLE eg (hufl FLOAT FIELD, hull FLOAT FIELD, mufl FLOAT FIELD, mull FLOAT FIELD, lufl FLOAT FIELD, lull FLOAT FIELD, ot FLOAT FIELD) ``` -Prepare source data [ETTh1-tab](/img/ETTh1-tab.csv) +Prepare source data [ETTh1-tab](/img/ETTh1-tab.csv). + +You can import the raw data using the [import-data](../Tools-System/Data-Import-Tool_apache.md#_2-2-csv-format) script. For example: + +```bash +./tools/import-data.sh -ft csv -sql_dialect table -db etth -table eg -s ~/Desktop/model-compare-html/ETTh1-tab.csv +``` Forecast 96 future values of sensor `ot` using its latest 96 historical records: diff --git a/src/UserGuide/latest-Table/AI-capability/AINode_Upgrade_timecho.md b/src/UserGuide/latest-Table/AI-capability/AINode_Upgrade_timecho.md index b8fd7065a..781be1461 100644 --- a/src/UserGuide/latest-Table/AI-capability/AINode_Upgrade_timecho.md +++ b/src/UserGuide/latest-Table/AI-capability/AINode_Upgrade_timecho.md @@ -130,7 +130,13 @@ create database etth; create table eg (hufl FLOAT FIELD, hull FLOAT FIELD, mufl FLOAT FIELD, mull FLOAT FIELD, lufl FLOAT FIELD, lull FLOAT FIELD, ot FLOAT FIELD) ``` -Prepare original data [ETTh1-tab](/img/ETTh1-tab.csv) +Prepare original data [ETTh1-tab](/img/ETTh1-tab.csv). + +You can import the raw data using the [import-data](../Tools-System/Data-Import-Tool_timecho.md#_2-2-csv-format) script. For example: + +```bash +./tools/import-data.sh -ft csv -sql_dialect table -db etth -table eg -s ~/Desktop/model-compare-html/ETTh1-tab.csv +``` Use the first 96 rows of data from column ot in table eg to predict its future 96 rows of data. diff --git a/src/zh/UserGuide/Master/Table/AI-capability/AINode_Upgrade_apache.md b/src/zh/UserGuide/Master/Table/AI-capability/AINode_Upgrade_apache.md index b7a4fc62d..71d1df39c 100644 --- a/src/zh/UserGuide/Master/Table/AI-capability/AINode_Upgrade_apache.md +++ b/src/zh/UserGuide/Master/Table/AI-capability/AINode_Upgrade_apache.md @@ -118,7 +118,11 @@ create database etth; create table eg (hufl FLOAT FIELD, hull FLOAT FIELD, mufl FLOAT FIELD, mull FLOAT FIELD, lufl FLOAT FIELD, lull FLOAT FIELD, ot FLOAT FIELD) ``` -准备原始数据 [ETTh1-tab](/img/ETTh1-tab.csv) +准备原始数据 [ETTh1-tab](/img/ETTh1-tab.csv),可通过 [import-data](../Tools-System/Data-Import-Tool_apache.md#_2-2-csv-格式) 脚本导入原始数据,例如 + +```bash +./tools/import-data.sh -ft csv -sql_dialect table -db etth -table eg -s ~/Desktop/model-compare-html/ETTh1-tab.csv +``` 使用表 eg 中测点 ot 已知的 96 行数据,预测其未来的 96 行数据. diff --git a/src/zh/UserGuide/Master/Table/AI-capability/AINode_Upgrade_timecho.md b/src/zh/UserGuide/Master/Table/AI-capability/AINode_Upgrade_timecho.md index 6073128b3..e0b0227c5 100644 --- a/src/zh/UserGuide/Master/Table/AI-capability/AINode_Upgrade_timecho.md +++ b/src/zh/UserGuide/Master/Table/AI-capability/AINode_Upgrade_timecho.md @@ -37,7 +37,7 @@ AINode 是支持时序相关模型注册、管理、调用的 IoTDB 原生节点 与单独构建机器学习服务相比,具有以下优势: -* **简单易用**:无需使用 Python 或 Java 编程,使用 SQL 语句即可完成机器学习模型管理与推理的完整流程。如创建模型可使用CREATE MODEL语句、使用模型进行推理可使用 `SELECT * FROM FORECAST (...)` 语句等,使用更加简单便捷。 +* **简单易用**:无需使用 Python 或 Java 编程,使用 SQL 语句即可完成机器学习模型管理与推理的完整流程。如创建模型可使用CREATE MODEL语句、使用模型进行推理可使用` SELECT * FROM FORECAST (...) ` 语句等,使用更加简单便捷。 * **避免数据迁移**:使用 IoTDB 原生机器学习可以将存储在 IoTDB 中的数据直接应用于机器学习模型的推理,无需将数据移动到单独的机器学习服务平台,从而加速数据处理、提高安全性并降低成本。 ![](/img/h1.png) @@ -92,19 +92,19 @@ SELECT * FROM FORECAST( * 内置模型推理无需注册流程,通过 forecast 函数,指定 model\_id 就可以使用模型的推理功能。 * 参数介绍 -| 参数名 | 参数类型 | 参数属性 | 描述 | 是否必填 | 备注 | -|---------------------|-------|----------------------------|-----------------------------------------------------------------------------------------| ---------- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| model\_id | 标量参数 | 字符串类型 | 预测所用模型的唯一标识 | 是| | -| targets | 表参数 | SET SEMANTIC | 待预测目标变量的输入数据。IoTDB会自动将数据按时间升序排序再交给AINode 。 | 是 | 使用 SQL 描述带预测目标变量的输入数据,输入的 SQL 不合法时会有对应的查询报错。 | -| history\_covs | 标量参数 | 字符串类型(合法的表模型查询 SQL)默认:无 | 指定此次预测任务的协变量的历史数据,这些数据用于辅助目标变量的预测,AINode 不会对历史协变量输出预测结果。在将数据给予模型前,AINode 会自动将数据按时间升序排序。 | 否 | 1. 查询结果只能包含 FIELD 列; 2. 其它:不同模型可能会有独特要求,不符合时会抛出对应的错误。 | -| future\_covs | 标量参数 | 字符串类型(合法的表模型查询 SQL) 默认:无 | 指定此次预测任务部分协变量的未来数据,这些数据用于辅助目标变量的预测。 在将数据给予模型前,AINode 会自动将数据按时间升序排序。 | 否 | 1. 当且仅当设置 history\_covs 时可以指定此参数;2. 所涉及协变量名称必须是 history\_covs 的子集; 3. 查询结果只能包含 FIELD 列; 4. 其它:不同模型可能会有独特要求,不符合时会抛出对应的错误。 | -| auto\_adapt | 标量参数 | 布尔类型,默认值:true | 是否为协变量推理开启自适应。(V2.0.8.2起支持) | 否 | 当开启自适应时:1. 若未来协变量集合future\_covs不是历史协变量集合history\_covs的子集,将自动抛弃那些不属于历史协变量的未来协变量。2. 若某个历史协变量的长度不等于输入目标变量的长度:a. 小于时,在其头部补 0;b. 大于时,自动丢弃其最早的数据。3. 若某个未来协变量的长度不等于预测长度output\_length: a. 小于时,在其尾部补 0;b. 大于时,自动丢弃其最新的数据。 | -| output\_start\_time | 标量参数 | 时间戳类型。 默认值:目标变量最后一个时间戳 + output\_interval | 输出的预测点的起始时间戳 【即起报时间】 | 否 | 必须大于目标变量时间戳的最大值 | -| output\_length | 标量参数 | INT32 类型。 默认值:96 | 输出窗口大小 | 否 | 必须大于 0 | -| output\_interval | 标量参数 | 时间间隔类型。 默认值:(输入数据的最后一个时间戳 - 输入数据的第一个时间戳) / n - 1 | 输出的预测点之间的时间间隔 支持的单位是 ns、us、ms、s、m、h、d、w | 否 | 必须大于 0 | -| timecol | 标量参数 | 字符串类型。 默认值:time | 时间列名 | 否 | 必须为存在于 targets 中的且数据类型为 TIMESTAMP 的列 | -| preserve\_input | 标量参数 | 布尔类型。 默认值:false | 是否在输出结果集中保留目标变量输入的所有原始行 | 否 | | -| model\_options | 标量参数 | 字符串类型。 默认值:空字符串 | 模型相关的 key-value 对,比如是否需要对输入进行归一化等。不同的 key-value 对以 ';' 间隔 | 否 | | +| 参数名 | 参数类型 | 参数属性 | 描述 | 是否必填 | 备注 | +|---------------------|-------|----------------------------------------------------|-----------------------------------------------------------------------------------------| ---------- |--------------------------------------------------------------------------------------------------------------------------| +| model\_id | 标量参数 | 字符串类型 | 预测所用模型的唯一标识 | 是| | +| targets | 表参数 | SET SEMANTIC | 待预测目标变量的输入数据。IoTDB会自动将数据按时间升序排序再交给AINode 。 | 是 | 使用 SQL 描述带预测目标变量的输入数据,输入的 SQL 不合法时会有对应的查询报错。 | +| history\_covs | 标量参数 | 字符串类型(合法的表模型查询 SQL)默认:无 | 指定此次预测任务的协变量的历史数据,这些数据用于辅助目标变量的预测,AINode 不会对历史协变量输出预测结果。在将数据给予模型前,AINode 会自动将数据按时间升序排序。 | 否 | 1. 查询结果只能包含 FIELD 列; 2. 其它:不同模型可能会有独特要求,不符合时会抛出对应的错误。 | +| future\_covs | 标量参数 | 字符串类型(合法的表模型查询 SQL) 默认:无 | 指定此次预测任务部分协变量的未来数据,这些数据用于辅助目标变量的预测。 在将数据给予模型前,AINode 会自动将数据按时间升序排序。 | 否 | 1. 当且仅当设置 history\_covs 时可以指定此参数;2. 所涉及协变量名称必须是 history\_covs 的子集; 3. 查询结果只能包含 FIELD 列; 4. 其它:不同模型可能会有独特要求,不符合时会抛出对应的错误。 | +| auto\_adapt | 标量参数 | 布尔类型,默认值:true | 是否为协变量推理开启自适应。(V2.0.8.2起支持) | 否 | 当开启自适应时:1. 若未来协变量集合future\_covs不是历史协变量集合history\_covs的子集,将自动抛弃那些不属于历史协变量的未来协变量。2. 若某个历史协变量的长度不等于输入目标变量的长度:a. 小于时,在其头部补 0;b. 大于时,自动丢弃其最早的数据。3. 若某个未来协变量的长度不等于预测长度output\_length: a. 小于时,在其尾部补 0;b. 大于时,自动丢弃其最新的数据。 | +| output\_start\_time | 标量参数 | 时间戳类型。 默认值:目标变量最后一个时间戳 + output\_interval | 输出的预测点的起始时间戳 【即起报时间】 | 否 | 必须大于目标变量时间戳的最大值 | +| output\_length | 标量参数 | INT32 类型。 默认值:96 | 输出窗口大小 | 否 | 必须大于 0 | +| output\_interval | 标量参数 | 时间间隔类型。 默认值:(输入数据的最后一个时间戳 - 输入数据的第一个时间戳) / n - 1 | 输出的预测点之间的时间间隔 支持的单位是 ns、us、ms、s、m、h、d、w | 否 | 必须大于 0 | +| timecol | 标量参数 | 字符串类型。 默认值:time | 时间列名 | 否 | 必须为存在于 targets 中的且数据类型为 TIMESTAMP 的列 | +| preserve\_input | 标量参数 | 布尔类型。 默认值:false | 是否在输出结果集中保留目标变量输入的所有原始行 | 否 | | +| model\_options | 标量参数 | 字符串类型。 默认值:空字符串 | 模型相关的 key-value 对,比如是否需要对输入进行归一化等。不同的 key-value 对以 ';' 间隔 | 否 | | 说明: @@ -132,7 +132,11 @@ create database etth; create table eg (hufl FLOAT FIELD, hull FLOAT FIELD, mufl FLOAT FIELD, mull FLOAT FIELD, lufl FLOAT FIELD, lull FLOAT FIELD, ot FLOAT FIELD) ``` -准备原始数据 [ETTh1-tab](/img/ETTh1-tab.csv) +准备原始数据 [ETTh1-tab](/img/ETTh1-tab.csv),可通过 [import-data](../Tools-System/Data-Import-Tool_timecho.md#_2-2-csv-格式) 脚本导入原始数据,例如 + +```bash +./tools/import-data.sh -ft csv -sql_dialect table -db etth -table eg -s ~/Desktop/model-compare-html/ETTh1-tab.csv +``` 使用表 eg 中测点 ot 已知的 96 行数据,预测其未来的 96 行数据. diff --git a/src/zh/UserGuide/latest-Table/AI-capability/AINode_Upgrade_apache.md b/src/zh/UserGuide/latest-Table/AI-capability/AINode_Upgrade_apache.md index b7a4fc62d..71d1df39c 100644 --- a/src/zh/UserGuide/latest-Table/AI-capability/AINode_Upgrade_apache.md +++ b/src/zh/UserGuide/latest-Table/AI-capability/AINode_Upgrade_apache.md @@ -118,7 +118,11 @@ create database etth; create table eg (hufl FLOAT FIELD, hull FLOAT FIELD, mufl FLOAT FIELD, mull FLOAT FIELD, lufl FLOAT FIELD, lull FLOAT FIELD, ot FLOAT FIELD) ``` -准备原始数据 [ETTh1-tab](/img/ETTh1-tab.csv) +准备原始数据 [ETTh1-tab](/img/ETTh1-tab.csv),可通过 [import-data](../Tools-System/Data-Import-Tool_apache.md#_2-2-csv-格式) 脚本导入原始数据,例如 + +```bash +./tools/import-data.sh -ft csv -sql_dialect table -db etth -table eg -s ~/Desktop/model-compare-html/ETTh1-tab.csv +``` 使用表 eg 中测点 ot 已知的 96 行数据,预测其未来的 96 行数据. diff --git a/src/zh/UserGuide/latest-Table/AI-capability/AINode_Upgrade_timecho.md b/src/zh/UserGuide/latest-Table/AI-capability/AINode_Upgrade_timecho.md index 6965523d5..e0b0227c5 100644 --- a/src/zh/UserGuide/latest-Table/AI-capability/AINode_Upgrade_timecho.md +++ b/src/zh/UserGuide/latest-Table/AI-capability/AINode_Upgrade_timecho.md @@ -132,7 +132,11 @@ create database etth; create table eg (hufl FLOAT FIELD, hull FLOAT FIELD, mufl FLOAT FIELD, mull FLOAT FIELD, lufl FLOAT FIELD, lull FLOAT FIELD, ot FLOAT FIELD) ``` -准备原始数据 [ETTh1-tab](/img/ETTh1-tab.csv) +准备原始数据 [ETTh1-tab](/img/ETTh1-tab.csv),可通过 [import-data](../Tools-System/Data-Import-Tool_timecho.md#_2-2-csv-格式) 脚本导入原始数据,例如 + +```bash +./tools/import-data.sh -ft csv -sql_dialect table -db etth -table eg -s ~/Desktop/model-compare-html/ETTh1-tab.csv +``` 使用表 eg 中测点 ot 已知的 96 行数据,预测其未来的 96 行数据.