All Projects → williamjameshandley → anesthetic

williamjameshandley / anesthetic

Licence: MIT license
Nested Sampling post-processing and plotting

Programming Languages

python
139335 projects - #7 most used programming language
TeX
3793 projects
Jupyter Notebook
11667 projects

Projects that are alternatives of or similar to anesthetic

Stats Maths With Python
General statistics, mathematical programming, and numerical/scientific computing scripts and notebooks in Python
Stars: ✭ 381 (+1020.59%)
Mutual labels:  pandas, scipy, matplotlib
introduction to ml with python
도서 "[개정판] 파이썬 라이브러리를 활용한 머신 러닝"의 주피터 노트북과 코드입니다.
Stars: ✭ 211 (+520.59%)
Mutual labels:  pandas, scipy, matplotlib
Python-Matematica
Explorando aspectos fundamentais da matemática com Python e Jupyter
Stars: ✭ 41 (+20.59%)
Mutual labels:  pandas, scipy, matplotlib
Data Science Ipython Notebooks
Data science Python notebooks: Deep learning (TensorFlow, Theano, Caffe, Keras), scikit-learn, Kaggle, big data (Spark, Hadoop MapReduce, HDFS), matplotlib, pandas, NumPy, SciPy, Python essentials, AWS, and various command lines.
Stars: ✭ 22,048 (+64747.06%)
Mutual labels:  pandas, scipy, matplotlib
Mlcourse.ai
Open Machine Learning Course
Stars: ✭ 7,963 (+23320.59%)
Mutual labels:  pandas, scipy, matplotlib
Data Analysis
主要是爬虫与数据分析项目总结,外加建模与机器学习,模型的评估。
Stars: ✭ 142 (+317.65%)
Mutual labels:  pandas, scipy, matplotlib
Ml Cheatsheet
A constantly updated python machine learning cheatsheet
Stars: ✭ 136 (+300%)
Mutual labels:  pandas, scipy, matplotlib
Algorithmic-Trading
Algorithmic trading using machine learning.
Stars: ✭ 102 (+200%)
Mutual labels:  pandas, scipy, matplotlib
Kagglestruggle
Kaggle Struggle
Stars: ✭ 228 (+570.59%)
Mutual labels:  pandas, matplotlib
Jupyter Tips And Tricks
Using Project Jupyter for data science.
Stars: ✭ 245 (+620.59%)
Mutual labels:  pandas, matplotlib
fer
Facial Expression Recognition
Stars: ✭ 32 (-5.88%)
Mutual labels:  pandas, matplotlib
Edaviz
edaviz - Python library for Exploratory Data Analysis and Visualization in Jupyter Notebook or Jupyter Lab
Stars: ✭ 220 (+547.06%)
Mutual labels:  pandas, matplotlib
Python Wechat Itchat
微信机器人,基于Python itchat接口功能实例展示:01-itchat获取微信好友或者微信群分享文章、02-itchat获取微信公众号文章、03-itchat监听微信公众号发送的文章、04 itchat监听微信群或好友撤回的消息、05 itchat获得微信好友信息以及表图对比、06 python打印出微信被删除好友、07 itchat自动回复好友、08 itchat微信好友个性签名词云图、09 itchat微信好友性别比例、10 微信群或微信好友撤回消息拦截、11 itchat微信群或好友之间转发消息
Stars: ✭ 216 (+535.29%)
Mutual labels:  pandas, matplotlib
Orange3
🍊 📊 💡 Orange: Interactive data analysis
Stars: ✭ 3,152 (+9170.59%)
Mutual labels:  pandas, scipy
Windrose
A Python Matplotlib, Numpy library to manage wind data, draw windrose (also known as a polar rose plot), draw probability density function and fit Weibull distribution
Stars: ✭ 208 (+511.76%)
Mutual labels:  pandas, matplotlib
CNCC-2019
Computational Neuroscience Crash Course (CNCC 2019)
Stars: ✭ 26 (-23.53%)
Mutual labels:  scipy, matplotlib
pysgmcmc
Bayesian Deep Learning with Stochastic Gradient MCMC Methods
Stars: ✭ 31 (-8.82%)
Mutual labels:  bayesian-inference, mcmc
Dexplot
Simple plotting library that wraps Matplotlib and integrated with DataFrames
Stars: ✭ 208 (+511.76%)
Mutual labels:  pandas, matplotlib
Artificial Intelligence Deep Learning Machine Learning Tutorials
A comprehensive list of Deep Learning / Artificial Intelligence and Machine Learning tutorials - rapidly expanding into areas of AI/Deep Learning / Machine Vision / NLP and industry specific areas such as Climate / Energy, Automotives, Retail, Pharma, Medicine, Healthcare, Policy, Ethics and more.
Stars: ✭ 2,966 (+8623.53%)
Mutual labels:  pandas, matplotlib
nestle
Pure Python, MIT-licensed implementation of nested sampling algorithms for evaluating Bayesian evidence.
Stars: ✭ 66 (+94.12%)
Mutual labels:  bayesian-inference, nested-sampling

