sklearn-stubs/utils/validation.pyi/ "ensure_finite" needs updates in check_X_y and check_array for sklearn >= 1.8
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 304
- Fork
- 104
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/python-type-stubs
-
Maintenance Status Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
microsoft/python-type-stubs#395 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
microsoft/python-type-stubs#345 ·
-
Inconsistent naming of stubs Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoft/python-type-stubs#315 · 1 bình luận ·
-
Unparameterized `np.ndarray` typings produce "Type of ... is partially unknown" Pyright type errors. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoft/python-type-stubs#309 · 4 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
microsoft/python-type-stubs#211 · 8 bình luận · 29 reaction ·
Tất cả issue của microsoft/python-type-stubs
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
zostera/django-bootstrap4#894 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
use-agent-os/agent-os#3276 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#117848 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
zilliztech/memsearch#759 ·