Skip to content

Commit 840f632

Browse files
jnothmanlesteve
authored andcommitted
DOC A glossary of concepts and API elements (scikit-learn#9517)
Skeleton for a glossary of concepts and API elements. This responds to at least three issues: * Many aspects of scikit-learn API for users and developers are known tacitly by core contributors (and the stack overflow crowd), but are not written down in a consistent place. * What is written is in an ad-hoc narrative style which may be useful for introduction, but is difficult to refer to and to maintain. * Parameters such as `n_jobs` and methods like `decision_function` are described repeatedly in documentation giving sometimes more sometimes less information. This glossary allows us to use "See :term:`the glossary <n_jobs>`." so that parameter descriptions in the API reference can remain brief (just as not every numpy operation needs to describe broadcasting).
1 parent 5e26bf9 commit 840f632

File tree

10 files changed

+1689
-18
lines changed

10 files changed

+1689
-18
lines changed

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
237237
'scipy': ('https://docs.scipy.org/doc/scipy/reference', None),
238238
'matplotlib': ('https://matplotlib.org/', None),
239+
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
239240
}
240241

241242
sphinx_gallery_conf = {

doc/developers/contributing.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,8 @@ when an estimator is ``fit`` twice to the same data,
752752
it should produce an identical model both times,
753753
hence the validation in ``fit``, not ``__init__``.
754754

755+
.. _contributing_deprecation:
756+
755757
Deprecation
756758
-----------
757759

@@ -893,6 +895,7 @@ from high-level questions to a more detailed check-list.
893895

894896
:ref:`saved_replies` includes some frequent comments that reviewers may make.
895897

898+
.. _api_overview:
896899

897900
APIs of scikit-learn objects
898901
============================
@@ -902,6 +905,9 @@ objects. In addition, to avoid the proliferation of framework code, we
902905
try to adopt simple conventions and limit to a minimum the number of
903906
methods an object must implement.
904907

908+
Elements of the scikit-learn API are described more definitively in the
909+
:ref:`glossary`.
910+
905911
Different objects
906912
-----------------
907913

@@ -1260,7 +1266,9 @@ is implemented using the ``_estimator_type`` attribute, which takes a string val
12601266
It should be ``"classifier"`` for classifiers and ``"regressor"`` for
12611267
regressors and ``"clusterer"`` for clustering methods, to work as expected.
12621268
Inheriting from ``ClassifierMixin``, ``RegressorMixin`` or ``ClusterMixin``
1263-
will set the attribute automatically.
1269+
will set the attribute automatically. When a meta-estimator needs to distinguish
1270+
among estimator types, instead of checking ``_estimator_type`` directly, helpers
1271+
like :func:`base.is_classifier` should be used.
12641272

12651273
Working notes
12661274
-------------

doc/documentation.rst

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ Documentation of scikit-learn |version|
4747
machine learning field.
4848
</blockquote>
4949
</div>
50+
<div class="span4 box">
51+
<h2><a href="glossary.html">Glossary</a></h2>
52+
<blockquote>The definitive description of key concepts
53+
and API elements for using scikit-learn and developing compatible tools.
54+
</blockquote>
55+
</div>
5056
<div class="span4 box">
5157
<h2><a href="modules/classes.html">API</a></h2>
5258
<blockquote>The exact API of all functions and classes, as given by the docstrings.
@@ -55,11 +61,6 @@ Documentation of scikit-learn |version|
5561
</blockquote>
5662
</div>
5763

58-
<div class="span4 box">
59-
<h2><a href="presentations.html">Additional Resources</a></h2>
60-
<blockquote>Talks given, slide-sets and other information relevant to scikit-learn.
61-
</blockquote>
62-
</div>
6364
</div>
6465
<!-- row -->
6566
<div class="row-fluid">
@@ -70,22 +71,27 @@ Documentation of scikit-learn |version|
7071
how to build their own estimators.
7172
</blockquote>
7273
</div>
73-
74-
<div class="span4 box">
75-
<h2><a href="tutorial/machine_learning_map/index.html">Flow Chart</a></h2>
76-
<blockquote>A graphical overview of basic areas of machine
77-
learning, and guidance which kind of algorithms
78-
to use in a given situation.
79-
</blockquote>
80-
</div>
8174
<div class="span4 box">
8275
<h2><a href="faq.html">FAQ</a></h2>
8376
<blockquote>Frequently asked questions about the project and contributing.
8477
</blockquote>
8578
</div>
79+
<div class="span4 box">
80+
<h2><a href="presentations.html">Additional Resources</a></h2>
81+
<blockquote>Talks given, slide-sets and other information relevant to scikit-learn.
82+
</blockquote>
83+
</div>
84+
8685
</div>
8786

8887
<div class="row-fluid">
88+
<div class="span4 box">
89+
<h2><a href="tutorial/machine_learning_map/index.html">Flow Chart</a></h2>
90+
<blockquote>A graphical overview of basic areas of machine
91+
learning, and guidance which kind of algorithms
92+
to use in a given situation.
93+
</blockquote>
94+
</div>
8995
<div class="span4 box">
9096
<h2><a href="related_projects.html">Related packages</a></h2>
9197
<blockquote>Other machine learning packages for Python and

doc/faq.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ program: Insert the following instructions in your main script::
280280
You can find more default on the new start methods in the `multiprocessing
281281
documentation <https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods>`_.
282282

283+
.. _faq_mkl_threading:
284+
283285
Why does my job use more cores than specified with n_jobs under OSX or Linux?
284286
-----------------------------------------------------------------------------
285287

0 commit comments

Comments
 (0)