Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a4e9b5a

Browse filesBrowse files
committed
first commit for pymc4-backend
1 parent 78efa95 commit a4e9b5a
Copy full SHA for a4e9b5a

File tree

Expand file treeCollapse file tree

7 files changed

+36
-117
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+36
-117
lines changed

‎CHANGELOG.md

Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ All notable changes to this project will be documented in this file.
33

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

6-
## [0.0.1] - 2018-11-10
6+
## [0.4.0] - 2019-11-10
77
### Added
88
- First version of the library
9-
- Gaussian process Regressor
10-
- Student's t process Regressor
11-
- Sparse Gaussian process Regressor
9+
- Linear Regression
1210
- Documentation

‎CONTRIBUTING.rst

Copy file name to clipboardExpand all lines: CONTRIBUTING.rst
+7-14Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
Thank you for considering contributing to ``pymc-learn``! This project is intended to be a space where anyone can share models they've built.
1+
Thank you for considering contributing to ``pymc-learn``!
22

3-
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.
3+
Please read these guidelines before submitting anything to the project.
44

55
Some ways to contribute:
66

77
- 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.)
88
- Improve the docs!
99
- Add a new machine-learning model. Please follow the guidelines below.
1010
- Add/change existing functionality in the base function classes for ML.
11-
- Something I haven't thought of?
11+
- Something else.
1212

1313
Pull/Merge Requests
1414
---------------------
15-
To create a Pull Request against this library, please fork the project and work from there.
15+
To create a Pull Request against this library,
16+
please fork the project and work from there.
1617

1718
Steps
1819
................
@@ -34,7 +35,8 @@ Steps
3435
3536
git checkout -b my-new-feature-branch
3637
37-
Always use a ``feature`` branch. It's good practice to never routinely work on the ``master`` branch.
38+
Always use a ``feature`` branch. It's good practice to never routinely work on
39+
the ``master`` branch.
3840

3941
4. Install requirements (probably in a virtual environment)
4042

@@ -108,12 +110,3 @@ Notes:
108110
- Docstrings should be written as numpy docstrings
109111
- Your code should be Python 3 compatible
110112
- When in doubt, follow the style of the existing code
111-
112-
Transitioning from PyMC3 to PyMC4
113-
-----------------------------------
114-
115-
.. raw:: html
116-
117-
<embed>
118-
<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>
119-
</embed>

‎README.rst

Copy file name to clipboardExpand all lines: README.rst
+5-40Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,15 @@ and unsupervised machine learning. **It is inspired by**
3333
machine learning to non-specialists**. It uses a syntax that mimics scikit-learn.
3434
Emphasis is put on ease of use, productivity, flexibility, performance,
3535
documentation, and an API consistent with scikit-learn. It depends on scikit-learn
36-
and `PyMC3 <https://docs.pymc.io/>`_ and is distributed under the new BSD-3 license,
36+
and `PyMC4 <https://docs.pymc.io/>`_ and is distributed under the new BSD-3 license,
3737
encouraging its use in both academia and industry.
3838

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

45-
.. NOTE::
46-
``pymc-learn`` leverages and extends the Base template provided by the
47-
PyMC3 Models project: https://github.com/parsing-science/pymc3_models
48-
49-
50-
Transitioning from PyMC3 to PyMC4
51-
..................................
52-
53-
.. raw:: html
54-
55-
<embed>
56-
<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>
57-
</embed>
58-
5945
----
6046

6147
Familiar user interface
@@ -100,8 +86,8 @@ Or from source as follows:
10086
Dependencies
10187
................
10288

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

10793
----
@@ -142,7 +128,7 @@ Differentation Variational Inference (ADVI) is illustrated in the code below.
142128
143129
Instead of drawing samples from the posterior, these algorithms fit
144130
a distribution (e.g. normal) to the posterior turning a sampling problem into
145-
an optimization problem. ADVI is provided PyMC3.
131+
an optimization problem. ADVI is provided PyMC4.
146132

147133
----
148134

@@ -165,24 +151,6 @@ Or using BibTex as follows:
165151
year={2018}
166152
}
167153

