Thanks to visit codestin.com
Credit goes to github.com

Skip to content

first commit for pymc4-backend #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [0.0.1] - 2018-11-10
## [0.4.0] - 2019-11-10
### Added
- First version of the library
- Gaussian process Regressor
- Student's t process Regressor
- Sparse Gaussian process Regressor
- Linear Regression
- Documentation
21 changes: 7 additions & 14 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
Thank you for considering contributing to ``pymc-learn``! This project is intended to be a space where anyone can share models they've built.
Thank you for considering contributing to ``pymc-learn``!

Please read these guidelines before submitting anything to the project. As of the first release, I'm the only person working on this project so respecting these guidelines will help me get back to you more quickly.
Please read these guidelines before submitting anything to the project.

Some ways to contribute:

- Open an issue on the `Github Issue Tracker <https://github.com/pymc-learn/pymc-learn/issues>`__. (Please check that it has not already been reported or addressed in a PR.)
- Improve the docs!
- Add a new machine-learning model. Please follow the guidelines below.
- Add/change existing functionality in the base function classes for ML.
- Something I haven't thought of?
- Something else.

Pull/Merge Requests
---------------------
To create a Pull Request against this library, please fork the project and work from there.
To create a Pull Request against this library,
please fork the project and work from there.

Steps
................
Expand All @@ -34,7 +35,8 @@ Steps

git checkout -b my-new-feature-branch

Always use a ``feature`` branch. It's good practice to never routinely work on the ``master`` branch.
Always use a ``feature`` branch. It's good practice to never routinely work on
the ``master`` branch.

4. Install requirements (probably in a virtual environment)

Expand Down Expand Up @@ -108,12 +110,3 @@ Notes:
- Docstrings should be written as numpy docstrings
- Your code should be Python 3 compatible
- When in doubt, follow the style of the existing code

Transitioning from PyMC3 to PyMC4
-----------------------------------

.. raw:: html

<embed>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">.<a href="https://twitter.com/pymc_learn?ref_src=twsrc%5Etfw">@pymc_learn</a> has been following closely the development of <a href="https://twitter.com/hashtag/PyMC4?src=hash&amp;ref_src=twsrc%5Etfw">#PyMC4</a> with the aim of switching its backend from <a href="https://twitter.com/hashtag/PyMC3?src=hash&amp;ref_src=twsrc%5Etfw">#PyMC3</a> to PyMC4 as the latter grows to maturity. Core devs are invited. Here&#39;s the tentative roadmap for PyMC4: <a href="https://t.co/Kwjkykqzup">https://t.co/Kwjkykqzup</a> cc <a href="https://twitter.com/pymc_devs?ref_src=twsrc%5Etfw">@pymc_devs</a> <a href="https://t.co/Ze0tyPsIGH">https://t.co/Ze0tyPsIGH</a></p>&mdash; pymc-learn (@pymc_learn) <a href="https://twitter.com/pymc_learn/status/1059474316801249280?ref_src=twsrc%5Etfw">November 5, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</embed>
45 changes: 5 additions & 40 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,15 @@ and unsupervised machine learning. **It is inspired by**
machine learning to non-specialists**. It uses a syntax that mimics scikit-learn.
Emphasis is put on ease of use, productivity, flexibility, performance,
documentation, and an API consistent with scikit-learn. It depends on scikit-learn
and `PyMC3 <https://docs.pymc.io/>`_ and is distributed under the new BSD-3 license,
and `PyMC4 <https://docs.pymc.io/>`_ and is distributed under the new BSD-3 license,
encouraging its use in both academia and industry.

Users can now have calibrated quantities of uncertainty in their models
using powerful inference algorithms -- such as MCMC or Variational inference --
provided by `PyMC3 <https://docs.pymc.io/>`_.
provided by `PyMC4 <https://docs.pymc.io/>`_.
See :doc:`why` for a more detailed description of why ``pymc-learn`` was
created.

.. NOTE::
``pymc-learn`` leverages and extends the Base template provided by the
PyMC3 Models project: https://github.com/parsing-science/pymc3_models


Transitioning from PyMC3 to PyMC4
..................................

.. raw:: html

