Skip to content

Commit c31e6ed

Browse files
committed
reworking examples a bit based on Pieter's suggestions
1 parent f0ad953 commit c31e6ed

7 files changed

Lines changed: 15 additions & 26 deletions

examples/create_upload_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
############################################################################
1616
# .. warning:: This example uploads data. For that reason, this example
17-
# connects to the test server instead. This prevents the live server from
18-
# crowding with example datasets, tasks, studies, and so on.
17+
# connects to the test server at test.openml.org. This prevents the main
18+
# server from crowding with example datasets, tasks, runs, and so on.
1919

2020
openml.config.start_using_configuration_for_example()
2121
############################################################################

examples/datasets_tutorial.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
import openml
1010
import pandas as pd
1111

12-
############################################################################
13-
# .. warning:: This example uploads data. For that reason, this example
14-
# connects to the test server instead. This prevents the live server from
15-
# crowding with example datasets, tasks, studies, and so on.
16-
17-
openml.config.start_using_configuration_for_example()
18-
1912
############################################################################
2013
# List datasets
2114
# =============
@@ -50,9 +43,8 @@
5043
# Download datasets
5144
# =================
5245

53-
# This is done based on the dataset ID ('did').
54-
dataset = openml.datasets.get_dataset(68)
55-
# NOTE: Dataset 68 exists on the test server https://test.openml.org/d/68
46+
# This is done based on the dataset ID.
47+
dataset = openml.datasets.get_dataset(1471)
5648

5749
# Print a summary
5850
print("This is dataset '%s', the target feature is '%s'" %
@@ -91,8 +83,7 @@
9183
# data file. The dataset object can be used as normal.
9284
# Whenever you use any functionality that requires the data,
9385
# such as `get_data`, the data will be downloaded.
94-
dataset = openml.datasets.get_dataset(68, download_data=False)
95-
# NOTE: Dataset 68 exists on the test server https://test.openml.org/d/68
86+
dataset = openml.datasets.get_dataset(1471, download_data=False)
9687

9788
############################################################################
9889
# Exercise 2
@@ -108,7 +99,3 @@
10899
alpha=.8,
109100
cmap='plasma'
110101
)
111-
112-
113-
############################################################################
114-
openml.config.stop_using_configuration_for_example()

examples/flows_and_runs_tutorial.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1515
#
1616
# Train a scikit-learn model on the data manually.
17+
#
1718
# .. warning:: This example uploads data. For that reason, this example
18-
# connects to the test server instead. This prevents the live server from
19-
# crowding with example datasets, tasks, studies, and so on.
19+
# connects to the test server at test.openml.org. This prevents the main
20+
# server from crowding with example datasets, tasks, runs, and so on.
2021

2122
openml.config.start_using_configuration_for_example()
2223
# NOTE: We are using dataset 68 from the test server: https://test.openml.org/d/68

examples/introduction_tutorial.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
# file must be in the directory ~/.openml/config and exist prior to
4646
# importing the openml module.
4747
# * Run the code below, replacing 'YOURKEY' with your API key.
48+
#
4849
# .. warning:: This example uploads data. For that reason, this example
4950
# connects to the test server instead. This prevents the live server from
5051
# crowding with example datasets, tasks, studies, and so on.
@@ -88,7 +89,7 @@
8889
run = openml.runs.run_model_on_task(clf, task, avoid_duplicate_runs=False)
8990
# Publish the experiment on OpenML (optional, requires an API key).
9091
# For this tutorial, our configuration publishes to the test server
91-
# as to not pollute the main server.
92+
# as to not crowd the main server with runs created by examples.
9293
myrun = run.publish()
9394
print("kNN on %s: http://test.openml.org/r/%d" % (data.name, myrun.run_id))
9495

examples/run_setup_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
3) We will verify that the obtained results are exactly the same.
2727
2828
.. warning:: This example uploads data. For that reason, this example
29-
connects to the test server instead. This prevents the live server from
30-
crowding with example datasets, tasks, studies, and so on.
29+
connects to the test server at test.openml.org. This prevents the main
30+
server from crowding with example datasets, tasks, runs, and so on.
3131
"""
3232
import logging
3333
import numpy as np

examples/sklearn/openml_run_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
############################################################################
1111
# .. warning:: This example uploads data. For that reason, this example
12-
# connects to the test server instead. This prevents the live server from
13-
# crowding with example datasets, tasks, studies, and so on.
12+
# connects to the test server at test.openml.org. This prevents the main
13+
# server from crowding with example datasets, tasks, runs, and so on.
1414

1515
openml.config.start_using_configuration_for_example()
1616
############################################################################

examples/tasks_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
############################################################################
8080
# Furthermore, we can list tasks based on the dataset id:
8181

82-
tasks = openml.tasks.list_tasks(data_id=61)
82+
tasks = openml.tasks.list_tasks(data_id=1471)
8383
tasks = pd.DataFrame.from_dict(tasks, orient='index')
8484
print("First 5 of %s tasks:" % len(tasks))
8585
pprint(tasks.head())

0 commit comments

Comments
 (0)