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 Distribution
liknorm-1.1.5.tar.gz
(6.3 kB
view hashes)
Built Distributions
Close
Hashes for liknorm-1.1.5-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 901d9989f5d05e416e115681f374f898e5fb7ac616b4894ef270750f414c2313 |
|
MD5 | d5fe4627a41523d8218b5edaf27e9e1a |
|
BLAKE2b-256 | 665b5e658fb9c180be1eb8afdc5fc596d2267e7607fa77f4902588e47ff444c8 |
Close
Hashes for liknorm-1.1.5-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd0d261843c62346ae303b6f0c0c5b9aac547c078d1d7d5ea4a699bf5196aad4 |
|
MD5 | 8e0c6ce8f5ce6976a10aba9d2586683c |
|
BLAKE2b-256 | ae2260a1ed90d01fdc62f807a987715680458970ac5fa14a65e2d4a8b25906ae |
Close
Hashes for liknorm-1.1.5-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd3d5c5df7a1874d126f6f44c8c785dc6175420bf5db8ac041d18803484c7d9f |
|
MD5 | 8b118200fce4a4fec77620f18cc1b392 |
|
BLAKE2b-256 | 5d78645fcf2cee54d55b2cdc793657ab748d6d49af9c76140bc914eefce00210 |
Close
Hashes for liknorm-1.1.5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49ffcba3ffc340ec6d3cff751fcce0ea2deca65f1af7d8373c8f1d590c54a636 |
|
MD5 | 2e749572f621f11112cfa65787327e32 |
|
BLAKE2b-256 | 51b5944c943a4fc8458fb99b24974b952db28567f3f3981e14879d460a69465b |
Close
Hashes for liknorm-1.1.5-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0732fdeb4930f6a580a83e642b0d7a8a10da88d5c7fd6b37aa0f97e670ad164 |
|
MD5 | be6a6008dff6ee2f88eb9648ea03e384 |
|
BLAKE2b-256 | 54545870b740da12aa36d9c15c30b90bfff8963f7c8854e2bc35fff5aab45784 |
Close
Hashes for liknorm-1.1.5-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 301f2b003e9f0455ad01c4bbb3321234549cedb930916fe276cad1eeeddaa83e |
|
MD5 | c6280ed17ba4be238ec9da7b03877166 |
|
BLAKE2b-256 | 3a3280ae810bfbba835cb85e21b0a46ed444556bc9bee04ea1ffe3899dd3e58a |
Close
Hashes for liknorm-1.1.5-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f604bfbb1d612166c3a8bf1b7c07e7b762c2f44aab6dfa5b2ce81204efb8c12 |
|
MD5 | 3591ed119f3f4a4cf410922e07bd243b |
|
BLAKE2b-256 | 14ebc5b9dab9ddbe006b44cbdf5ecd64ef6afeda00f7bd6bfa420dce2a173d2c |
Close
Hashes for liknorm-1.1.5-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 884ae3673746e431bd0b4001330abd6b851670e28f56d20dd3b87dac4620b62c |
|
MD5 | 7f08011cf4c6524499647ad4ff833e6c |
|
BLAKE2b-256 | 60b36bfedf087b8f54ab43db37ed53669be7dcf88ebd0987886c5e377e6d613f |