<embed>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">.<a href="https://twitter.com/pymc_learn?ref_src=twsrc%5Etfw">@pymc_learn</a> has been following closely the development of <a href="https://twitter.com/hashtag/PyMC4?src=hash&amp;ref_src=twsrc%5Etfw">#PyMC4</a> with the aim of switching its backend from <a href="https://twitter.com/hashtag/PyMC3?src=hash&amp;ref_src=twsrc%5Etfw">#PyMC3</a> to PyMC4 as the latter grows to maturity. Core devs are invited. Here&#39;s the tentative roadmap for PyMC4: <a href="https://t.co/Kwjkykqzup">https://t.co/Kwjkykqzup</a> cc <a href="https://twitter.com/pymc_devs?ref_src=twsrc%5Etfw">@pymc_devs</a> <a href="https://t.co/Ze0tyPsIGH">https://t.co/Ze0tyPsIGH</a></p>&mdash; pymc-learn (@pymc_learn) <a href="https://twitter.com/pymc_learn/status/1059474316801249280?ref_src=twsrc%5Etfw">November 5, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</embed>

----

Familiar user interface
Expand Down Expand Up @@ -100,8 +86,8 @@ Or from source as follows:
Dependencies
................

``pymc-learn`` is tested on Python 2.7, 3.5 & 3.6 and depends on Theano,
PyMC3, Scikit-learn, NumPy, SciPy, and Matplotlib (see ``requirements.txt``
``pymc-learn`` is tested on Python 2.7, 3.5 & 3.6 and depends on TensorFlow,
PyMC4, Scikit-learn, NumPy, SciPy, and Matplotlib (see ``requirements.txt``
for version information).

----
Expand Down Expand Up @@ -142,7 +128,7 @@ Differentation Variational Inference (ADVI) is illustrated in the code below.

Instead of drawing samples from the posterior, these algorithms fit
a distribution (e.g. normal) to the posterior turning a sampling problem into
an optimization problem. ADVI is provided PyMC3.
an optimization problem. ADVI is provided PyMC4.

----

Expand All @@ -165,24 +151,6 @@ Or using BibTex as follows:
year={2018}
}

If you want to cite ``pymc-learn`` for its API, you may also want to consider
this reference::

Carlson, Nicole (2018). Custom PyMC3 models built on top of the scikit-learn
API. https://github.com/parsing-science/pymc3_models

Or using BibTex as follows:

.. code-block:: latex

