Skip to main content

A tool to fit data to many distributions and best one(s)

Project description

https://pypip.in/d/fitter/badge.png https://secure.travis-ci.org/cokelaer/fitter.png https://landscape.io/github/cokelaer/fitter/master/landscape.png https://badge.waffle.io/cokelaer/fitter.png?label=ready&title=Ready

fitter package provides a simple class to figure out from whih distribution your data comes from. It uses scipy package to try 80 ditribution and allows you to plot the results to check what is the most probable distribution.

Installation

pip install fitter

Usage

Nothing complicated since there is just one class provided. First, we will need to create some data samples. Let us create a sequence of 100000 samples from a gamma distribution:

from scipy import stats
stats.gamma.rvs(2, loc=1.5, scale=2, size=100000)

Now, the question without any knowledge about the distribution of its parameter, what is a probable distribution that fit the data? scipy has 80 distribution with a method called fit that will help us here. The class Fitter will scan all the distribution, call the fit function for you, ignoring those that fail or run forever and finally give you a summary of the best distribution in the sense of sum of the square errors. The best is to give an example:

from fitter import Fitter
f = Fitter(data)
f.fit()
# make take some time since by default, all distribution are tried
f.summary()
http://pythonhosted.org/fitter/_images/index-1.png

See the online documentation for details.

Project details


Release history Release notifications

History Node

1.0.8

History Node

1.0.7

History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

This version
History Node

0.2.0

History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
fitter-0.2.0.tar.gz (6.0 kB) Copy SHA256 hash SHA256 Source None Aug 18, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page