> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-3a82795f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 단순한(1차원) 선형 회귀를 수행합니다.

# simpleLinearRegression

<div id="simpleLinearRegression">
  ## simpleLinearRegression
</div>

도입 버전: v20.1.0

단순(1차원) 선형 회귀를 수행합니다.

**구문**

```sql theme={null}
simpleLinearRegression(x, y)
```

**인수**

* `x` — 독립 변수 값이 있는 컬럼입니다. [`Float64`](/ko/reference/data-types/float)
* `y` — 종속 변수 값이 있는 컬럼입니다. [`Float64`](/ko/reference/data-types/float)

**반환 값**

결과 직선 `y = k*x + b`의 상수 `(k, b)`를 반환합니다. [`Tuple(Float64, Float64)`](/ko/reference/data-types/tuple)

**예시**

**완전한 선형 적합**

```sql title=Query theme={null}
SELECT arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [0, 1, 2, 3]);
```

```response title=Response theme={null}
┌─arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [0, 1, 2, 3])─┐
│ (1,0)                                                             │
└───────────────────────────────────────────────────────────────────┘
```

**오프셋을 포함한 선형 적합**

```sql title=Query theme={null}
SELECT arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [3, 4, 5, 6]);
```

```response title=Response theme={null}
┌─arrayReduce('simpleLinearRegression', [0, 1, 2, 3], [3, 4, 5, 6])─┐
│ (1,3)                                                             │
└───────────────────────────────────────────────────────────────────┘
```
