Liknorm Python wrapper
Project description
liknorm-py
Liknorm Python wrapper.
Install
The recommended way of installing it is via conda_
conda install -c conda-forge liknorm-py
An alternative way would be via pip. First you need to install liknorm library and then
pip install liknorm-py
Running the tests
After installation, you can test it
python -c "import liknorm; liknorm.test()"
as long as you have pytest.
Example
>>> from numpy import empty
>>> from numpy.random import RandomState
>>> from liknorm import LikNormMachine
>>>
>>> machine = LikNormMachine('bernoulli')
>>> random = RandomState(0)
>>> outcome = random.randint(0, 2, 5)
>>> tau = random.rand(5)
>>> eta = random.randn(5) * tau
>>>
>>> log_zeroth = empty(5)
>>> mean = empty(5)
>>> variance = empty(5)
>>>
>>> moments = {'log_zeroth': log_zeroth, 'mean': mean, 'variance': variance}
>>> machine.moments(outcome, eta, tau, moments)
>>>
>>> print('%.3f %.3f %.3f' % (log_zeroth[0], mean[0], variance[0]))
-0.671 -0.515 0.946
Authors
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for liknorm-1.1.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc5f627f9ea982fbd7b5cd0acf8bf5a53332bf1179d24a925b9d1ef6794947bc |
|
MD5 | a20cb8996c7682dc5fc720866be2eb85 |
|
BLAKE2b-256 | 99c2688347241cf9704571f0ff2d030981b2b7493a2f681c2898b8b6f8b0ac70 |
Close
Hashes for liknorm-1.1.3-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f91af66512c60e876e6498a60ca8fa95a0a31291c80a2e88f1d02b2557132354 |
|
MD5 | 7f46ae06dcb4151d6d401fd7b3d90705 |
|
BLAKE2b-256 | 911120a12e4b4ccc67f52461b4d327760dfad00110f4469b74ba65b53796beac |
Close
Hashes for liknorm-1.1.3-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ef4d7d698887916ce75d05d1a8b415efaaf273902dca6419a48967a6d348bbe |
|
MD5 | 914affb9b4e8652d23062255537c2ce9 |
|
BLAKE2b-256 | c6c4630d5f3a927858876913085d43c503431b842c168a9083b7a4330272bae4 |
Close
Hashes for liknorm-1.1.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 839251637a8a6f46b8a1733f57a0b93460291f86ea671598c3d0c75c752dc463 |
|
MD5 | 28c3deb228a9eac8bb0de7dddba02ae8 |
|
BLAKE2b-256 | fd8d0402f25acdacf559abfc412b90eb927449d6e7085b20090c9620ba2293cc |
Close
Hashes for liknorm-1.1.3-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c581e533b4f0327f27c2acfea4265818844abebc5f4f3b03cc6f6ef4012194a2 |
|
MD5 | 353eacf19db9d01e690d87443d281076 |
|
BLAKE2b-256 | e89747b24a537ff587d8741bdb8b9fb0adc53176f19d8a8a7af8354d8920f068 |
Close
Hashes for liknorm-1.1.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae2d472527cf2064f82a674ecafbddbb8d3e01c69630193feee557ee85930d22 |
|
MD5 | ff9f046b714182a1162c61d787d3e074 |
|
BLAKE2b-256 | 6109f17eda3fd966cf6d6fd0b1079e25f697f2615a0b04ad4fb20c4d9c2d962d |
Close
Hashes for liknorm-1.1.3-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4cf38760f038e9337fb8ba3eab09ec532fa0314f1b01f6edfaa3d9a8a63c968 |
|
MD5 | 6b249e1b7face2ddef51053739e6bfe3 |
|
BLAKE2b-256 | 99e9710aa8b689410844bdbbe200f8eb97d99c24b0bf985cdb7eba66151b0c6d |
Close
Hashes for liknorm-1.1.3-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b3027302771c98e70484e34c7226516cb9f41c90035c0bacdefcc065cd4e24e |
|
MD5 | 4a3f5acdd8611ebebb7d3ae0607ca3c7 |
|
BLAKE2b-256 | c50ba2bd3388a650d7a6de22bfe4d19943a3381dbf3ee543f85efca0386cf86c |