Skip to content

Commit 968e251

Browse files
authored
Create dedicated extensions page (#1068)
1 parent 6e8a9db commit 968e251

5 files changed

Lines changed: 92 additions & 81 deletions

File tree

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
("User Guide", "usage"),
139139
("API", "api"),
140140
("Examples", "examples/index"),
141+
("Extensions", "extensions"),
141142
("Contributing", "contributing"),
142143
("Changelog", "progress"),
143144
],

doc/contributing.rst

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -29,70 +29,4 @@ In particular, a few ways to contribute to openml-python are:
2929

3030
.. _extensions:
3131

32-
Connecting new machine learning libraries
33-
=========================================
3432

35-
Content of the Library
36-
~~~~~~~~~~~~~~~~~~~~~~
37-
38-
To leverage support from the community and to tap in the potential of OpenML, interfacing
39-
with popular machine learning libraries is essential. However, the OpenML-Python team does
40-
not have the capacity to develop and maintain such interfaces on its own. For this, we
41-
have built an extension interface to allows others to contribute back. Building a suitable
42-
extension for therefore requires an understanding of the current OpenML-Python support.
43-
44-
The :ref:`sphx_glr_examples_20_basic_simple_flows_and_runs_tutorial.py` tutorial
45-
shows how scikit-learn currently works with OpenML-Python as an extension. The *sklearn*
46-
extension packaged with the `openml-python <https://github.com/openml/openml-python>`_
47-
repository can be used as a template/benchmark to build the new extension.
48-
49-
50-
API
51-
+++
52-
* The extension scripts must import the `openml` package and be able to interface with
53-
any function from the OpenML-Python :ref:`api`.
54-
* The extension has to be defined as a Python class and must inherit from
55-
:class:`openml.extensions.Extension`.
56-
* This class needs to have all the functions from `class Extension` overloaded as required.
57-
* The redefined functions should have adequate and appropriate docstrings. The
58-
`Sklearn Extension API :class:`openml.extensions.sklearn.SklearnExtension.html`
59-
is a good benchmark to follow.
60-
61-
62-
Interfacing with OpenML-Python
63-
++++++++++++++++++++++++++++++
64-
Once the new extension class has been defined, the openml-python module to
65-
:meth:`openml.extensions.register_extension` must be called to allow OpenML-Python to
66-
interface the new extension.
67-
68-
69-
Hosting the library
70-
~~~~~~~~~~~~~~~~~~~
71-
72-
Each extension created should be a stand-alone repository, compatible with the
73-
`OpenML-Python repository <https://github.com/openml/openml-python>`_.
74-
The extension repository should work off-the-shelf with *OpenML-Python* installed.
75-
76-
Create a `public Github repo <https://docs.github.com/en/github/getting-started-with-github/create-a-repo>`_
77-
with the following directory structure:
78-
79-
::
80-
81-
| [repo name]
82-
| |-- [extension name]
83-
| | |-- __init__.py
84-
| | |-- extension.py
85-
| | |-- config.py (optionally)
86-
87-
88-
89-
Recommended
90-
~~~~~~~~~~~
91-
* Test cases to keep the extension up to date with the `openml-python` upstream changes.
92-
* Documentation of the extension API, especially if any new functionality added to OpenML-Python's
93-
extension design.
94-
* Examples to show how the new extension interfaces and works with OpenML-Python.
95-
* Create a PR to add the new extension to the OpenML-Python API documentation.
96-
97-
98-
Happy contributing!

