sklearn-stubs/utils/validation.pyi/ "ensure_finite" needs updates in check_X_y and check_array for sklearn >= 1.8
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 58/100
Direzione di ricerca
Open sklearn-stubs/utils/validation.pyi and inspect the check_X_y and check_array signatures. Compare their parameter names with the scikit-learn 1.8 API, then update the affected annotations so the newer keyword is represented in both functions. Done means the stubs match scikit-learn 1.8 and later for these arguments.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
In sklearn 1.8, the "enforce" arguments of check_X_y and check_array have been changed to "ensure" in order to reach a more coherent notation
"enforce" was deprecated as of 1.7, and has been dropped in 1.8.
As of now, the stub is :
def check_X_y(
X: MatrixLike | ArrayLike,
y: MatrixLike | ArrayLike,
accept_sparse: Sequence[str] | tuple[str, str] | list[str] | str | bool = False,
*,
accept_large_sparse: bool = True,
dtype: None | Sequence[type] | Literal["numeric"] | type = "numeric",
order: Literal["F", "C"] | None = None,
copy: bool = False,
force_all_finite: str | bool = True, ### This is the offending line
ensure_2d: bool = True,
allow_nd: bool = False,
multi_output: bool = False,
ensure_min_samples: Int = 1,
ensure_min_features: Int = 1,
y_numeric: bool = False,
estimator: None | str | BaseEstimator = None,
) -> tuple[Any, Any]: ...
When it should really be (for sklearn >=1.8) :
def check_X_y(
X: MatrixLike | ArrayLike,
y: MatrixLike | ArrayLike,
accept_sparse: Sequence[str] | tuple[str, str] | list[str] | str | bool = False,
*,
accept_large_sparse: bool = True,
dtype: None | Sequence[type] | Literal["numeric"] | type = "numeric",
order: Literal["F", "C"] | None = None,
copy: bool = False,
ensure_all_finite: str | bool = True, ### This is the corrected line
ensure_2d: bool = True,
allow_nd: bool = False,
multi_output: bool = False,
ensure_min_samples: Int = 1,
ensure_min_features: Int = 1,
y_numeric: bool = False,
estimator: None | str | BaseEstimator = None,
) -> tuple[Any, Any]: ...
Note : Same applies for check_array
This only applies from 1.8 and onwards
- Lingua principale
- Python
- Stelle
- 304
- Fork
- 104
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/python-type-stubs
-
Maintenance Status Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
microsoft/python-type-stubs#395 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
microsoft/python-type-stubs#345 ·
-
Inconsistent naming of stubs Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
microsoft/python-type-stubs#315 · 1 commento ·
-
Unparameterized `np.ndarray` typings produce "Type of ... is partially unknown" Pyright type errors. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
microsoft/python-type-stubs#309 · 4 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
microsoft/python-type-stubs#211 · 8 commenti · 29 reazioni ·
Tutte le issue di microsoft/python-type-stubs
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·