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.11.tar.gz
(6.4 kB
view hashes)
Built Distributions
Close
Hashes for liknorm-1.1.11-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95508ec8df671deac27d5d965e65f47df0cada0be6aaec7c1f3e816495431b9d |
|
MD5 | 26d8f4c042e9ea224c70e68223be8837 |
|
BLAKE2b-256 | d22fa575ddc73405769261b35dd94c8fa02b49f161bbd139cb36442efee574b1 |
Close
Hashes for liknorm-1.1.11-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a58928b69ae330b46f11fe78251faf69c447d4932aded7e26b0f42c2193868bf |
|
MD5 | 1691cdc00f2d679a31a9a06cdfedd0b7 |
|
BLAKE2b-256 | 327c7d9b9de02ad001bc880855f594fb53ccb42002cb4d462bf5d248f84c364a |
Close
Hashes for liknorm-1.1.11-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e4f7e9feba22bd0b60af6b3d9233f04caa6d157b6cb6b397b4254a75581e388 |
|
MD5 | 9e84c9c3a3a30c49b10d112cbf32e4a5 |
|
BLAKE2b-256 | 0a8bb5051e2ee6e76a7b8aea721b8205762c07a2e71f151c247dae880e9013f8 |
Close
Hashes for liknorm-1.1.11-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e17158f5653046687456533165c00f5664a109e273deca9eededf108de127930 |
|
MD5 | dad0a81fb3cf93d82d89228a3576f4d1 |
|
BLAKE2b-256 | a70765279b316daf0550384e7a9a1c14cf19d7de33b5b431da287e45c614ea2b |
Close
Hashes for liknorm-1.1.11-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86d4778709ace6e83241d79ce4a2e0718c7036f94d0d7b492db195cf9047f1d4 |
|
MD5 | 10c92d0a1c11f12a75194eb588766abb |
|
BLAKE2b-256 | f7b6cb9be22d2e8a74fe5aa30895db9ef8f683743540a9700473b77ced293e09 |
Close
Hashes for liknorm-1.1.11-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b68f76466af6b80b38bee9aef4b90f8a0779f121bdc4a7aa7ce3559409b8317f |
|
MD5 | c7fa6902ef77b50fa1f044cf7fcf73a0 |
|
BLAKE2b-256 | 1f7538345b411cd840e4218d29e1b17d1d146bedd57ff18dc1ed19a04dcbb46d |
Close
Hashes for liknorm-1.1.11-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 726c9d120cd7af135c62d7de4eb65d801e280c527f7f60071ac5ec78458c7fa9 |
|
MD5 | 9679c6ebe03c2f1fdabf15ae57ee9094 |
|
BLAKE2b-256 | 9a44571583dcfd5d1c7803c08179d6858d80da547689e14f1746276c254ad05b |
Close
Hashes for liknorm-1.1.11-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e4682952c6346e15ec81ad6132b77c4ae9f858f0f8487057cf503cd6e3c7d2b |
|
MD5 | dd3afec0513f356dd703eba682137a30 |
|
BLAKE2b-256 | 5f6333a353ad30e55a8a142158aea00eb557c4326bcb3f85db1a0e45e2abdedd |
Close
Hashes for liknorm-1.1.11-cp27-cp27m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2e60378d89bd31ca83c210f3ee1c66d9f5d9556c0e941b3177438223683514f |
|
MD5 | f97d596d41d0959701085607efd886c2 |
|
BLAKE2b-256 | b7037049cba6227a10c329fe31e476be0c00ae289c30dbccd3e0e093a8a8d6ce |