testing
openml.testing
#
CustomImputer
#
Bases: Imputer
Duplicate class alias for sklearn's SimpleImputer
Helps bypass the sklearn extension duplicate operation check
TestBase
#
Bases: TestCase
Base class for tests
Note#
Currently hard-codes a read-write key. Hopefully soon allows using a test server, not the production server.
setUp
#
Setup variables and temporary directories.
In particular, this methods:
- creates a temporary working directory
- figures out a path to a few static test files
- set the default server to be the test server
- set a static API key for the test server
- increases the maximal number of retries
Parameters#
n_levels : int
Number of nested directories the test is in. Necessary to resolve the path to the
files
directory, which is located directly under the tests
directory.
Source code in openml/testing.py
tearDown
#
Tear down the test
Source code in openml/testing.py
check_task_existence
#
check_task_existence(task_type: TaskType, dataset_id: int, target_name: str, **kwargs: dict[str, str | int | dict[str, str | int | TaskType]]) -> int | None
Checks if any task with exists on test server that matches the meta data.
Parameter#
task_type : openml.tasks.TaskType dataset_id : int target_name : str
Return#
int, None