Skip to content

Commit

Permalink
initialized repository with boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
bfortuner committed Apr 20, 2017
1 parent dd06cae commit 83cdb16
Show file tree
Hide file tree
Showing 54 changed files with 2,449 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
*~
_build/
docs/_build/
87 changes: 85 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,85 @@
# ml-cheatsheet
Cheatsheet for machine learning terms and concepts
# Machine Learning Cheatsheet

[Visit The Glossary!](http://ml-glossary.readthedocs.io/en/latest/)

## How To Contribute

1. Clone Repo
```
git clone https://github.com/bfortuner/ml-glossary
```

2. Install Dependencies
```
# Assumes you have the usual suspects installed: numpy, scipy, etc..
pip install sphinx sphinx-autobuild
pip install sphinx_rtd_theme
```

3. Preview Changes
```
cd docs
make html
```

4. Verify your changes by opening the `index.html` file in `_build/`

5. [Submit Pull Request](https://help.github.com/articles/creating-a-pull-request/)



## Style Guide

Each entry in the glossary MUST include the following at a minimum:

1. **Concise explanation** - as short as possible, but no shorter
2. **Citations** - Papers, Tutorials, etc.

Excellent entries will also include:

1. **Visuals** - diagrams, charts, animations, images
2. **Code** - python/numpy snippets, classes, or functions
3. **Equations** - Formatted with Latex

The goal of the cheatsheet is to present content in the most accessible way possible, with a heavy emphasis on visuals and interactive diagrams. That said, in the spirit of rapid prototyping, it's okay to to submit a "rough draft" without visuals or code. We expect other readers will enhance your submission over time.

## Top Contributors

We're big fans of [Distill](http://distill.pub/prize) and we like their idea of offering prizes for high-quality submissions. We don't have as much money as they do, but we'd still like to reward contributors in some way for contributing to the glossary. In that spirit, we plan to publish a running table of top authors based on number and quality of original submissions:

### Top Entries

| Entry | Author | Link |
|:------------- |:------------- |:-------------|
| Example Entry | Your Name | Your GitHub |
| Example Entry | Your Name | Your GitHub |

### Most Entries

| Author | Entries | Link |
|:------------- |:---------|:-------------|
| Your Name | 24 | Your GitHub |
| Your Name | 18 | Your GitHub |

We'd also like to publish top entries to our Medium Blog, for even more visibility. But in the end, this is an open-source project and we hope contributing to a repository of concise, accessible, machine learning knowledge is enough incentive on its own!

## Tips and Tricks

* [Adding equations](http://www.sphinx-doc.org/en/stable/ext/math.html)
* Quickstart with Jupyter notebook template
* Graphs and charts
* Importing images
* Linking to code

## Resources

* [How To Submit Pull Requests](https://help.github.com/articles/creating-a-pull-request/)
* [RST Cheatsheet](http://docutils.sourceforge.net/docs/user/rst/quickref.html)
* [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
* [Citation Generator](http://www.citationmachine.net)
* [MathJax Cheatsheet](https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference)
* [Embedding Math Equations](http://www.sphinx-doc.org/en/stable/ext/math.html)
* [Sphinx Tutorial](https://pythonhosted.org/an_example_pypi_project/sphinx.html)
* [Sphinx Docs](http://www.sphinx-doc.org/en/stable/markup/code.html)
* [Sphinx Cheatsheet](http://openalea.gforge.inria.fr/doc/openalea/doc/_build/html/source/sphinx/rest_syntax.html)

9 changes: 9 additions & 0 deletions code/nn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def myfunction(var1):
return var1 + 1

class MyClass():
def __init__(self, var2):
self.var2 = var2

def do_something(self):
return "Hey"
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = AIGlossary
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
66 changes: 66 additions & 0 deletions docs/algorithms.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
.. _algorithms:

===============================
Algorithms
===============================

.. toctree::
:maxdepth: 1

Fundamental machine learning algorithms and concepts


Linear Regression
===================

When a model's predicted output is continuous and has a constant slope.
At its most basic, it takes the form of:

.. math::
y = ax + b
* **Pros**: fast, no tuning required, highly interpretable, well-understood
* **Cons**: unlikely to produce the best predictive accuracy

(presumes a linear relationship between the features and response)

[[File:Linear_regression_glossary.png]]

A more complex linear equation might look like this:

.. math::
y = B_0 + B_1 x + B_2 z + B_3 j + B_4 k
A linear regression model would try to "learn" the correct values for
:math:`B_0, B_1, B_2 ..` The independent variables :math:`x, y, j, k`
represent the various attributes of each observation in our sample. For
sales predictions, these attributes might include: day of the week, employee
count, inventory levels, and store location.

.. math::
y = B_0 + B_1 Day + B_2 Employees + B_3 Inventory + B_4 Location
Best Reads:
* <https://arxiv.org/abs/1511.07122>
* <https://en.wikipedia.org/wiki/Linear_regression>

References:
* <http://people.duke.edu/~rnau/regintro.htm>
* <https://en.wikipedia.org/wiki/Linear_regression>


Logistic Regression
===================

The bread and butter of neural networks is *affine transformations*: a
vector is received as input and is multiplied with a matrix to produce an
output (to which a bias vector is usually added before passing the result
through a nonlinearity). This is applicable to any type of input, be it an
image, a sound clip or an unordered collection of features: whatever their
dimensionality, their representation can always be flattened into a vector
before the transformation.


7 changes: 7 additions & 0 deletions docs/calculus.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _calculus:

========
Calculus
========

Basic concepts in calculus for machine learning.
196 changes: 196 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# AI Glossary documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 11 17:53:13 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.mathjax',
'sphinx.ext.githubpages']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'ML Cheatsheet'
copyright = '2017'
author = 'Team'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = ''
# The full version, including alpha/beta/rc tags.
release = ''

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme" #'alabaster'

html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'MLCheatsheetdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'MLCheatsheet.tex', 'ML Cheatsheet Documentation',
'Team', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'mlcheatsheet', 'Machine Learning Cheatsheet Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'MLCheatsheet', 'ML Cheatsheet Documentation',
author, 'Contributors', 'Glossary of machine learning terms and concepts.',
'Miscellaneous'),
]



# -- Options for Epub output ----------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = copyright

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']


from recommonmark.parser import CommonMarkParser

source_parsers = {
'.md': CommonMarkParser,
}

source_suffix = ['.rst', '.md']

html_theme_options = {
'collapse_navigation': False,
'display_version': False
# 'logo_only': True,
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added docs/conv_arithmetic_figures/dilation.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/conv_arithmetic_figures/dilation.pdf
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added docs/conv_arithmetic_figures/padding_strides.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/conv_arithmetic_figures/padding_strides.pdf
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 83cdb16

Please sign in to comment.