跳至主要內容

...大约 1 分钟

机器学习

AR

函数简介

本函数用于学习数据的自回归模型系数。

函数名: AR

输入序列: 仅支持单个输入序列,类型为 INT32 / INT64 / FLOAT / DOUBLE。

参数:

  • p:自回归模型的阶数。默认为1。

输出序列: 输出单个序列,类型为 DOUBLE。第一行对应模型的一阶系数,以此类推。

提示:

  • p应为正整数。

  • 序列中的大部分点为等间隔采样点。

  • 序列中的缺失点通过线性插值进行填补后用于学习过程。

使用示例

指定阶数

输入序列:

+-----------------------------+---------------+
|                         Time|root.test.d0.s0|
+-----------------------------+---------------+
|2020-01-01T00:00:01.000+08:00|           -4.0|
|2020-01-01T00:00:02.000+08:00|           -3.0|
|2020-01-01T00:00:03.000+08:00|           -2.0|
|2020-01-01T00:00:04.000+08:00|           -1.0|
|2020-01-01T00:00:05.000+08:00|            0.0|
|2020-01-01T00:00:06.000+08:00|            1.0|
|2020-01-01T00:00:07.000+08:00|            2.0|
|2020-01-01T00:00:08.000+08:00|            3.0|
|2020-01-01T00:00:09.000+08:00|            4.0|
+-----------------------------+---------------+

用于查询的 SQL 语句:

select ar(s0,"p"="2") from root.test.d0

输出序列:

+-----------------------------+---------------------------+
|                         Time|ar(root.test.d0.s0,"p"="2")|
+-----------------------------+---------------------------+
|1970-01-01T08:00:00.001+08:00|                     0.9429|
|1970-01-01T08:00:00.002+08:00|                    -0.2571|
+-----------------------------+---------------------------+

Copyright © 2024 The Apache Software Foundation.
Apache and the Apache feather logo are trademarks of The Apache Software Foundation

Have a question? Connect with us on QQ, WeChat, or Slack. Join the community now.