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

Function _sample_weight

python/openquant/feature_diagnostics.py:51–59  ·  view source on GitHub ↗
(weights: Sequence[float] | None, n_rows: int)

Source from the content-addressed store, hash-verified

49
50
51def _sample_weight(weights: Sequence[float] | None, n_rows: int) -> list[float] | None:
52 if weights is None:
53 return None
54 out = [float(v) for v in weights]
55 if len(out) != n_rows:
56 raise ValueError(
57 f"sample_weight/X length mismatch: {len(out)} vs {n_rows}"
58 )
59 return out
60
61
62def _build_intervals(

Callers 4

mdi_importanceFunction · 0.85
mda_importanceFunction · 0.85
sfi_importanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected