[BUG] create_task() hardcodes task_type="None" instead of inferring type string from TaskType
維護者通常 1 天內回覆
評估
研究方向
從 openml/tasks/functions.py 中第 575 行附近的 create_task() 開始,接著閱讀 TaskType 值如何對應到標準名稱。檢查 tests/test_runs/test_run.py 中第 290 行附近的任務類型比較,並新增或更新回歸測試。完成的標準是:本機建立的任務會顯示預期的標準任務類型字串,而不是 "None"。
由索引模型根據 Issue 內容生成。
描述
Description
When creating an OpenML task locally using openml.tasks.create_task(), the task object is initialized with task_type="None".
In openml/tasks/functions.py:575, the function hardcodes this placeholder string literal:
return task_cls(
task_id=None,
task_type_id=task_type,
task_type="None", # TODO: refactor to get task type string from ID.
data_set_id=dataset_id,
target_name=target_name,
estimation_procedure_id=estimation_procedure_id,
evaluation_measure=evaluation_measure,
**kwargs,
)
Because of this, task.task_type is literally the string "None" rather than the canonical task type name (e.g., "Supervised Classification", "Supervised Regression", "Clustering", "Learning Curve").
This causes:
Equality checks like if task.task_type == "Supervised Classification" (used in client code and in tests/test_runs/test_run.py:290) to evaluate to False.
Error messages and representations to display Task type 'None' (such as in openml/tasks/task.py:315).
Steps/Code to Reproduce
python
import openml
from openml.tasks import TaskType, create_task
task = create_task(
TaskType.SUPERVISED_CLASSIFICATION,
dataset_id=1,
target_name="class",
estimation_procedure_id=1,
)
print("task.task_type:", repr(task.task_type))
print("Is Supervised Classification?", task.task_type == "Supervised Classification")
Expected Results
task.task_type should be "Supervised Classification", and task.task_type == "Supervised Classification" should evaluate to True.
Actual Results
task.task_type: 'None'
Is Supervised Classification? False
Versions
OpenML: 0.16.0
Python: 3.10+
OS: Windows / Linux / macOS
- 主要語言
- Python
- 星號
- 366
- 分支
- 308
- 平均合併
- 1 天 16 小時
- 30 天內合併 PR
- 7
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
openml/openml-python 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
openml/openml-python#1777 · 1 則留言 ·
維護者通常 1 天內回覆
-
Enhancement: Add missing **kwargs support to list_setups and list_evaluations可能已有人在做 @shellyco-code 於 19 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
openml/openml-python#1753 · 1 則留言 ·
維護者通常 1 天內回覆
-
[ENH] list_estimation_procedures() should include the procedure IDs可能已有人在做 @Jayant-kernel 於 23 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
openml/openml-python#1750 · 3 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
[DOC] Update documentation for running tests with local services可能已有人在做 @nishtha-agarwal-211 於 222 天前認領。 未關閉Documentation Good First Issue
難度 2/5 1-3 小時 新手友好度 74/100
openml/openml-python#1708 · 8 則留言 ·
維護者通常 1 天內回覆
-
[MNT] Add Missing Assertions to Run Function Tests可能已有人在做 @Akarshkushwaha 於 241 天前認領。 未關閉Good First Issue module:Run testing
難度 2/5 1-3 小時 新手友好度 82/100
openml/openml-python#1646 · 9 則留言 · 3 個 reaction ·
維護者通常 1 天內回覆
查看 openml/openml-python 的全部 Issue
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 68/100
FavioVazquez/showtime#101 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 83/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
rossant/awesome-math#199 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
nautechsystems/nautilus_trader#5365 ·
維護者通常 1 天內回覆
-
Examples say cnx未關閉documentation embedded
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