This is an automated email from the ASF dual-hosted git repository.

hui pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 6e089fb200 Add docs for udf accuracy (#7824)
6e089fb200 is described below

commit 6e089fb2005d26de1308d76bc1480e9f68444326
Author: Husaimawx <[email protected]>
AuthorDate: Mon Oct 31 22:25:45 2022 +0800

    Add docs for udf accuracy (#7824)
---
 docs/UserGuide/UDF-Library/Data-Quality.md    | 57 ++++++++++++++++++++++++++-
 docs/zh/UserGuide/UDF-Library/Data-Quality.md | 57 ++++++++++++++++++++++++++-
 2 files changed, 112 insertions(+), 2 deletions(-)

diff --git a/docs/UserGuide/UDF-Library/Data-Quality.md 
b/docs/UserGuide/UDF-Library/Data-Quality.md
index d82cd719d5..ffc8ee6c68 100644
--- a/docs/UserGuide/UDF-Library/Data-Quality.md
+++ b/docs/UserGuide/UDF-Library/Data-Quality.md
@@ -516,4 +516,59 @@ Output series:
 |2020-01-01T00:00:02.000+08:00|                      0.8833333333333333|
 |2020-01-01T00:00:32.000+08:00|                                     1.0|
 +-----------------------------+----------------------------------------+
-```
\ No newline at end of file
+```
+
+## Accuracy
+
+### Usage
+
+This function is used to calculate the Accuracy of time series based on master 
data.
+
+**Name**: Accuracy
+
+**Input Series:** Support multiple input series. The types are are in INT32 / 
INT64 / FLOAT / DOUBLE.
+
+**Parameters:**
+
++ `omega`: The window size. It is a non-negative integer whose unit is 
millisecond. By default, it will be estimated according to the distances of two 
tuples with various time differences.
++ `eta`: The distance threshold. It is a positive number. By default, it will 
be estimated according to the distance distribution of tuples in windows.
++ `k`: The number of neighbors in master data. It is a positive integer. By 
default, it will be estimated according to the tuple dis- tance of the k-th 
nearest neighbor in the master data.
+
+**Output Series**: Output a single value. The type is DOUBLE. The range is 
[0,1].
+
+### Examples
+
+Input series:
+
+```
++-----------------------------+------------+------------+------------+------------+------------+------------+
+|                         
Time|root.test.t1|root.test.t2|root.test.t3|root.test.m1|root.test.m2|root.test.m3|
++-----------------------------+------------+------------+------------+------------+------------+------------+
+|2021-07-01T12:00:01.000+08:00|        1704|     1154.55|       0.195|        
1704|     1154.55|       0.195|
+|2021-07-01T12:00:02.000+08:00|        1702|     1152.30|       0.193|        
1702|     1152.30|       0.193|
+|2021-07-01T12:00:03.000+08:00|        1702|     1148.65|       0.192|        
1702|     1148.65|       0.192|
+|2021-07-01T12:00:04.000+08:00|        1701|     1145.20|       0.194|        
1701|     1145.20|       0.194|
+|2021-07-01T12:00:07.000+08:00|        1703|     1150.55|       0.195|        
1703|     1150.55|       0.195|
+|2021-07-01T12:00:08.000+08:00|        1694|     1151.55|       0.193|        
1704|     1151.55|       0.193|
+|2021-07-01T12:01:09.000+08:00|        1705|     1153.55|       0.194|        
1705|     1153.55|       0.194|
+|2021-07-01T12:01:10.000+08:00|        1706|     1152.30|       0.190|        
1706|     1152.30|       0.190|
++-----------------------------+------------+------------+------------+------------+------------+------------+
+```
+
+SQL for query:
+
+```sql
+select Accuracy(t1,t2,t3,m1,m2,m3) from root.test
+```
+
+Output series:
+
+
+```
++-----------------------------+---------------------------------------------------------------------------------------+
+|                         
Time|Accuracy(root.test.t1,root.test.t2,root.test.t3,root.test.m1,root.test.m2,root.test.m3)|
++-----------------------------+---------------------------------------------------------------------------------------+
+|2021-07-01T12:00:01.000+08:00|                                                
                                  0.875|
++-----------------------------+---------------------------------------------------------------------------------------+
+```
+
diff --git a/docs/zh/UserGuide/UDF-Library/Data-Quality.md 
b/docs/zh/UserGuide/UDF-Library/Data-Quality.md
index 95b20fd9e7..6db92eef2b 100644
--- a/docs/zh/UserGuide/UDF-Library/Data-Quality.md
+++ b/docs/zh/UserGuide/UDF-Library/Data-Quality.md
@@ -521,4 +521,59 @@ select validity(s1,"window"="15") from root.test.d1 where 
time <= 2020-01-01 00:
 |2020-01-01T00:00:02.000+08:00|                      0.8833333333333333|
 |2020-01-01T00:00:32.000+08:00|                                     1.0|
 +-----------------------------+----------------------------------------+
-```
\ No newline at end of file
+```
+
+## Accuracy
+
+### 函数简介
+
+本函数基于主数据计算原始时间序列的准确性。
+
+**函数名**:Accuracy
+
+**输入序列:** 支持多个输入序列,类型为 INT32 / INT64 / FLOAT / DOUBLE。
+
+**参数:**
+
+- `omega`:算法窗口大小,非负整数(单位为毫秒), 在缺省情况下,算法根据不同时间差下的两个元组距离自动估计该参数。
+- `eta`:算法距离阈值,正数, 在缺省情况下,算法根据窗口中元组的距离分布自动估计该参数。
+- `k`:主数据中的近邻数量,正整数, 在缺省情况下,算法根据主数据中的k个近邻的元组距离自动估计该参数。
+
+**输出序列**:输出单个值,类型为DOUBLE,值的范围为[0,1]。
+
+### 使用示例
+
+输入序列:
+
+```
++-----------------------------+------------+------------+------------+------------+------------+------------+
+|                         
Time|root.test.t1|root.test.t2|root.test.t3|root.test.m1|root.test.m2|root.test.m3|
++-----------------------------+------------+------------+------------+------------+------------+------------+
+|2021-07-01T12:00:01.000+08:00|        1704|     1154.55|       0.195|        
1704|     1154.55|       0.195|
+|2021-07-01T12:00:02.000+08:00|        1702|     1152.30|       0.193|        
1702|     1152.30|       0.193|
+|2021-07-01T12:00:03.000+08:00|        1702|     1148.65|       0.192|        
1702|     1148.65|       0.192|
+|2021-07-01T12:00:04.000+08:00|        1701|     1145.20|       0.194|        
1701|     1145.20|       0.194|
+|2021-07-01T12:00:07.000+08:00|        1703|     1150.55|       0.195|        
1703|     1150.55|       0.195|
+|2021-07-01T12:00:08.000+08:00|        1694|     1151.55|       0.193|        
1704|     1151.55|       0.193|
+|2021-07-01T12:01:09.000+08:00|        1705|     1153.55|       0.194|        
1705|     1153.55|       0.194|
+|2021-07-01T12:01:10.000+08:00|        1706|     1152.30|       0.190|        
1706|     1152.30|       0.190|
++-----------------------------+------------+------------+------------+------------+------------+------------+
+```
+
+用于查询的 SQL 语句:
+
+```sql
+select Accuracy(t1,t2,t3,m1,m2,m3) from root.test
+```
+
+输出序列:
+
+
+```
++-----------------------------+---------------------------------------------------------------------------------------+
+|                         
Time|Accuracy(root.test.t1,root.test.t2,root.test.t3,root.test.m1,root.test.m2,root.test.m3)|
++-----------------------------+---------------------------------------------------------------------------------------+
+|2021-07-01T12:00:01.000+08:00|                                                
                                  0.875|
++-----------------------------+---------------------------------------------------------------------------------------+
+```
+

Reply via email to