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

Function _feature_names

python/openquant/feature_diagnostics.py:40–48  ·  view source on GitHub ↗
(n_features: int, feature_names: Sequence[str] | None)

Source from the content-addressed store, hash-verified

38
39
40def _feature_names(n_features: int, feature_names: Sequence[str] | None) -> list[str]:
41 if feature_names is None:
42 return [f"f{i}" for i in range(n_features)]
43 out = [str(v) for v in feature_names]
44 if len(out) != n_features:
45 raise ValueError(
46 f"feature_names length mismatch: expected {n_features}, got {len(out)}"
47 )
48 return out
49
50
51def _sample_weight(weights: Sequence[float] | None, n_rows: int) -> list[float] | None:

Callers 5

mdi_importanceFunction · 0.85
mda_importanceFunction · 0.85
sfi_importanceFunction · 0.85
feature_screen_reportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected