stub for sklearn.datasets.load_iris is missing a return type option

Đang mở
#345 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
machine-learning

Hướng nghiên cứu

Search the sklearn.datasets stubs for the load_iris entry point and compare its return annotation with the linked documentation. Update the annotation to represent the return_X_y alternatives, then run the repository’s stub or type-check validation if available; it is done when both documented return forms are represented.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

The Returns section of the docstring for sklearn.datasets.load_iris() has two options:

  1. An sklearn.utils.Bunch, if return_X_y is False
  2. A tuple[ndarray, ndarray] if return_X_y is True

The type stub for the function is

def load_iris(*, return_X_y: bool = False, as_frame: bool = False) -> tuple[Bunch, tuple]: ...

but I believe it should be:

def load_iris(*, return_X_y: bool = False, as_frame: bool = False) -> Bunch | tuple[ndarray, ndarray]: ...

or at least:

def load_iris(*, return_X_y: bool = False, as_frame: bool = False) -> Bunch | tuple: ...

which might be all we can get with parsing.

This might not be the only case of this in the codebase, but unfortunately I just have enough time to write this ticket. Normally I like to come with a bit more information, sorry about that.

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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/python-type-stubs

Tất cả issue của microsoft/python-type-stubs

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.