168-
If you want to cite ``pymc-learn`` for its API, you may also want to consider
169-
this reference::
170-
171-
Carlson, Nicole (2018). Custom PyMC3 models built on top of the scikit-learn
172-
API. https://github.com/parsing-science/pymc3_models
173-
174-
Or using BibTex as follows:
175-
176-
.. code-block:: latex
177-
178-
@article{Pymc3_models,
179-
title={pymc3_models: Custom PyMC3 models built on top of the scikit-learn API,
180-
author={Carlson, Nicole},
181-
journal={},
182-
url={https://github.com/parsing-science/pymc3_models}
183-
year={2018}
184-
}
185-
186154
License
187155
..............
188156

@@ -251,9 +219,6 @@ in a familiar scikit-learn syntax.
251219

252220
**API Reference**
253221

254-
``pymc-learn`` leverages and extends the Base template provided by the PyMC3
255-
Models project: https://github.com/parsing-science/pymc3_models.
256-
257222
* :doc:`api`
258223

259224
.. toctree::

‎docs/changelog.rst

Copy file name to clipboardExpand all lines: docs/changelog.rst
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
Changelog
22
=========
33

4-
0.0.1 / 2019-01-01
4+
0.4.0 / 2019-10-11
55
-------------------
66

77
Models
88
+++++++
99

10-
- Added Gaussian process regression, students t process, sparse gaussian process
11-
- Added Multilayer perceptron
10+
- Added Linear Regression model
1211

1312

1413
Documentation

‎docs/develop.rst

Copy file name to clipboardExpand all lines: docs/develop.rst
+5-14Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
Contributing
22
=============
33

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

6-
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.
6+
Please read these guidelines before submitting anything to the project.
77

88
Some ways to contribute:
99

1010
- 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.)
1111
- Improve the docs!
1212
- Add a new machine-learning model. Please follow the guidelines below.
1313
- Add/change existing functionality in the base function classes for ML.
14-
- Something I haven't thought of?
14+
- Something else.
1515

1616
Pull/Merge Requests
1717
---------------------
@@ -107,7 +107,7 @@ For the most part, this library follows PEP8 with a couple of exceptions.
107107
Notes:
108108

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

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

120-
Finally, if you need to get in touch for information about the project, `send us an e-mail <devs@pymc-learn.org>`__.
121-
122-
Transitioning from PyMC3 to PyMC4
123-
-----------------------------------
124-
125-
.. raw:: html
126-
127-
<embed>
128-
<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>
129-
</embed>
120+
Finally, if you need to get in touch for information about the project, `send us an e-mail <devs@pymc-learn.org>`__.

‎docs/install.rst

Copy file name to clipboardExpand all lines: docs/install.rst
+3-11Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,7 @@ Or from source as follows:
2626
``pymc-learn`` is under heavy development.
2727

2828

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

33-
Transitioning from PyMC3 to PyMC4
34-
..................................
35-
36-
.. raw:: html
37-
38-
<embed>
39-
<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>
40-
</embed>

‎docs/why.rst

Copy file name to clipboardExpand all lines: docs/why.rst
+12-31Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ pymc-learn prioritizes user experience
2727
lr = LinearRegression() lr = LinearRegression()
2828
lr.fit(X, y) lr.fit(X, y)
2929
30-
- *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.
30+
- *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.
3131

32-
- *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.
32+
- *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.
3333

3434
----
3535

@@ -75,18 +75,9 @@ on:
7575

7676
(6) an API consistent with scikit-learn.
7777

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

8080

81-
Transitioning from PyMC3 to PyMC4
82-
..................................
83-
84-
.. raw:: html
85-
86-
<embed>
87-
<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>
88-
</embed>
89-
9081
Python is the lingua franca of Data Science
9182
--------------------------------------------
9283

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

113104
----
114105

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

124-
In contrast, *scikit-learn* which has become the standard
112+
*scikit-learn* which has become the standard
125113
library for machine learning provides a simple API that makes it very easy for
126-
users to train, score, save and load models in production. However,
127-
*scikit-learn* may not have the model for a user's specific problem.
128-
These limitations have led to the development of the open
129-
source *pymc3-models* library which provides a template to build bespoke
130-
PyMC3 models on top of the *scikit-learn* API and reuse them in
131-
production. This enables users to easily and quickly train, score, save and
132-
load their bespoke models just like in *scikit-learn*.
133-
134-
The ``pymc-learn`` project adopted and extended the template in *pymc3-models*
135-
to develop probabilistic versions of the estimators in *scikit-learn*.
114+
users to train, score, save and load models in production.
115+
116+
The ``pymc-learn`` project developed probabilistic versions of the estimators in *scikit-learn*.
136117
This provides users with probabilistic models in a simple workflow that mimics
137118
the scikit-learn API.
138119

@@ -190,10 +171,10 @@ References
190171

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

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

195176
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.
196177

197178
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.
198179

199-
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.
180+
8. TensorFlow

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.