Giter Club home page Giter Club logo

probdists's Introduction

probdists

Python package to model probability distributions.
Currently supports Gaussian, Gamma, Binomial, Bernoulli, Triangular, Uniform and Exponential Distributions.

Usage

Please see usage

Installation

Installing using pip:

>>> pip install probdists

Installing using virtual-environment(recommended):

>>> conda create -n myEnv python=3.6 anaconda
>>> conda activate myEnv
>>> pip install probdists

You can find the project on PyPi here

Files

The main classes are inside the probdists folder

Licence

MIT Licence

probdists's People

Contributors

augusto-jm-amaral avatar basil08 avatar codeperfectplus avatar craigp17 avatar errpv78 avatar fibonacci-spirals avatar hot9cups avatar mhdzumair avatar misterdabu avatar pk-95 avatar rimorres avatar the-shwin avatar zer0link avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

probdists's Issues

Add support for Poisson distribution

Go through the Gaussian distribution class, the Binomial class and the Exponential class which are subclasses of General distribution class.

I would like to expand this to include another distribution, the Poisson Probability Distribution.
It should be able to calculate mean, standard deviation, and create basic plots like those in the classes I linked.

Add support for Uniform Distribution

Go through the Gaussian distribution class, the Binomial class and the Exponential class which are subclasses of General distribution class.

The uniform distribution is the simplest probability distribution.
I would like to expand this to include the Uniform Probability Distribution.
It should be able to calculate mean, standard deviation, and create basic plots like those in the classes I linked.

Add support for Bernoulli distribution

Go through the Gaussian distribution class, the Binomial class and the Exponential class which are subclasses of General distribution class.

I would like to expand this to include a fourth distribution, the Bernoulli Probability Distribution.
It should be able to calculate mean, standard deviation, and create basic plots like those in the classes I linked.
I suppose it's going to be quite similar to the Binomialdistribution class.

Add tests for PDF plots

The tests in test.py contains code to verify the numerical correctness of the respective classes. However, there is a PDF plot function that plots a graph using matplotlib (soon seaborn) which is not tested.

Your input as a contributor:

  1. Figure out a way to verify the plot. (Random suggestion: Store a image file and compare generated plot with it) Looking for more robust ideas and open to discussions.
  2. Implement solution discussed in 1 and add tests to respective classes.

Add support for Exponential distribution

Go through the Gaussian distribution class and the Binomial class which both are subclasses of General distribution class.

I would like to expand this to include a third distribution, the Exponential Probability Distribution.
It should be able to calculate mean, standard deviation, and create basic plots like those in the classes I linked.

Create a documentation webpage

Create a documentation webpage and host it on a free hosting servive(prefer github).

Most of the functionalities of code are documented here so all that needs to be done now is transform that to a webpage and host it on github.

Add support for Student's t-distribution

Please check implementations of Bernoulli, Poisson, Bates distributions.

This issue aims to extend support for Student's t-distribution and include methods for computing mean, stdev, PDF, CDF and a PDF plot function.

Future work

The library is growing at a good pace. It started with support for merely 2 distributions, and now it's on the path to support most of the major distributions I could think of.

What else do you think would a library on probability distribution ought to include?
Currently, it calculates the mean, standard deviation, adds random variables of two distributions(not for all distributions, eg: exponential), plots the pdf of the distributions and does all of this on user's input data.

Couple of things that are pending include:

  1. Creation of a proper documentation website, and its hosting(preferably using github.io)
  2. Using seaborn and improving the graph quality

There's another issue I thought of yesterday, which could be included - Inverting the probability distribution.
Ie, solving questions like "Given I have a Gaussian Distribution of x mean and y std, for what value of t is P(X < T) = z%"

I reckon that's easily solveable using Newton's method, because we're simple required to find the value of t such that
P(X<t) - z = 0
Using Newton's method, this simply boils down to:
1)Initialising t to a random value
2)Iterating till we have an accuracy we desire:
t -= (cdf(t) - z)/pdf(t)
we could stop, for example, when |dt| < 0.0001, where dt = (cdf(t)-y)/pdf(t)

