注意:以下翻译的准确性尚未经过验证。这是使用 AIP ↗ 从原始英文文本进行的机器翻译。
返回一个对单一时间序列执行线性回归的函数。
线性回归找到输入时间序列点上的最佳拟合线的参数。线性回归表示为 y = Ax + B
,其中 A
是线的斜率,B
是y截距。返回的函数将提供参数 A
和 B
。
当需要识别和量化时间序列数据中的线性趋势时,线性回归非常有用。
FunctionNode
) -> SummarizerNode
列名 | 类型 | 描述 |
---|---|---|
max_bounds.first_value | float | y=Ax+B 中斜率 (A) 的最大值。 |
max_bounds.second_value | float | y=Ax+B 中截距 (B) 的最大值。 |
min_bounds.first_value | float | y=Ax+B 中斜率 (A) 的最小值。 |
min_bounds.second_value | float | y=Ax+B 中截距 (B) 的最小值。 |
regression_fit_function. linear_regression_fit. slope | float | 线性回归拟合中 y=Ax+B 的参数 ‘A’ (斜率)。 |
regression_fit_function. linear_regression_fit. intercept | float | 线性回归拟合中 y=Ax+B 的参数 ‘B’ (截距)。 |
regression_fit_function. linear_regression_fit. statistics.rsquared | float | R平方值,指示线性回归的拟合优度。 |
此函数仅适用于数值系列。
Copied!1 2 3 4 5 6 7 8
>>> lin_regr = F.linear_regression()(series) # 使用线性回归函数拟合数据序列 >>> lin_regr.to_pandas() max_bounds.first_value max_bounds.second_value min_bounds.first_value min_bounds.second_value regression_fit_function.linear_regression_fit.intercept regression_fit_function.linear_regression_fit.slope regression_fit_function.linear_regression_fit.statistics.rsquared 0 50.0 96.0 10.0 6.0 -27.6 2.16 0.870968 # max_bounds 和 min_bounds 表示数据集的最大和最小边界值 # intercept 表示回归线的截距 # slope 表示回归线的斜率 # rsquared 是决定系数 (R²),表示模型的拟合优度