(n_features: int, feature_names: Sequence[str] | None)
| 38 | return rows |
| 39 | |
| 40 | |
| 41 | def _as_vector(y: Sequence[float], n_rows: int) -> list[float]: |
| 42 | message = "y must contain finite binary labels (0 or 1)" |
| 43 | out = [] |
| 44 | for value in y: |
| 45 | if type(value) is float or type(value) is int: |
| 46 | if value not in (0, 1): |
| 47 | raise ValueError(message) |
| 48 | out.append(float(value)) |
| 49 | continue |
| 50 | if ( |
| 51 | isinstance(value, (complex, np.complexfloating)) |
no outgoing calls
no test coverage detected