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.9.tar.gz
(6.3 kB
view hashes)
Built Distributions
Close
Hashes for liknorm-1.1.9-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4a842d449a227c53430f0e6f62f78693dc9fb698dba5185489bcffef8aff786 |
|
MD5 | bb638cf495199cba9e7992ca7225c453 |
|
BLAKE2b-256 | 3e55a73200c690978ef85c14d141e775aa083228d8d5b8b14b1acca2b56de7d7 |
Close
Hashes for liknorm-1.1.9-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d568277e726cc28457abf46dbdfda14935c54e503381b061709960530ff54f4e |
|
MD5 | 40006e30f69deeea116283be92b70fda |
|
BLAKE2b-256 | 535f3b0f2911ee0a5a4d2eba3d0faf6c561345cee526ff85680a0818c0854265 |
Close
Hashes for liknorm-1.1.9-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d021e03d5f0178a9bcaac1805517341950636f7027582833f68b10fb017b369 |
|
MD5 | 0a8e868e28c8b1776ebc700953f407f0 |
|
BLAKE2b-256 | 627220ef5ecafe5637a3ecf7d7dc6706d7263f01c71b9877cc0bf6a62ca4fae9 |
Close
Hashes for liknorm-1.1.9-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ecccb5e736d44372a082930ce03e02d0455695157ea3f0aa6bfe712f2b59f09 |
|
MD5 | 617ddeb490e24dcc537436edb13d7810 |
|
BLAKE2b-256 | aa391f45e9869efc02f342e6e72420bcbfa37f697f561a99fe3d1a7e478728df |
Close
Hashes for liknorm-1.1.9-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20e07d308d54d708443f41b522050f8b689a8cb1712ba9994046f2f06644c201 |
|
MD5 | 912cbde3fcafe9f9e1e5788e2d7881a1 |
|
BLAKE2b-256 | b708a8750a9776a6fe7612aea4d1bfa35c2adbd9368ab1a19c614e1fd7e70f29 |
Close
Hashes for liknorm-1.1.9-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f25164ab1ad4da6c47f3273736695d269288038a496e2afeb22a4a67ad56baf |
|
MD5 | 361a82ce03eb4bec0c10aa9b8d996ca4 |
|
BLAKE2b-256 | d636647784a2862b5898f44cd9f088c88a587bb79a69c7c89a9e20922b91a566 |
Close
Hashes for liknorm-1.1.9-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaaac8f43efd378a63f1ab33a5c4595d7cbae323a7a086466ab41196728106ce |
|
MD5 | 9ebbc8c5303456450bf3cf4d59cbb30e |
|
BLAKE2b-256 | 01b36256a309bec71bdada046f55a22d5f332aafab1a3a828430bbcf4c7b159e |
Close
Hashes for liknorm-1.1.9-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 818f4524d0a33a0d1bc7e59c3b4ee95c9f443bab457ad220a9edfb864671fdff |
|
MD5 | a5d673d087f95b3817455f06d33f03ab |
|
BLAKE2b-256 | 59e5bcd879e0c51fb6f1976489c100b36a07d63a7bc4ca4749326886c43ca81d |