MCPcopy Create free account
hub / github.com/Open-Quant/openquant / _as_matrix

Function _as_matrix

python/openquant/feature_diagnostics.py:21–30  ·  view source on GitHub ↗
(x: Sequence[Sequence[float]])

Source from the content-addressed store, hash-verified

19
20_EPS = 1e-12
21
22
23@dataclass(frozen=True)
24class _LinearModel:
25 coeffs: list[float]
26 intercept: float
27
28
29def _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])

Callers 5

mdi_importanceFunction · 0.85
mda_importanceFunction · 0.85
sfi_importanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected