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.2.tar.gz
(7.1 kB
view hashes)
Built Distributions
Close
Hashes for liknorm-1.2.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fae160395a18d49cfa14e5e51260ee5b799e8765635218e6e8e086e02fad153d |
|
MD5 | eea2ed55f74c9dcce01a2097edd87de3 |
|
BLAKE2b-256 | 902bb9f72b6c46fd4206f8d522d2fe971468f0e2f7421c22a0efce25edb9d550 |
Close
Hashes for liknorm-1.2.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 521f2f2d63fba63f603dc08854b7a583ada0dd6091d0e75a1f91e88912bc6fb4 |
|
MD5 | 6788ca759700c7ad79c02a7bfbaa5c48 |
|
BLAKE2b-256 | 6ca83d01d7c26b15eb461dce9a58575b3bfa342c7bf88ba183e872128db8ba1f |
Close
Hashes for liknorm-1.2.2-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f99288484509c7fdac2d78c18a8f87f3cba6c137e0828b5ac262fee80cead36e |
|
MD5 | 6d35c5ead2251a08e676e990f19301f3 |
|
BLAKE2b-256 | 005b78a7645cc36a0087a6c652000196704e02a1e15b83c3af76a01a8497ec9e |
Close
Hashes for liknorm-1.2.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa4cbfaed4a072a8932a46b98a4bb9383e08990cf8446bb7d55f1721119b5d05 |
|
MD5 | 78dc9c7b5ae456be62b75afe8c5ea50d |
|
BLAKE2b-256 | ca87482580b17407e522ff6b90ff31f80af1f3322c727a04aef5620800c82f42 |
Close
Hashes for liknorm-1.2.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edb0c5e7c67defc181a18efa836c68b2443a8df2042c4436bde4f8a224b272e5 |
|
MD5 | 90935afe0b76fdde8781303c72eab84c |
|
BLAKE2b-256 | ea129755131a3100160627c5262604dab716bd208d10515a8dbf446e5c709371 |
Close
Hashes for liknorm-1.2.2-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64ea094c57aad719c4ee0252e1fc30909e3b7430e7abb4add909df0a488314e3 |
|
MD5 | da346237fa2282792bb736b14a125a9b |
|
BLAKE2b-256 | d9b93a0d6f2bdf83b54c84e0be9128e3b225dd5412c18199891a84913d04436a |