anesthetic: nested sampling visualisation

anesthetic:nested sampling visualisation
Author: Will Handley and Lukas Hergt
Version: 2.0.0-beta.12
Homepage:https://github.com/williamjameshandley/anesthetic
Documentation:http://anesthetic.readthedocs.io/
Build Status Test Coverage Status Documentation Status PyPi location Permanent DOI for this release Review Status License information Online interactive notebook

anesthetic brings together tools for processing nested sampling chains, leveraging standard scientific python libraries.

You can see example usage and plots in the plot gallery, or in the corresponding Jupyter notebook.

Current functionality includes:

  • Computation of Bayesian evidences, Kullback-Liebler divergences and Bayesian model dimensionalities.
  • Marginalised 1d and 2d plots.
  • Dynamic replaying of nested sampling.

This tool was designed primarily for use with nested sampling outputs, although it can be used for normal MCMC chains.

For an interactive view of a nested sampling run, you can use the anesthetic script.

$ anesthetic <ns file root>

https://github.com/williamjameshandley/anesthetic/raw/master/images/anim_1.gif

Features

  • Both samples and plotting axes are stored as a pandas.DataFrame, with parameter names as indices, which makes for easy access and modification.
  • Sensible color scheme for plotting nearly flat distributions.
  • For easy extension/modification, uses the standard python libraries: numpy, scipy, matplotlib and pandas.

Installation

anesthetic can be installed via pip

pip install anesthetic

or via the setup.py

git clone https://github.com/williamjameshandley/anesthetic
cd anesthetic
python setup.py install --user

You can check that things are working by running the test suite:

export MPLBACKEND=Agg     # only necessary for OSX users
python -m pytest
flake8 anesthetic tests
pydocstyle --convention=numpy anesthetic

Dependencies

Basic requirements:

Documentation:

Tests:

Documentation

Full Documentation is hosted at ReadTheDocs. To build your own local copy of the documentation you'll need to install sphinx. You can then run:

cd docs
make html

Citation

If you use anesthetic to generate plots for a publication, please cite as:

Handley, (2019). anesthetic: nested sampling visualisation. Journal of Open
Source Software, 4(37), 1414, https://doi.org/10.21105/joss.01414

or using the BibTeX:

@article{anesthetic,
    doi = {10.21105/joss.01414},
    url = {http://dx.doi.org/10.21105/joss.01414},
    year  = {2019},
    month = {Jun},
    publisher = {The Open Journal},
    volume = {4},
    number = {37},
    pages = {1414},
    author = {Will Handley},
    title = {anesthetic: nested sampling visualisation},
    journal = {The Journal of Open Source Software}
}

Contributing

There are many ways you can contribute via the GitHub repository.

  • You can open an issue to report bugs or to propose new features.
  • Pull requests are very welcome. Note that if you are going to propose major changes, be sure to open an issue for discussion first, to make sure that your PR will be accepted before you spend effort coding it.

Questions/Comments

Another posterior plotting tool?

This is my posterior plotter. There are many like it, but this one is mine.

There are several excellent tools for plotting marginalised posteriors:

Why create another one? In general, any dedicated user of software will find that there is some functionality that in their use case is lacking, and the designs of previous codes make such extensions challenging. In my case this was:

  1. For large numbers of samples, kernel density estimation is slow, or inaccurate (particularly for samples generated from nested sampling). There are kernel density estimators, such as fastKDE, which ameliorate many of these difficulties.
  2. Existing tools can make it difficult to define new parameters. For example, the default cosmomc chain defines omegabh2, but not omegab. The transformation is easy, since omegab = omegabh2/ (H0/100)**2, but implementing this transformation in existing packages is not so trivial. anesthetic solves this issue by storing the samples as a pandas array, for which the relevant code for defining the above new parameter would be
from anesthetic import MCMCSamples
samples = MCMCSamples(root=file_root)                         # Load the samples
samples['omegab'] = samples.omegabh2/(samples.H0/100)**2      # Define omegab
samples.tex['omegab'] = '$\Omega_b$'                          # Label omegab
samples.plot_1d('omegab')                                     # Simple 1D plot
  1. Many KDE plotting tools have conventions that don't play well with uniformly distributed parameters, which presents a problem if you are trying to plot priors along with your posteriors. anesthetic has a sensible mechanism, by defining the contours by the amount of iso-probability mass they contain, but colouring the fill in relation to the probability density of the contour.

What's in a name?

There is an emerging convention for naming nested sampling packages with words that have nest in them (nestle and dynesty, nestorflow). Doing a UNIX grep:

grep nest /usr/share/dict/words

yields a lot of superlatives (e.g. greenest), but a few other cool names for future projects:

  • amnesty
  • defenestrate
  • dishonestly
  • inestimable
  • minestrone
  • rhinestone

I chose anesthetic because I liked the soft 'th', and in spite of the US spelling.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].