So these are the ideas I have at the moment, but collective wisdom is always better.
If you think there are other features that could be included in the library, do comment your thoughts below :)

Add support for Chi-square distribution

Go through the Gaussian distribution class, the Binomial class and the Exponential class which are subclasses of General distribution class.

I would like to expand this to include a fourth distribution, the Chi-square Probability Distribution.
It should be able to calculate mean, standard deviation, and create basic plots like those in the classes I linked.

Add support for Bernoulli Distribution

Go through the Gaussian distribution class, the Binomial class and the Exponential class which are subclasses of General distribution class.

I would like to expand this to include a fourth distribution, the Bernoulli Probability Distribution.
It should be able to calculate mean, standard deviation, and create basic plots like those in the classes I linked.
I suppose it's going to be quite similar to the Binomialdistribution class.

Create github action to run unittests

Title says it all.

Also, I already have a test.py file, which you can find here. So you're free to use that if you want to.
I'd like the github action to run the unittests for every push made to master branch, and for every Pull Request opened.

Add CDF for Gamma Distribution

Here is the Gamma distribution class.

It contains the PDF function but currently does not have a CDF function.
I would like it contain the CDF too.

I would also like appropriate unittests to be included in the test.py file

Add CDF for Gaussian Distribution

Here is the Gaussian distribution class.

It contains the PDF function but currently does not have a CDF function.
I would like it contain the CDF too.

I would also like appropriate unittests to be included in the test.py file

Add CDF for Exponential Distribution

Here is the Exponential distribution class.

It contains the PDF function but currently does not have a CDF function.
I would like it contain the CDF too.

I would also like appropriate unittests to be included in the test.py file

Migrating to Seaborn

The plots that the library currently makes are all done using matplotlib.

I was considering either entirely shifting towards using seaborn and increasing the types of graphs offered, or letting there be a provision for both matplotlib and seaborn.

Let me know your thoughts on this and if you'd be willing to take it up :)

Add CDF for Binomial Distribution

Here is the Binomial distribution class.

It contains the PDF function but currently does not have a CDF function.
I would like it contain the CDF too.

I would also like appropriate unittests to be included in the test.py file

Improve read_data_file() function

Currently the read_data_file() function looks like this

The limitation of the current code is that it'll only work when the numbers are line separated, ie have one number per line.

This can be improved by letting the user specify the separator, which could be passed as an argument to the function.

Create Exception classes

I'd like to create custom exceptions for all the existing classes. Maybe a base exception class for the base class Generaldistribution.py and then subclasses for different distributions. This was the idea of @mhdzumair , really good one.

Would this be a good task for next year's hacktoberfest? Or do we start working on it already?

Implement Round Function Internally

It is better to implement the round function internally without calling again and again. I was implement this feature yesterday but today i saw new Gammadistribution. i finished implementation, Unit Test & Usage Docs for other distribution. I will post a PR after finished for gama. What about your idea?

Add support for Gamma Distribution

Go through the Gaussian distribution class, the Binomial class and the Exponential class which are subclasses of General distribution class.

I would like to expand this to include the Gamma Probability Distribution.
It should be able to calculate mean, standard deviation, and create basic plots like those in the classes I linked.

Add support for Weibull Distribution

Make a weibulldistribution.py module under probdists and implement mean, median, mode, stdev, calc_pdf and calc_cdf. Also, provide a pdf plot function.

For implementation examples, see other distributions.

Add Code Of Conduct

We need a code of conduct!

Look around for a good Code of Conduct and add it following GitHub best practices.

Once the PR is open we can talk through whether it's a good fit.

Add support for Poisson distribution

Go through the Gaussian distribution class, the Binomial class and the Exponential class which are subclasses of General distribution class.

I would like to expand this to include another distribution, the Poisson Probability Distribution.
It should be able to calculate mean, standard deviation, and create basic plots like those in the classes I linked.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.