Skip to content

Commit fb9f9eb

Browse files
Minor Documentation Fixes: TaskID for Example Custom Flow; Comment on Homepage; More documentation for components (#1243)
* fix task ID for Iris task * update comment on homepage * added additional documentation specific to the `components` parameter. * add change to progress.rst * Fix dataframe append being deprecated by replacing it with (backwards-compatible) pd.concat * fix logging example and add new changes to progress.rst * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix comment too long --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent bb3793d commit fb9f9eb

File tree

6 files changed

+27
-5
lines changed

6 files changed

+27
-5
lines changed

doc/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Example
3030
('estimator', tree.DecisionTreeClassifier())
3131
]
3232
)
33-
# Download the OpenML task for the german credit card dataset with 10-fold
33+
# Download the OpenML task for the pendigits dataset with 10-fold
3434
# cross-validation.
3535
task = openml.tasks.get_task(32)
3636
# Run the scikit-learn model on the task.

doc/progress.rst

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Changelog
99
0.13.1
1010
~~~~~~
1111

12+
* DOC #1241 #1229 #1231: Minor documentation fixes and resolve documentation examples not working.
1213
* ADD #1028: Add functions to delete runs, flows, datasets, and tasks (e.g., ``openml.datasets.delete_dataset``).
1314
* ADD #1144: Add locally computed results to the ``OpenMLRun`` object's representation if the run was created locally and not downloaded from the server.
1415
* ADD #1180: Improve the error message when the checksum of a downloaded dataset does not match the checksum provided by the API.

examples/30_extended/configure_logging.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@
3737

3838
import logging
3939

40-
openml.config.console_log.setLevel(logging.DEBUG)
41-
openml.config.file_log.setLevel(logging.WARNING)
40+
openml.config.set_console_log_level(logging.DEBUG)
41+
openml.config.set_file_log_level(logging.WARNING)
4242
openml.datasets.get_dataset("iris")
4343

4444
# Now the log level that was previously written to file should also be shown in the console.

examples/30_extended/custom_flow_.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
# you can use the Random Forest Classifier flow as a *subflow*. It allows for
7878
# all hyperparameters of the Random Classifier Flow to also be specified in your pipeline flow.
7979
#
80+
# Note: you can currently only specific one subflow as part of the components.
81+
#
8082
# In this example, the auto-sklearn flow is a subflow: the auto-sklearn flow is entirely executed as part of this flow.
8183
# This allows people to specify auto-sklearn hyperparameters used in this flow.
8284
# In general, using a subflow is not required.
@@ -87,6 +89,8 @@
8789
autosklearn_flow = openml.flows.get_flow(9313) # auto-sklearn 0.5.1
8890
subflow = dict(
8991
components=OrderedDict(automl_tool=autosklearn_flow),
92+
# If you do not want to reference a subflow, you can use the following:
93+
# components=OrderedDict(),
9094
)
9195

9296
####################################################################################################
@@ -124,7 +128,7 @@
124128
OrderedDict([("oml:name", "time"), ("oml:value", 120), ("oml:component", flow_id)]),
125129
]
126130

127-
task_id = 1965 # Iris Task
131+
task_id = 1200 # Iris Task
128132
task = openml.tasks.get_task(task_id)
129133
dataset_id = task.get_dataset().dataset_id
130134

openml/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def _list_all(listing_call, output_format="dict", *args, **filters):
283283
if len(result) == 0:
284284
result = new_batch
285285
else:
286-
result = result.append(new_batch, ignore_index=True)
286+
result = pd.concat([result, new_batch], ignore_index=True)
287287
else:
288288
# For output_format = 'dict' or 'object'
289289
result.update(new_batch)

tests/test_utils/test_utils.py

+17
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@ def mocked_perform_api_call(call, request_method):
1818

1919
def test_list_all(self):
2020
openml.utils._list_all(listing_call=openml.tasks.functions._list_tasks)
21+
openml.utils._list_all(
22+
listing_call=openml.tasks.functions._list_tasks, output_format="dataframe"
23+
)
24+
25+
def test_list_all_with_multiple_batches(self):
26+
res = openml.utils._list_all(
27+
listing_call=openml.tasks.functions._list_tasks, output_format="dict", batch_size=2000
28+
)
29+
# Verify that test server state is still valid for this test to work as intended
30+
# -> If the number of results is less than 2000, the test can not test the
31+
# batching operation.
32+
assert len(res) > 2000
33+
openml.utils._list_all(
34+
listing_call=openml.tasks.functions._list_tasks,
35+
output_format="dataframe",
36+
batch_size=2000,
37+
)
2138

2239
@unittest.mock.patch("openml._api_calls._perform_api_call", side_effect=mocked_perform_api_call)
2340
def test_list_all_few_results_available(self, _perform_api_call):

0 commit comments

Comments
 (0)