@article{Pymc3_models,
title={pymc3_models: Custom PyMC3 models built on top of the scikit-learn API,
author={Carlson, Nicole},
journal={},
url={https://github.com/parsing-science/pymc3_models}
year={2018}
}

License
..............

Expand Down Expand Up @@ -251,9 +219,6 @@ in a familiar scikit-learn syntax.

**API Reference**

``pymc-learn`` leverages and extends the Base template provided by the PyMC3
Models project: https://github.com/parsing-science/pymc3_models.

* :doc:`api`

.. toctree::
Expand Down
5 changes: 2 additions & 3 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
Changelog
=========

0.0.1 / 2019-01-01
0.4.0 / 2019-10-11
-------------------

Models
+++++++

- Added Gaussian process regression, students t process, sparse gaussian process
- Added Multilayer perceptron
- Added Linear Regression model


Documentation
Expand Down
19 changes: 5 additions & 14 deletions docs/develop.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Contributing
=============

Thank you for considering contributing to ``pymc-learn``! This project is intended to be a space where anyone can share models they've built.
Thank you for considering contributing to ``pymc-learn``!

Please read these guidelines before submitting anything to the project. As of the first release, I'm the only person working on this project so respecting these guidelines will help me get back to you more quickly.
Please read these guidelines before submitting anything to the project.

Some ways to contribute:

- Open an issue on the `Github Issue Tracker <https://github.com/pymc-learn/pymc-learn/issues>`__. (Please check that it has not already been reported or addressed in a PR.)
- Improve the docs!
- Add a new machine-learning model. Please follow the guidelines below.
- Add/change existing functionality in the base function classes for ML.
- Something I haven't thought of?
- Something else.

Pull/Merge Requests
---------------------
Expand Down Expand Up @@ -107,7 +107,7 @@ For the most part, this library follows PEP8 with a couple of exceptions.
Notes:

- Indent with 4 spaces
- Lines can be 120 characters long
- Lines can be 80 characters long
- Docstrings should be written as numpy docstrings
- Your code should be Python 3 compatible
- When in doubt, follow the style of the existing code
Expand All @@ -117,13 +117,4 @@ Contact

To report an issue with ``pymc-learn`` please use the `issue tracker <https://github.com/pymc-learn/pymc-learn/issues>`__.

Finally, if you need to get in touch for information about the project, `send us an e-mail <[email protected]>`__.

Transitioning from PyMC3 to PyMC4
-----------------------------------

.. raw:: html

<embed>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">.<a href="https://twitter.com/pymc_learn?ref_src=twsrc%5Etfw">@pymc_learn</a> has been following closely the development of <a href="https://twitter.com/hashtag/PyMC4?src=hash&amp;ref_src=twsrc%5Etfw">#PyMC4</a> with the aim of switching its backend from <a href="https://twitter.com/hashtag/PyMC3?src=hash&amp;ref_src=twsrc%5Etfw">#PyMC3</a> to PyMC4 as the latter grows to maturity. Core devs are invited. Here&#39;s the tentative roadmap for PyMC4: <a href="https://t.co/Kwjkykqzup">https://t.co/Kwjkykqzup</a> cc <a href="https://twitter.com/pymc_devs?ref_src=twsrc%5Etfw">@pymc_devs</a> <a href="https://t.co/Ze0tyPsIGH">https://t.co/Ze0tyPsIGH</a></p>&mdash; pymc-learn (@pymc_learn) <a href="https://twitter.com/pymc_learn/status/1059474316801249280?ref_src=twsrc%5Etfw">November 5, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</embed>
Finally, if you need to get in touch for information about the project, `send us an e-mail <[email protected]>`__.
14 changes: 3 additions & 11 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,7 @@ Or from source as follows:
``pymc-learn`` is under heavy development.


This also installs required dependencies including Theano.
For alternative Theano installations (e.g., gpu), please see the
instructions on the main `Theano webpage <http://deeplearning.net/software/theano/>`_.
This also installs required dependencies including TensorFlow.
For alternative TensorFlow installations (e.g., gpu), please see the
instructions on the main `TensorFlow webpage <https://www.tensorflow.org/>`_.

Transitioning from PyMC3 to PyMC4
..................................

.. raw:: html

<embed>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">.<a href="https://twitter.com/pymc_learn?ref_src=twsrc%5Etfw">@pymc_learn</a> has been following closely the development of <a href="https://twitter.com/hashtag/PyMC4?src=hash&amp;ref_src=twsrc%5Etfw">#PyMC4</a> with the aim of switching its backend from <a href="https://twitter.com/hashtag/PyMC3?src=hash&amp;ref_src=twsrc%5Etfw">#PyMC3</a> to PyMC4 as the latter grows to maturity. Core devs are invited. Here&#39;s the tentative roadmap for PyMC4: <a href="https://t.co/Kwjkykqzup">https://t.co/Kwjkykqzup</a> cc <a href="https://twitter.com/pymc_devs?ref_src=twsrc%5Etfw">@pymc_devs</a> <a href="https://t.co/Ze0tyPsIGH">https://t.co/Ze0tyPsIGH</a></p>&mdash; pymc-learn (@pymc_learn) <a href="https://twitter.com/pymc_learn/status/1059474316801249280?ref_src=twsrc%5Etfw">November 5, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</embed>
43 changes: 12 additions & 31 deletions docs/why.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ pymc-learn prioritizes user experience
lr = LinearRegression() lr = LinearRegression()
lr.fit(X, y) lr.fit(X, y)

- *Flexibility*: This ease of use does not come at the cost of reduced flexibility. Given that ``pymc-learn`` integrates with `PyMC3 <https://docs.pymc.io>`_, it enables you to implement anything you could have built in the base language.
- *Flexibility*: This ease of use does not come at the cost of reduced flexibility. Given that ``pymc-learn`` integrates with `PyMC4 <https://docs.pymc.io>`_, it enables you to implement anything you could have built in the base language.

- *Performance*. The primary inference algorithm is gradient-based automatic differentiation variational inference (ADVI) (Kucukelbir et al., 2017), which estimates a divergence measure between approximate and true posterior distributions. Pymc-learn scales to complex, high-dimensional models thanks to GPU-accelerated tensor math and reverse-mode automatic differentiation via Theano (Theano Development Team, 2016), and it scales to large datasets thanks to estimates computed over mini-batches of data in ADVI.
- *Performance*. The primary inference algorithm is gradient-based automatic differentiation variational inference (ADVI) (Kucukelbir et al., 2017), which estimates a divergence measure between approximate and true posterior distributions. Pymc-learn scales to complex, high-dimensional models thanks to GPU-accelerated tensor math and reverse-mode automatic differentiation via TensorFlow (TensorFlow Development Team, 2016), and it scales to large datasets thanks to estimates computed over mini-batches of data in ADVI.

----

Expand Down Expand Up @@ -75,18 +75,9 @@ on:

(6) an API consistent with scikit-learn.

The underlying probabilistic models are built using pymc3 (Salvatier et al., 2016).
The underlying probabilistic models are built using pymc4 (Salvatier et al., 2019).


Transitioning from PyMC3 to PyMC4
..................................

.. raw:: html

<embed>
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">.<a href="https://twitter.com/pymc_learn?ref_src=twsrc%5Etfw">@pymc_learn</a> has been following closely the development of <a href="https://twitter.com/hashtag/PyMC4?src=hash&amp;ref_src=twsrc%5Etfw">#PyMC4</a> with the aim of switching its backend from <a href="https://twitter.com/hashtag/PyMC3?src=hash&amp;ref_src=twsrc%5Etfw">#PyMC3</a> to PyMC4 as the latter grows to maturity. Core devs are invited. Here&#39;s the tentative roadmap for PyMC4: <a href="https://t.co/Kwjkykqzup">https://t.co/Kwjkykqzup</a> cc <a href="https://twitter.com/pymc_devs?ref_src=twsrc%5Etfw">@pymc_devs</a> <a href="https://t.co/Ze0tyPsIGH">https://t.co/Ze0tyPsIGH</a></p>&mdash; pymc-learn (@pymc_learn) <a href="https://twitter.com/pymc_learn/status/1059474316801249280?ref_src=twsrc%5Etfw">November 5, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</embed>

Python is the lingua franca of Data Science
--------------------------------------------

Expand All @@ -112,27 +103,17 @@ notebooks, collaboration, and so forth.

----

Why scikit-learn and PyMC3
Why scikit-learn and PyMC4
---------------------------
PyMC3 is a Python package for probabilistic machine learning that enables users
PyMC4 is a Python package for probabilistic machine learning that enables users
to build bespoke models for their specific problems using a probabilistic
modeling framework. However, PyMC3 lacks the steps between creating a model and
reusing it with new data in production. The missing steps include: scoring a
model, saving a model for later use, and loading the model in production
systems.
modeling framework.

In contrast, *scikit-learn* which has become the standard
*scikit-learn* which has become the standard
library for machine learning provides a simple API that makes it very easy for
users to train, score, save and load models in production. However,
*scikit-learn* may not have the model for a user's specific problem.
These limitations have led to the development of the open
source *pymc3-models* library which provides a template to build bespoke
PyMC3 models on top of the *scikit-learn* API and reuse them in
production. This enables users to easily and quickly train, score, save and
load their bespoke models just like in *scikit-learn*.

The ``pymc-learn`` project adopted and extended the template in *pymc3-models*
to develop probabilistic versions of the estimators in *scikit-learn*.
users to train, score, save and load models in production.

The ``pymc-learn`` project developed probabilistic versions of the estimators in *scikit-learn*.
This provides users with probabilistic models in a simple workflow that mimics
the scikit-learn API.

Expand Down Expand Up @@ -190,10 +171,10 @@ References

4. Barber, D. (2012). Bayesian reasoning and machine learning. Cambridge University Press.

5. Salvatier, J., Wiecki, T. V., & Fonnesbeck, C. (2016). Probabilistic programming in Python using PyMC3. PeerJ Computer Science, 2, e55.
5. PyMC4.

6. Alp Kucukelbir, Dustin Tran, Rajesh Ranganath, Andrew Gelman, and David M Blei. Automatic differentiation variational inference. The Journal of Machine Learning Research, 18(1):430{474, 2017.

7. Fabian Pedregosa, Gael Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, et al. Scikit-learn: Machine learning in python. Journal of machine learning research, 12(Oct): 2825-2830, 2011.

8. Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, abs/1605.02688, May 2016. URL http://arxiv.org/abs/1605.02688.
8. TensorFlow