Skip to content

Commit a223f13

Browse files
ahn1340mfeurer
authored andcommitted
examples.rst (#472)
* Add example.rst. * . * add documentation to examples; minor changes in conf.py * . * . * . * .
1 parent 8a8255f commit a223f13

16 files changed

+222
-21
lines changed

autosklearn/estimators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def fit(self, X, y,
408408
"""Fit *auto-sklearn* to given training set (X, y).
409409
410410
Fit both optimizes the machine learning models and builds an ensemble
411-
out of them. To disable ensembling, set ``ensemble_size==1``.
411+
out of them. To disable ensembling, set ``ensemble_size==0``.
412412
413413
Parameters
414414
----------
@@ -512,7 +512,7 @@ def fit(self, X, y,
512512
"""Fit *Auto-sklearn* to given training set (X, y).
513513
514514
Fit both optimizes the machine learning models and builds an ensemble
515-
out of them. To disable ensembling, set ``ensemble_size==1``.
515+
out of them. To disable ensembling, set ``ensemble_size==0``.
516516
517517
Parameters
518518
----------

doc/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ help:
5151
clean:
5252
rm -rf $(BUILDDIR)/*
5353
rm -rf generated
54+
rm -rf examples/
55+
rm -rf gen_modules/
5456

5557
html:
5658
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html

doc/api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,5 @@ Extension Interfaces
103103

104104
.. autoclass:: autosklearn.pipeline.components.base.AutoSklearnPreprocessingAlgorithm
105105
:members:
106+
107+

doc/conf.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,37 @@
4141
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary',
4242
'sphinx.ext.doctest', 'sphinx.ext.coverage',
4343
'sphinx.ext.mathjax', 'sphinx.ext.viewcode',
44+
'sphinx_gallery.gen_gallery', 'sphinx.ext.autosectionlabel',
45+
# sphinx.ext.autosexctionlabel raises duplicate label warnings
46+
# because same section headers are used multiple times throughout
47+
# the documentation.
4448
'numpydoc']
4549

50+
51+
from sphinx_gallery.sorting import ExplicitOrder, FileNameSortKey
52+
4653
# Configure the extensions
4754
numpydoc_show_class_members = False
4855
autosummary_generate = True
4956

57+
# prefix each section label with the name of the document it is in, in order to avoid
58+
# ambiguity when there are multiple same section labels in different documents.
59+
autosectionlabel_prefix_document = True
60+
61+
# Sphinx-gallery configuration.
62+
sphinx_gallery_conf = {
63+
# path to the examples
64+
'examples_dirs': '../examples',
65+
# path where to save gallery generated examples
66+
'gallery_dirs': 'examples',
67+
#TODO: fix back/forward references for the examples.
68+
#'doc_module': ('autosklearn'),
69+
#'reference_url': {
70+
# 'autosklearn': None
71+
#},
72+
#'backreferences_dir': 'gen_modules/backreferences'
73+
}
74+
5075
# Add any paths that contain templates here, relative to this directory.
5176
templates_path = ['_templates']
5277

@@ -134,6 +159,7 @@
134159
('Releases', 'releases'),
135160
('Installation', 'installation'),
136161
('Manual', 'manual'),
162+
('Examples', 'examples/index'),
137163
('API', 'api'),
138164
('Extending', 'extending'),
139165
],

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Manual
4747

4848
* :ref:`installation`
4949
* :ref:`manual`
50-
* :ref:`API`
50+
* :ref:`api`
5151
* :ref:`extending`
5252

5353

doc/manual.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ Examples
1515
*auto-sklearn* comes with the following examples which demonstrate several
1616
aspects of its usage:
1717

18-
* `Holdout <https://github.com/automl/auto-sklearn/blob/master/example/example_holdout.py>`_
19-
* `Cross-validation <https://github.com/automl/auto-sklearn/blob/master/example/example_crossvalidation.py>`_
20-
* `Parallel usage <https://github.com/automl/auto-sklearn/blob/master/example/example_parallel.py>`_
21-
* `Sequential usage <https://github.com/automl/auto-sklearn/blob/master/example/example_sequential.py>`_
22-
* `Regression <https://github.com/automl/auto-sklearn/blob/master/example/example_regression.py>`_
23-
* `Continuous and categorical data <https://github.com/automl/auto-sklearn/blob/master/example/example_feature_types.py>`_
24-
* `Using custom metrics <https://github.com/automl/auto-sklearn/blob/master/example/example_metrics.py>`_
18+
* `Holdout <examples/example_holdout.html>`_
19+
* `Cross-validation <examples/example_crossvalidation.html>`_
20+
* `Parallel usage <examples/example_parallel.html>`_
21+
* `Sequential usage <examples/example_sequential.html>`_
22+
* `Regression <examples/example_regression.html>`_
23+
* `Continuous and categorical data <examples/example_feature_types.html>`_
24+
* `Using custom metrics <examples/example_metrics.html>`_
25+
* `Random search <examples/example_random_search.html>`_
26+
* `EIPS <examples/example_eips.html>`_
2527

2628

2729
Time and memory limits

examples/README.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
:orphan:
2+
3+
.. _examples:
4+
5+
========
6+
Examples
7+
========
8+
9+
General introductory examples for *auto-sklearn* can be found here.

example/example_crossvalidation.py renamed to examples/example_crossvalidation.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
# -*- encoding: utf-8 -*-
2+
3+
4+
"""
5+
================
6+
Cross-Validation
7+
================
8+
9+
In *auto-sklearn* it is possible to use different resampling strategies
10+
by specifying the arguments ``resampling_strategy`` and
11+
``resampling_strategy_arguments``. The following example shows how to use
12+
cross-validation and how to set the folds when instantiating
13+
``AutoSklearnClassifier``.
14+
"""
15+
216
import sklearn.model_selection
317
import sklearn.datasets
418
import sklearn.metrics

example/example_eips.py renamed to examples/example_eips.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
"""
2+
====
3+
EIPS
4+
====
5+
6+
Example description goes here.
7+
"""
8+
19
import sklearn.model_selection
210
import sklearn.datasets
311
import sklearn.metrics

example/example_feature_types.py renamed to examples/example_feature_types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# -*- encoding: utf-8 -*-
2+
"""
3+
=============
4+
Feature Types
5+
=============
6+
7+
In *auto-sklearn* it is possible to specify the feature types of a dataset when
8+
calling the method :meth:`fit() <autosklearn.classification.AutoSklearnClassifier.fit>` by specifying the argument ``feat_type``.
9+
The following example demonstrates a way it can be done.
10+
"""
11+
212
import sklearn.model_selection
313
import sklearn.datasets
414
import sklearn.metrics

0 commit comments

Comments
 (0)