Liknorm Python wrapper
Project description
liknorm-py
Liknorm Python wrapper.
Install
It can be done via pip or conda.
Pip
pip install liknorm
Conda
conda install -c conda-forge 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.2.1.tar.gz
(6.7 kB
view hashes)
Built Distributions
Close
Hashes for liknorm-1.2.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7079eec6d8afd533b3e97904114e5fcbc247189c4570a1afd13925f3f7443e5d |
|
MD5 | 9e1ef77bb2a81468d6e45a67c119eba1 |
|
BLAKE2b-256 | cec176042a143426382de784ae2e25b9ebc1f9c0e36bf28a5d08c90c3485ee17 |
Close
Hashes for liknorm-1.2.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a87364aa3ff594e330af85c877ac0373ad77c9a6a341cf99d3290a7bb971788 |
|
MD5 | 018e1e7b62c0bd411dba4ea3b6af5cb3 |
|
BLAKE2b-256 | 0a3f64743de0a7eaecbcab76dc7a38c852f366c9df6a7699425d170dfa361efa |
Close
Hashes for liknorm-1.2.1-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87475acf5022ae8e4694b6f121cf6f50e630ca334d72bcb2f1d575e258b39108 |
|
MD5 | e540eb212b5aa84655d3e1ca43085792 |
|
BLAKE2b-256 | 3a24ee0b540a1ff1c51c307fd10b0bf2ce0c52456cf3b02f45f2f28f0a09b68e |
Close
Hashes for liknorm-1.2.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 523a21e3b1c1dffcf6270062946a0eeeeab33f825985e237d0e9416f10dd70fd |
|
MD5 | fbe1910176dce0765e178acb34a41c14 |
|
BLAKE2b-256 | 5f0f5372f7451d53890d41c26f74427e8c84feb2d0515febebf4262cde7cbbab |
Close
Hashes for liknorm-1.2.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07495cd99d00dd3851a857ff1b5d21a914b5aa834cb20d6d261e1e2ed4da6f43 |
|
MD5 | 7f55711a75a7ca02dd89136fd24a55aa |
|
BLAKE2b-256 | a95daf21e1d6c613accddc2f554786f71d3fe17b07a5ddea6da53c7b369be4c5 |
Close
Hashes for liknorm-1.2.1-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80b2b1a28e627d3b8dab21109e9956fdd2df66d696ec06350514da923f924be7 |
|
MD5 | bd6be89f144207c2fbc217a0f616966e |
|
BLAKE2b-256 | 750f37ec8e9b0cd82d794a4a0ac6e139250217a11038e1745ce22c72a4d641bd |
Close
Hashes for liknorm-1.2.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cde11b61786ba40975ccf278a22bbe80fcb4cbbc09ac9cc5820a63a97b1a77b1 |
|
MD5 | cdbda1a9664603f0b97e8559429cf9f3 |
|
BLAKE2b-256 | ee5a6dfd17deea502a819a84d3b29bd83a39bbcad11ea983b8adb753e2ba71fa |
Close
Hashes for liknorm-1.2.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a2d2b6ed803abdfba177e306bd0fbf0cfc95f3c74c9a7d33b45dccfa13cc488 |
|
MD5 | 00d67a708565b551fd5fbb49c0eb6704 |
|
BLAKE2b-256 | ae7e1bc500d1cad40d6c011370130928cdee22436233ca4b41b6e4487f849c10 |
Close
Hashes for liknorm-1.2.1-cp27-cp27m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9497e1f69900654597eab6dce0b08c99e5a93440e88abe4d39c6d2d61dac201b |
|
MD5 | 2cf02e5e83fe457525bbc5a1b3a2e315 |
|
BLAKE2b-256 | 3f52f37831edec57a292fa7542d06ea9b9a7adc54222e2bc19760dff07cbd1d8 |