メインコンテンツへスキップ

simpleLinearRegression

導入バージョン: v20.1.0 単回帰 (一変量の線形回帰) を実行します。 構文
simpleLinearRegression(x, y)
引数
  • x — 説明変数の値が入ったカラム。Float64
  • y — 従属変数の値が入ったカラム。Float64
戻り値 求められる直線 y = k*x + b の定数 (k, b) を返します。Tuple(Float64, Float64) 完全に線形なフィット
Query
SELECT arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [0, 1, 2, 3]);
Response
┌─arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [0, 1, 2, 3])─┐
│ (1,0)                                                             │
└───────────────────────────────────────────────────────────────────┘
オフセットを含む線形近似
Query
SELECT arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [3, 4, 5, 6]);
Response
┌─arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [3, 4, 5, 6])─┐
│ (1,3)                                                             │
└───────────────────────────────────────────────────────────────────┘
最終更新日 2026年6月10日