CombinatorialProbability-0.0.3
توضیحات
A POC for a combinatorial probability library using integer partitions as one example
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | CombinatorialProbability-0.0.3 |
| نام | CombinatorialProbability |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Stephen DeSalvo |
| ایمیل نویسنده | stephendesalvo@gmail.com |
| آدرس صفحه اصلی | https://github.com/StephenDeSalvo/CombinatorialProbability |
| آدرس اینترنتی | https://pypi.org/project/CombinatorialProbability/ |
| مجوز | Creative Commons Attribution-Noncommercial-Share Alike license |
# Why?
This library was created to perform operations like iterating or random sampling of combinatorial structures like integer partition, permutations, set partitions etc.
# What?
Right now only **integer partitions** are implemented, minimally. One can randomly sample using several different methods.
# Example
from CombinatorialProbability import IntegerPartition
ip = IntegerPartition()
ip.fit(weight=10, make_array=True, make_table=True, make_tilt=True)
ip.sampling(size=10, method='rejection')
Right now sample returns a tuple, the first element is the sample, the second element is the number of iterations before a successful sample was found, by default it is a list of all 1s if a method is not a rejection method.
Other arguments for method are:
* pdcdsh -- Probabilistic divide-and-conquer deterministic second half
* table_only -- The (tabular) recursive method of Nijenhuis--Wilf
* array_only -- The (array) recursive method of Nijenhuis--Wilf
* pdc-recursive -- Probabilistic divide-and-conquer combined with the table method of Nijenhuis--Wilf
Additional parameters for a given method should be in the form of a dictionary method_params = {} also input to the sample() method.
ip.sampling(size=10, method='pdcdsh')
ip.sampling(size=10, method='table_only')
ip.sampling(size=10, method='array_only')
ip.sampling(size=10, method='pdc-recursive', method_params={'rows': 3})
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl CombinatorialProbability-0.0.3:
pip install CombinatorialProbability-0.0.3.whl
نصب پکیج tar.gz CombinatorialProbability-0.0.3:
pip install CombinatorialProbability-0.0.3.tar.gz