Skip to content

Commit 2deb8c3

Browse files
committed
add first pass at documentation
1 parent aaf2dbb commit 2deb8c3

File tree

68 files changed

+1803
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1803
-0
lines changed

docs/Makefile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SOURCEDIR = .
8+
BUILDDIR = _build
9+
10+
# Put it first so that "make" without argument is like "make help".
11+
help:
12+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13+
14+
.PHONY: help Makefile
15+
16+
# Catch-all target: route all unknown targets to Sphinx using the new
17+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18+
%: Makefile
19+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

+295
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,295 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Configuration file for the Sphinx documentation builder.
4+
#
5+
# This file does only contain a selection of the most common options. For a
6+
# full list see the documentation:
7+
# http://www.sphinx-doc.org/en/master/config
8+
9+
# -- Path setup --------------------------------------------------------------
10+
11+
# If extensions (or modules to document with autodoc) are in another directory,
12+
# add these directories to sys.path here. If the directory is relative to the
13+
# documentation root, use os.path.abspath to make it absolute, like shown here.
14+
#
15+
import os
16+
import sys
17+
18+
sys.path.insert(0, os.path.abspath(".."))
19+
20+
21+
# -- Project information -----------------------------------------------------
22+
23+
project = "numpy-ml"
24+
copyright = "2019, David Bourgin"
25+
author = "David Bourgin"
26+
27+
# The short X.Y version
28+
version = ""
29+
# The full version, including alpha/beta/rc tags
30+
release = ""
31+
32+
33+
# -- General configuration ---------------------------------------------------
34+
35+
# If your documentation needs a minimal Sphinx version, state it here.
36+
#
37+
# needs_sphinx = '1.0'
38+
39+
# Add any Sphinx extension module names here, as strings. They can be
40+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
41+
# ones.
42+
extensions = [
43+
"sphinx.ext.autodoc",
44+
"sphinx.ext.doctest",
45+
"sphinx.ext.intersphinx",
46+
"sphinx.ext.todo",
47+
"sphinx.ext.coverage",
48+
"sphinx.ext.mathjax",
49+
"sphinx.ext.ifconfig",
50+
"sphinx.ext.viewcode",
51+
"sphinx.ext.githubpages",
52+
"sphinx.ext.napoleon",
53+
# "numpydoc",
54+
]
55+
56+
# Napoleon settings
57+
# https://sphinxcontrib-napoleon.readthedocs.io/en/latest/sphinxcontrib.napoleon.html#sphinxcontrib.napoleon.Config
58+
napoleon_google_docstring = False
59+
napoleon_numpy_docstring = True
60+
napoleon_include_init_with_doc = False
61+
napoleon_include_private_with_doc = False
62+
napoleon_include_special_with_doc = False
63+
napoleon_use_admonition_for_examples = False
64+
napoleon_use_admonition_for_notes = False
65+
napoleon_use_admonition_for_references = False
66+
napoleon_use_ivar = True
67+
napoleon_use_param = True
68+
napoleon_use_rtype = False
69+
napoleon_use_keyword = True
70+
71+
72+
# Add any paths that contain templates here, relative to this directory.
73+
templates_path = ["_templates"]
74+
75+
# The suffix(es) of source filenames.
76+
# You can specify multiple suffix as a list of string:
77+
#
78+
# source_suffix = ['.rst', '.md']
79+
source_suffix = ".rst"
80+
81+
# The master toctree document.
82+
master_doc = "index"
83+
84+
# The language for content autogenerated by Sphinx. Refer to documentation
85+
# for a list of supported languages.
86+
#
87+
# This is also used if you do content translation via gettext catalogs.
88+
# Usually you set "language" from the command line for these cases.
89+
language = None
90+
91+
# List of patterns, relative to source directory, that match files and
92+
# directories to ignore when looking for source files.
93+
# This pattern also affects html_static_path and html_extra_path.
94+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
95+
96+
# The name of the Pygments (syntax highlighting) style to use.
97+
pygments_style = "friendly"
98+
99+
autoclass_content = "both"
100+
101+
102+
# -- Options for HTML output -------------------------------------------------
103+
104+
# The theme to use for HTML and HTML Help pages. See the documentation for
105+
# a list of builtin themes.
106+
#
107+
html_theme = "alabaster"
108+
109+
# Theme options are theme-specific and customize the look and feel of a theme
110+
# further. For a list of options available for each theme, see the
111+
# documentation.
112+
#
113+
# html_theme_options = {}
114+
115+
# Add any paths that contain custom static files (such as style sheets) here,
116+
# relative to this directory. They are copied after the builtin static files,
117+
# so a file named "default.css" will overwrite the builtin "default.css".
118+
html_static_path = ["_static"]
119+
120+
# Custom sidebar templates, must be a dictionary that maps document names
121+
# to template names.
122+
#
123+
# The default sidebars (for documents that don't match any pattern) are
124+
# defined by theme itself. Builtin themes are using these templates by
125+
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
126+
# 'searchbox.html']``.
127+
#
128+
html_sidebars = {
129+
"**": [
130+
"about.html",
131+
"navigation.html",
132+
"relations.html",
133+
"searchbox.html",
134+
"donate.html",
135+
]
136+
}
137+
138+
html_theme_options = {
139+
# 'logo': 'logo.png',
140+
"github_user": "ddbourgin",
141+
"github_repo": "numpy-ml",
142+
"description": "Machine learning, in NumPy",
143+
# 'analytics_id': "", XXX: TODO
144+
"github_button": True,
145+
"show_powered_by": False,
146+
}
147+
148+
149+
# -- Options for HTMLHelp output ---------------------------------------------
150+
151+
# Output file base name for HTML help builder.
152+
htmlhelp_basename = "numpy-mldoc"
153+
154+
155+
# -- Options for LaTeX output ------------------------------------------------
156+
157+
latex_elements = {
158+
# The paper size ('letterpaper' or 'a4paper').
159+
#
160+
# 'papersize': 'letterpaper',
161+
# The font size ('10pt', '11pt' or '12pt').
162+
#
163+
# 'pointsize': '10pt',
164+
# Additional stuff for the LaTeX preamble.
165+
#
166+
# 'preamble': '',
167+
# Latex figure (float) alignment
168+
#
169+
# 'figure_align': 'htbp',
170+
}
171+
172+
# Grouping the document tree into LaTeX files. List of tuples
173+
# (source start file, target name, title,
174+
# author, documentclass [howto, manual, or own class]).
175+
latex_documents = [
176+
(master_doc, "numpy-ml.tex", "numpy-ml Documentation", "David Bourgin", "manual")
177+
]
178+
179+
180+
# -- Options for manual page output ------------------------------------------
181+
182+
# One entry per manual page. List of tuples
183+
# (source start file, name, description, authors, manual section).
184+
man_pages = [(master_doc, "numpy-ml", "numpy-ml Documentation", [author], 1)]
185+
186+
187+
# -- Options for Texinfo output ----------------------------------------------
188+
189+
# Grouping the document tree into Texinfo files. List of tuples
190+
# (source start file, target name, title, author,
191+
# dir menu entry, description, category)
192+
texinfo_documents = [
193+
(
194+
master_doc,
195+
"numpy-ml",
196+
"numpy-ml Documentation",
197+
author,
198+
"numpy-ml",
199+
"Machine learning, in NumPy.",
200+
"Miscellaneous",
201+
)
202+
]
203+
204+
205+
# -- Options for Epub output -------------------------------------------------
206+
207+
# Bibliographic Dublin Core info.
208+
epub_title = project
209+
210+
# The unique identifier of the text. This can be a ISBN number
211+
# or the project homepage.
212+
#
213+
# epub_identifier = ''
214+
215+
# A unique identification for the text.
216+
#
217+
# epub_uid = ''
218+
219+
# A list of files that should not be packed into the epub file.
220+
epub_exclude_files = ["search.html"]
221+
222+
autodoc_member_order = "bysource"
223+
224+
225+
# -- Extension configuration -------------------------------------------------
226+
227+
# -- Options for intersphinx extension ---------------------------------------
228+
229+
# Example configuration for intersphinx: refer to the Python standard library.
230+
intersphinx_mapping = {
231+
"python": ("https://docs.python.org/", None),
232+
"numpy": ("http://docs.scipy.org/doc/numpy/", None),
233+
}
234+
235+
# -- Options for todo extension ----------------------------------------------
236+
237+
# If true, `todo` and `todoList` produce output, else they produce nothing.
238+
todo_include_todos = True
239+
240+
# -- Options for numpydocs extension -----------------------------------------
241+
# https://numpydoc.readthedocs.io/en/latest/install.html
242+
243+
# Whether to produce plot:: directives for Examples sections that contain
244+
# import matplotlib or from matplotlib import.
245+
numpydoc_use_plots = True
246+
247+
# Whether to show all members of a class in the Methods and Attributes sections
248+
# automatically. True by default.
249+
numpydoc_show_class_members = True
250+
251+
# Whether to show all inherited members of a class in the Methods and
252+
# Attributes sections automatically. If it’s false, inherited members won’t
253+
# shown. True by default.
254+
numpydoc_show_inherited_class_members = True
255+
256+
# Whether to create a Sphinx table of contents for the lists of class methods
257+
# and attributes. If a table of contents is made, Sphinx expects each entry to
258+
# have a separate page. True by default.
259+
numpydoc_class_members_toctree = False
260+
261+
# A regular expression matching citations which should be mangled to avoid
262+
# conflicts due to duplication across the documentation. Defaults to [\w-]+.
263+
numpydoc_citation_re = r"[\w-]+"
264+
265+
# Until version 0.8, parameter definitions were shown as blockquotes, rather
266+
# than in a definition list. If your styling requires blockquotes, switch this
267+
# config option to True. This option will be removed in version 0.10.
268+
numpydoc_use_blockquotes = False
269+
270+
# Whether to format the Attributes section of a class page in the same way as
271+
# the Parameter section. If it's False, the Attributes section will be
272+
# formatted as the Methods section using an autosummary table. True by default.
273+
numpydoc_attributes_as_param_list = False
274+
275+
# Whether to create cross-references for the parameter types in the Parameters,
276+
# Other Parameters, Returns and Yields sections of the docstring. False by
277+
# default.
278+
numpydoc_xref_param_type = False
279+
280+
# Mappings to fully qualified paths (or correct ReST references) for the
281+
# aliases/shortcuts used when specifying the types of parameters. The keys
282+
# should not have any spaces. Together with the intersphinx extension, you can
283+
# map to links in any documentation. The default is an empty dict. This
284+
# option depends on the numpydoc_xref_param_type option being True.
285+
numpydoc_xref_aliases = {}
286+
287+
# Words not to cross-reference. Most likely, these are common words used in
288+
# parameter type descriptions that may be confused for classes of the same
289+
# name. For example: {'type', 'optional', 'default'}. The default is an empty
290+
# set.
291+
numpydoc_xref_ignore = set([])
292+
293+
# Deprecated since version edit: your HTML template instead Whether to insert
294+
# an edit link after docstrings.
295+
numpydoc_edit_link: bool

