{"id":15063961,"url":"https://github.com/pymc-learn/pymc-learn","last_synced_at":"2025-07-25T00:04:17.882Z","repository":{"id":54866899,"uuid":"153842646","full_name":"pymc-learn/pymc-learn","owner":"pymc-learn","description":"pymc-learn: Practical probabilistic machine learning in Python ","archived":false,"fork":false,"pushed_at":"2021-01-24T03:00:07.000Z","size":6605,"stargazers_count":228,"open_issues_count":12,"forks_count":22,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-31T16:17:34.319Z","etag":null,"topics":["pymc3","pymc4","scikit-learn"],"latest_commit_sha":null,"homepage":"http://www.pymc-learn.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pymc-learn.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-19T21:15:03.000Z","updated_at":"2025-03-29T21:54:26.000Z","dependencies_parsed_at":"2022-08-14T05:10:34.146Z","dependency_job_id":null,"html_url":"https://github.com/pymc-learn/pymc-learn","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymc-learn%2Fpymc-learn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymc-learn%2Fpymc-learn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymc-learn%2Fpymc-learn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymc-learn%2Fpymc-learn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pymc-learn","download_url":"https://codeload.github.com/pymc-learn/pymc-learn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713258,"owners_count":20983683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pymc3","pymc4","scikit-learn"],"created_at":"2024-09-25T00:09:21.678Z","updated_at":"2025-04-07T19:15:33.840Z","avatar_url":"https://github.com/pymc-learn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pymc-learn: Practical Probabilistic Machine Learning in Python\n===============================================================\n\n.. image:: https://github.com/pymc-learn/pymc-learn/blob/master/docs/logos/pymc-learn-logo.jpg?raw=true\n    :width: 350px\n    :alt: Pymc-Learn logo\n    :align: center\n\n|status| |Travis| |Coverage| |Docs| |License| |Pypi| |Binder|\n\n**Contents:**\n\n    #. `Github repo`_\n    #. `What is pymc-learn?`_\n    #. `Quick Install`_\n    #. `Quick Start`_\n    #. `Index`_\n\n\n.. _Github repo: https://github.com/pymc-learn/pymc-learn\n\n----\n\nWhat is pymc-learn?\n------------------------\n\n*pymc-learn is a library for practical probabilistic\nmachine learning in Python*.\n\nIt provides a variety of state-of-the art probabilistic models for supervised\nand unsupervised machine learning. **It is inspired by**\n`scikit-learn \u003chttp://scikit-learn.org\u003e`_ **and focuses on bringing probabilistic\nmachine learning to non-specialists**. It uses a syntax that mimics scikit-learn.\nEmphasis is put on ease of use, productivity, flexibility, performance,\ndocumentation, and an API consistent with scikit-learn. It depends on scikit-learn\nand `PyMC3 \u003chttps://docs.pymc.io/\u003e`_ and is distributed under the new BSD-3 license,\nencouraging its use in both academia and industry.\n\nUsers can now have calibrated quantities of uncertainty in their models\nusing powerful inference algorithms -- such as MCMC or Variational inference --\nprovided by `PyMC3 \u003chttps://docs.pymc.io/\u003e`_.\nSee :doc:`why` for a more detailed description of why ``pymc-learn`` was\ncreated.\n\n.. NOTE::\n   ``pymc-learn`` leverages and extends the Base template provided by the\n   PyMC3 Models project: https://github.com/parsing-science/pymc3_models\n\n\nTransitioning from PyMC3 to PyMC4\n..................................\n\n.. raw:: html\n\n    \u003cembed\u003e\n        \u003cblockquote class=\"twitter-tweet\" data-lang=\"en\"\u003e\u003cp lang=\"en\" dir=\"ltr\"\u003e.\u003ca href=\"https://twitter.com/pymc_learn?ref_src=twsrc%5Etfw\"\u003e@pymc_learn\u003c/a\u003e has been following closely the development of \u003ca href=\"https://twitter.com/hashtag/PyMC4?src=hash\u0026amp;ref_src=twsrc%5Etfw\"\u003e#PyMC4\u003c/a\u003e with the aim of switching its backend from \u003ca href=\"https://twitter.com/hashtag/PyMC3?src=hash\u0026amp;ref_src=twsrc%5Etfw\"\u003e#PyMC3\u003c/a\u003e to PyMC4 as the latter grows to maturity. Core devs are invited. Here\u0026#39;s the tentative roadmap for PyMC4: \u003ca href=\"https://t.co/Kwjkykqzup\"\u003ehttps://t.co/Kwjkykqzup\u003c/a\u003e cc \u003ca href=\"https://twitter.com/pymc_devs?ref_src=twsrc%5Etfw\"\u003e@pymc_devs\u003c/a\u003e \u003ca href=\"https://t.co/Ze0tyPsIGH\"\u003ehttps://t.co/Ze0tyPsIGH\u003c/a\u003e\u003c/p\u003e\u0026mdash; pymc-learn (@pymc_learn) \u003ca href=\"https://twitter.com/pymc_learn/status/1059474316801249280?ref_src=twsrc%5Etfw\"\u003eNovember 5, 2018\u003c/a\u003e\u003c/blockquote\u003e \u003cscript async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"\u003e\u003c/script\u003e\n    \u003c/embed\u003e\n\n----\n\nFamiliar user interface\n-----------------------\n``pymc-learn`` mimics scikit-learn. You don't have to completely rewrite\nyour scikit-learn ML code.\n\n.. code-block:: python\n\n    from sklearn.linear_model \\                         from pmlearn.linear_model \\\n      import LinearRegression                             import LinearRegression\n    lr = LinearRegression()                             lr = LinearRegression()\n    lr.fit(X, y)                                        lr.fit(X, y)\n\nThe difference between the two models is that ``pymc-learn`` estimates model\nparameters using Bayesian inference algorithms such as MCMC or variational\ninference. This produces calibrated quantities of uncertainty for model\nparameters and predictions.\n\n----\n\nQuick Install\n-----------------\n\n``pymc-learn`` requires a working Python interpreter (2.7 or 3.5+).\nIt is recommend installing Python and key numerical libraries using the `Anaconda Distribution \u003chttps://www.anaconda.com/download/\u003e`_,\nwhich has one-click installers available on all major platforms.\n\nAssuming a standard Python environment is installed on your machine\n(including pip), ``pymc-learn`` itself can be installed in one line using pip:\n\nYou can install ``pymc-learn`` from PyPi using pip as follows:\n\n.. code-block:: bash\n\n   pip install pymc-learn\n\n\nOr from source as follows:\n\n.. code-block:: bash\n\n   pip install git+https://github.com/pymc-learn/pymc-learn\n\n\n.. CAUTION::\n   ``pymc-learn`` is under heavy development.\n\n   It is recommended installing ``pymc-learn`` in a Conda environment because it\n   provides `Math Kernel Library \u003chttps://anaconda.org/anaconda/mkl-service\u003e`_ (MKL)\n   routines to accelerate math functions. If you are having trouble, try using\n   a distribution of Python that includes these packages like\n   `Anaconda \u003chttps://www.anaconda.com/download/\u003e`_.\n\n\n\nDependencies\n................\n\n``pymc-learn`` is tested on Python 2.7, 3.5 \u0026 3.6 and depends on Theano,\nPyMC3, Scikit-learn, NumPy, SciPy, and Matplotlib (see ``requirements.txt``\nfor version information).\n\n----\n\n\nQuick Start\n------------------\n\n.. code-block:: python\n\n    # For regression using Bayesian Nonparametrics\n    \u003e\u003e\u003e from sklearn.datasets import make_friedman2\n    \u003e\u003e\u003e from pmlearn.gaussian_process import GaussianProcessRegressor\n    \u003e\u003e\u003e from pmlearn.gaussian_process.kernels import DotProduct, WhiteKernel\n    \u003e\u003e\u003e X, y = make_friedman2(n_samples=500, noise=0, random_state=0)\n    \u003e\u003e\u003e kernel = DotProduct() + WhiteKernel()\n    \u003e\u003e\u003e gpr = GaussianProcessRegressor(kernel=kernel).fit(X, y)\n    \u003e\u003e\u003e gpr.score(X, y)\n    0.3680...\n    \u003e\u003e\u003e gpr.predict(X[:2,:], return_std=True)\n    (array([653.0..., 592.1...]), array([316.6..., 316.6...]))\n\n----\n\nScales to Big Data \u0026 Complex Models\n-----------------------------------\n\nRecent research has led to the development of variational inference algorithms\nthat are fast and almost as flexible as MCMC. For instance Automatic\nDifferentation Variational Inference (ADVI) is illustrated in the code below.\n\n.. code-block:: python\n\n    from pmlearn.neural_network import MLPClassifier\n    model = MLPClassifier()\n    model.fit(X_train, y_train, inference_type=\"advi\")\n\n\nInstead of drawing samples from the posterior, these algorithms fit\na distribution (e.g. normal) to the posterior turning a sampling problem into\nan optimization problem. ADVI is provided PyMC3.\n\n----\n\nCiting pymc-learn\n------------------\n\nTo cite ``pymc-learn`` in publications, please use the following::\n\n   Emaasit, Daniel (2018). Pymc-learn: Practical probabilistic machine\n   learning in Python. arXiv preprint arXiv:1811.00542.\n\nOr using BibTex as follows:\n\n.. code-block:: latex\n\n    @article{emaasit2018pymc,\n      title={Pymc-learn: Practical probabilistic machine learning in {P}ython},\n      author={Emaasit, Daniel and others},\n      journal={arXiv preprint arXiv:1811.00542},\n      year={2018}\n    }\n\nIf you want to cite ``pymc-learn`` for its API, you may also want to consider\nthis reference::\n\n   Carlson, Nicole (2018). Custom PyMC3 models built on top of the scikit-learn\n   API. https://github.com/parsing-science/pymc3_models\n\nOr using BibTex as follows:\n\n.. code-block:: latex\n\n    @article{Pymc3_models,\n      title={pymc3_models: Custom PyMC3 models built on top of the scikit-learn API,\n      author={Carlson, Nicole},\n      journal={},\n      url={https://github.com/parsing-science/pymc3_models}\n      year={2018}\n    }\n\nLicense\n..............\n\n`New BSD-3 license \u003chttps://github.com/pymc-learn/pymc-learn/blob/master/LICENSE\u003e`__\n\n----\n\nIndex\n-----\n\n**Getting Started**\n\n* :doc:`install`\n* :doc:`support`\n* :doc:`why`\n\n.. toctree::\n   :maxdepth: 1\n   :hidden:\n   :caption: Getting Started\n\n   install.rst\n   support.rst\n   why.rst\n\n----\n\n**User Guide**\n\nThe main documentation. This contains an in-depth description of all models\nand how to apply them.\n\n* :doc:`user_guide`\n\n.. toctree::\n   :maxdepth: 1\n   :hidden:\n   :caption: User Guide\n\n   user_guide.rst\n\n----\n\n**Examples**\n\nPymc-learn provides probabilistic models for machine learning,\nin a familiar scikit-learn syntax.\n\n* :doc:`regression`\n* :doc:`classification`\n* :doc:`mixture`\n* :doc:`neural_networks`\n* :doc:`api`\n\n.. toctree::\n   :maxdepth: 1\n   :hidden:\n   :caption: Examples\n\n   regression.rst\n   classification.rst\n   mixture.rst\n   neural_networks.rst\n\n----\n\n**API Reference**\n\n``pymc-learn`` leverages and extends the Base template provided by the PyMC3\nModels project: https://github.com/parsing-science/pymc3_models.\n\n* :doc:`api`\n\n.. toctree::\n   :maxdepth: 1\n   :hidden:\n   :caption: API Reference\n\n   api.rst\n\n----\n\n**Help \u0026 reference**\n\n* :doc:`develop`\n* :doc:`support`\n* :doc:`changelog`\n* :doc:`cite`\n\n.. toctree::\n   :maxdepth: 1\n   :hidden:\n   :caption: Help \u0026 reference\n\n   develop.rst\n   support.rst\n   changelog.rst\n   cite.rst\n\n.. |Binder| image:: https://img.shields.io/badge/try-online-579ACA.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFkAAABZCAMAAABi1XidAAAB8lBMVEX///9XmsrmZYH1olJXmsr1olJXmsrmZYH1olJXmsr1olJXmsrmZYH1olL1olJXmsr1olJXmsrmZYH1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olJXmsrmZYH1olL1olL0nFf1olJXmsrmZYH1olJXmsq8dZb1olJXmsrmZYH1olJXmspXmspXmsr1olL1olJXmsrmZYH1olJXmsr1olL1olJXmsrmZYH1olL1olLeaIVXmsrmZYH1olL1olL1olJXmsrmZYH1olLna31Xmsr1olJXmsr1olJXmsrmZYH1olLqoVr1olJXmsr1olJXmsrmZYH1olL1ol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yVPrjw1te5otM7RmP7xm+sK2Gv9I8Gi++BRbEkR9EBw8zRUcKxwp73xkaLiqQb+kGduJTNHG72zcW9LoJgqQxpP3/Tj//c3yB0tqzaml05/+orHLksVO+95kX7/7qgJvnjlrfr2Ggsyx0eoy9uPzN5SPd86aXggOsEKW2Prz7du3VID3/tzs/sSRs2w7ovVHKtjrX2pd7ZMlTxAYfBAL9jiDwfLkq55Tm7ifhMlTGPyCAs7RFRhn47JnlcB9RM5T97ASuZXIcVNuUDIndpDbdsfrqsOppeXl5Y+XVKdjFCTh+zGaVuj0d9zy05PPK3QzBamxdwtTCrzyg/2Rvf2EstUjordGwa/kx9mSJLr8mLLtCW8HHGJc2R5hS219IiF6PnTusOqcMl57gm0Z8kanKMAQg0qSyuZfn7zItsbGyO9QlnxY0eCuD1XL2ys/MsrQhltE7Ug0uFOzufJFE2PxBo/YAx8XPPdDwWN0MrDRYIZF0mSMKCNHgaIVFoBbNoLJ7tEQDKxGF0kcLQimojCZopv0OkNOyWCCg9XMVAi7ARJzQdM2QUh0gmBozjc3Skg6dSBRqDGYSUOu66Zg+I2fNZs/M3/f/Grl/XnyF1Gw3VKCez0PN5IUfFLqvgUN4C0qNqYs5YhPL+aVZYDE4IpUk57oSFnJm4FyCqqOE0jhY2SMyLFoo56zyo6becOS5UVDdj7Vih0zp+tcMhwRpBeLyqtIjlJKAIZSbI8SGSF3k0pA3mR5tHuwPFoa7N7reoq2bqCsAk1HqCu5uvI1n6JuRXI+S1Mco54YmYTwcn6Aeic+kssXi8XpXC4V3t7/ADuTNKaQJdScAAAAAElFTkSuQmCC\n   :target: https://mybinder.org/v2/gh/pymc-learn/pymc-learn/master?filepath=%2Fdocs%2Fnotebooks?urlpath=lab\n\n.. |Travis| image:: https://travis-ci.com/pymc-learn/pymc-learn.svg?branch=master\n   :target: https://travis-ci.com/pymc-learn/pymc-learn\n\n.. |Coverage| image:: https://coveralls.io/repos/github/pymc-learn/pymc-learn/badge.svg?branch=master\n   :target: https://coveralls.io/github/pymc-learn/pymc-learn?branch=master\n\n.. |Python27| image:: https://img.shields.io/badge/python-2.7-blue.svg\n   :target: https://badge.fury.io/py/pymc-learn\n\n.. |Python36| image:: https://img.shields.io/badge/python-3.6-blue.svg\n   :target: https://badge.fury.io/py/pymc-learn\n\n.. |Docs| image:: https://readthedocs.org/projects/pymc-learn/badge/?version=latest\n   :target: https://pymc-learn.readthedocs.io/en/latest/?badge=latest\n   :alt: Documentation Status\n\n.. |License| image:: https://img.shields.io/badge/license-BSD-blue.svg\n   :alt: Hex.pm\n   :target: https://github.com/pymc-learn/pymc-learn/blob/master/LICENSE\n\n.. |Pypi| image:: https://badge.fury.io/py/pymc-learn.svg\n   :target: https://badge.fury.io/py/pymc-learn\n\n.. |status| image:: https://img.shields.io/badge/Status-Beta-blue.svg","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymc-learn%2Fpymc-learn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpymc-learn%2Fpymc-learn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymc-learn%2Fpymc-learn/lists"}