pearsonr() 函数
pearsonr()
返回归一化为 Pearson R 系数的两个表流的协方差。
函数类型签名
(on: [string], x: A, y: B) => stream[C] where C: Record
有关更多信息,请参阅 函数类型签名。
参数
x
(必需) 第一个输入流。
y
(必需) 第二个输入流。
on
(必需) 要连接的列列表。
示例
返回两个表流之间的协方差
import "generate"
stream1 =
generate.from(
count: 5,
fn: (n) => n * n,
start: 2021-01-01T00:00:00Z,
stop: 2021-01-01T00:01:00Z,
)
|> toFloat()
stream2 =
generate.from(
count: 5,
fn: (n) => n * n * n / 2,
start: 2021-01-01T00:00:00Z,
stop: 2021-01-01T00:01:00Z,
)
|> toFloat()
pearsonr(x: stream1, y: stream2, on: ["_time"])
此页是否对您有帮助?
感谢您的反馈!