docs/img/gmm.png

47.2 KB
Loading

docs/img/gmm_model.png

65.3 KB
Loading

docs/img/hmm_model.png

132 KB
Loading

docs/img/lda_model_smoothed.png

97.7 KB
Loading

docs/img/lda_model_unsmoothed.png

77.9 KB
Loading

docs/index.rst

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Welcome to numpy-ml
2+
===================
3+
`numpy-ml`_ is a growing collection of machine learning models, algorithms, and
4+
tools written exclusively in `NumPy`_ and the Python `standard library`_.
5+
6+
The purpose of the project is to provide reference implementations of common
7+
machine learning components for rapid prototyping and experimentation.
8+
9+
.. _numpy-ml: http://www.github.com/ddbourgin/numpy-ml
10+
.. _NumPy: http://numpy.scipy.org/
11+
.. _standard library: https://docs.python.org/3/library/
12+
13+
API Reference
14+
-------------
15+
.. toctree::
16+
:maxdepth: 3
17+
18+
numpy_ml.hmm
19+
20+
numpy_ml.gmm
21+
22+
numpy_ml.lda
23+
24+
numpy_ml.ngram
25+
26+
numpy_ml.trees
27+
28+
numpy_ml.utils
29+
30+
numpy_ml.rl_models
31+
32+
numpy_ml.neural_nets
33+
34+
numpy_ml.linear_models
35+
36+
numpy_ml.nonparametric
37+
38+
numpy_ml.preprocessing
39+
40+
##########
41+
Disclaimer
42+
##########
43+
44+
This software is provided as-is: there are no guarantees that it fits your
45+
purposes or that it is bug-free. Use it at your own risk!

docs/make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
33+
34+
:end
35+
popd

0 commit comments

Comments
 (0)