(weights: Sequence[float] | None, n_rows: int)
| 49 | |
| 50 | |
| 51 | def _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 | |
| 62 | def _build_intervals( |
no outgoing calls
no test coverage detected