OpenML features different task types (e.g. classification, regression), which we map to integers through this class.
Since Python 3.4 added Enums to the language, so we can update our code!
In particular, we should:
- convert the TaskType to an Enum
- refactor the name (just
TaskType is sufficient)
- update every use and type hint and doc string where
TaskType is an int to use the enum TaskType instead, for example here:
def create_task(
task_type_id: TaskType,
...
)
- bonus: make
OpenMLTask.task_type (a string representation of the task type) based on the enum directly: if task_type is your stored TaskType enum variable, the string name is accessed with task_type.name.
This issue requires little knowledge of the modules, but might be a bit of work to find different spellings of task_type.
Make sure to use your IDE for renaming (e.g. shift+F6 in PyCharm on Windows) to rename all references to a variable at once!
Use find across multiple files (e.g. PyCharm ctrl+shift+F) through all files for terms like "task_type_id" to help find variables and documentation to update.
OpenML features different task types (e.g. classification, regression), which we map to integers through this class.
Since Python 3.4 added Enums to the language, so we can update our code!
In particular, we should:
TaskTypeis sufficient)TaskTypeis anintto use the enumTaskTypeinstead, for example here:OpenMLTask.task_type(a string representation of the task type) based on the enum directly: iftask_typeis your storedTaskTypeenum variable, the string name is accessed withtask_type.name.This issue requires little knowledge of the modules, but might be a bit of work to find different spellings of
task_type.Make sure to use your IDE for renaming (e.g.
shift+F6in PyCharm on Windows) to rename all references to a variable at once!Use find across multiple files (e.g. PyCharm
ctrl+shift+F) through all files for terms like "task_type_id" to help find variables and documentation to update.