config
Store module level information like the API key, cache directory and the server
ConfigurationForExamples
¶
Allows easy switching to and from a test configuration, used for examples.
Source code in openml/config.py
start_using_configuration_for_example()
classmethod
¶
Sets the configuration to connect to the test server with valid apikey.
To configuration as was before this call is stored, and can be recovered
by using the stop_use_example_configuration
method.
Source code in openml/config.py
stop_using_configuration_for_example()
classmethod
¶
Return to configuration as it was before start_use_example_configuration
.
Source code in openml/config.py
get_cache_directory()
¶
Get the current cache directory.
This gets the cache directory for the current server relative
to the root cache directory that can be set via
set_root_cache_directory()
. The cache directory is the
root_cache_directory
with additional information on which
subdirectory to use based on the server name. By default it is
root_cache_directory / org / openml / www
for the standard
OpenML.org server and is defined as
root_cache_directory / top-level domain / second-level domain /
hostname
```
Returns¶
cachedir : string The current cache directory.
Source code in openml/config.py
get_server_base_url()
¶
Return the base URL of the currently configured server.
Turns "https://www.openml.org/api/v1/xml"
in "https://www.openml.org/"
Returns:
Type | Description |
---|---|
str
|
|
set_console_log_level(console_output_level)
¶
Set console output to the desired level and register it with openml logger if needed.
Source code in openml/config.py
set_field_in_config_file(field, value)
¶
Overwrites the field
in the configuration file with the new value
.
Source code in openml/config.py
set_file_log_level(file_output_level)
¶
Set file output to the desired level and register it with openml logger if needed.
Source code in openml/config.py
set_root_cache_directory(root_cache_directory)
¶
Set module-wide base cache directory.
Sets the root cache directory, wherin the cache directories are
created to store content from different OpenML servers. For example,
by default, cached data for the standard OpenML.org server is stored
at root_cache_directory / org / openml / www
, and the general
pattern is root_cache_directory / top-level domain / second-level
domain / hostname
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
root_cache_directory
|
string
|
Path to use as cache directory. |
required |
See Also
get_cache_directory