(x: Sequence[Sequence[float]])
| 19 | |
| 20 | _EPS = 1e-12 |
| 21 | |
| 22 | |
| 23 | @dataclass(frozen=True) |
| 24 | class _LinearModel: |
| 25 | coeffs: list[float] |
| 26 | intercept: float |
| 27 | |
| 28 | |
| 29 | def _as_matrix(x: Sequence[Sequence[float]]) -> list[list[float]]: |
| 30 | rows = [list(map(float, r)) for r in x] |
| 31 | if not rows: |
| 32 | raise ValueError("X cannot be empty") |
| 33 | width = len(rows[0]) |
no outgoing calls
no test coverage detected