doc/extensions.rst

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
:orphan:
2+
3+
.. _extensions:
4+
5+
==========
6+
Extensions
7+
==========
8+
9+
OpenML-Python provides an extension interface to connect other machine learning libraries than
10+
scikit-learn to OpenML. Please check the :ref:`api_extensions` and use the
11+
scikit-learn extension in :class:`openml.extensions.sklearn.SklearnExtension` as a starting point.
12+
13+
List of extensions
14+
==================
15+
16+
Here is a list of currently maintained OpenML extensions:
17+
18+
* :class:`openml.extensions.sklearn.SklearnExtension`
19+
* `openml-keras <https://github.com/openml/openml-keras>`_
20+
* `openml-pytorch <https://github.com/openml/openml-pytorch>`_
21+
* `openml-tensorflow (for tensorflow 2+) <https://github.com/openml/openml-tensorflow>`_
22+
23+
24+
Connecting new machine learning libraries
25+
=========================================
26+
27+
Content of the Library
28+
~~~~~~~~~~~~~~~~~~~~~~
29+
30+
To leverage support from the community and to tap in the potential of OpenML, interfacing
31+
with popular machine learning libraries is essential. However, the OpenML-Python team does
32+
not have the capacity to develop and maintain such interfaces on its own. For this, we
33+
have built an extension interface to allows others to contribute back. Building a suitable
34+
extension for therefore requires an understanding of the current OpenML-Python support.
35+
36+
The :ref:`sphx_glr_examples_20_basic_simple_flows_and_runs_tutorial.py` tutorial
37+
shows how scikit-learn currently works with OpenML-Python as an extension. The *sklearn*
38+
extension packaged with the `openml-python <https://github.com/openml/openml-python>`_
39+
repository can be used as a template/benchmark to build the new extension.
40+
41+
42+
API
43+
+++
44+
* The extension scripts must import the `openml` package and be able to interface with
45+
any function from the OpenML-Python :ref:`api`.
46+
* The extension has to be defined as a Python class and must inherit from
47+
:class:`openml.extensions.Extension`.
48+
* This class needs to have all the functions from `class Extension` overloaded as required.
49+
* The redefined functions should have adequate and appropriate docstrings. The
50+
`Sklearn Extension API :class:`openml.extensions.sklearn.SklearnExtension.html`
51+
is a good benchmark to follow.
52+
53+
54+
Interfacing with OpenML-Python
55+
++++++++++++++++++++++++++++++
56+
Once the new extension class has been defined, the openml-python module to
57+
:meth:`openml.extensions.register_extension` must be called to allow OpenML-Python to
58+
interface the new extension.
59+
60+
61+
Hosting the library
62+
~~~~~~~~~~~~~~~~~~~
63+
64+
Each extension created should be a stand-alone repository, compatible with the
65+
`OpenML-Python repository <https://github.com/openml/openml-python>`_.
66+
The extension repository should work off-the-shelf with *OpenML-Python* installed.
67+
68+
Create a `public Github repo <https://docs.github.com/en/github/getting-started-with-github/create-a-repo>`_
69+
with the following directory structure:
70+
71+
::
72+
73+
| [repo name]
74+
| |-- [extension name]
75+
| | |-- __init__.py
76+
| | |-- extension.py
77+
| | |-- config.py (optionally)
78+
79+
Recommended
80+
~~~~~~~~~~~
81+
* Test cases to keep the extension up to date with the `openml-python` upstream changes.
82+
* Documentation of the extension API, especially if any new functionality added to OpenML-Python's
83+
extension design.
84+
* Examples to show how the new extension interfaces and works with OpenML-Python.
85+
* Create a PR to add the new extension to the OpenML-Python API documentation.
86+
87+
Happy contributing!

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Content
6161
* :ref:`usage`
6262
* :ref:`api`
6363
* :ref:`sphx_glr_examples`
64+
* :ref:`extensions`
6465
* :ref:`contributing`
6566
* :ref:`progress`
6667

doc/usage.rst

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -155,19 +155,7 @@ obtained on. Learn how to share your datasets in the following tutorial:
155155
Extending OpenML-Python
156156
***********************
157157

158-
OpenML-Python provides an extension interface to connect other machine learning libraries than
159-
scikit-learn to OpenML. Please check the :ref:`api_extensions` and use the
160-
scikit-learn extension in :class:`openml.extensions.sklearn.SklearnExtension` as a starting point.
161-
162-
Runtime measurement is incorporated in the OpenML sklearn-extension. Example usage and potential
163-
usage for Hyperparameter Optimisation can be found in the example tutorial:
164-
165-
* :ref:`sphx_glr_examples_30_extended_fetch_runtimes_tutorial.py`
166-
167-
168-
Here is a list of currently maintained OpenML extensions:
169-
170-
* `openml-keras <https://github.com/openml/openml-keras>`_
171-
* `openml-pytorch <https://github.com/openml/openml-pytorch>`_
172-
* `openml-tensorflow(for tensorflow 2+) <https://github.com/openml/openml-tensorflow>`_
158+
OpenML-Python provides an extension interface to connect machine learning libraries directly to
159+
the API and ships a ``scikit-learn`` extension. You can find more information in the Section
160+
:ref:`extensions`'
173161

0 commit comments

Comments
 (0)