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.6.tar.gz
(6.2 kB
view hashes)
Built Distributions
Close
Hashes for liknorm-1.1.6-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba1a81a3806f6341130c784d5c7e4a71ce69679ee9f837b4a8b5c8c7bf6cb536 |
|
MD5 | acb9acf7f4fe93b6925fddf17ca4c45e |
|
BLAKE2b-256 | e5ed7cec63018fbc87fef7655d0ac7859a2dc89ee000d6061a1bfb38621cea6e |
Close
Hashes for liknorm-1.1.6-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ac1b81238a29e54f36d922e64874236c9ce302aadf9336bbdff97034d0df251 |
|
MD5 | c82a95c88cba6da831a568d295877bcc |
|
BLAKE2b-256 | 4006ca9d93b1a0317c727ee62ef107eff3d8ce44172bcc1eece774cb1edf69af |
Close
Hashes for liknorm-1.1.6-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fa1b3f88f917c137cefcb8ad6e757e7203618d86b6c850e600a8f6266d44e98 |
|
MD5 | ee9d0c47ca7cdcfd2de9b6d36e02b049 |
|
BLAKE2b-256 | 35930797131192484b10dd16dd1f6a3b94735c982d40692b65df229fbcf03282 |
Close
Hashes for liknorm-1.1.6-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 103b1bd132ed0ea0fe0be700741f435e6444fbaae5bacd93aae46f3be09bf4ed |
|
MD5 | ef70c21a76a76037bba6c2c42a332008 |
|
BLAKE2b-256 | d8119d8940ca578fbe1f7b37e1dcd7f81f718229a59beb2cda927a4d4fc148d4 |
Close
Hashes for liknorm-1.1.6-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8414ce59bbb338cdf93329218dd6c7bdaec479b3b97ac858745fddfa92653c68 |
|
MD5 | 1cf510e19ce09e8d7bcdcf2f4289baf1 |
|
BLAKE2b-256 | 42d9af378cfed4be63c1355d730de1e39a29478ff18d40c428e32db5580d9f06 |
Close
Hashes for liknorm-1.1.6-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 055629b6cfc65a9d85f5f1e9877888d20017f3026adc45ff7d549516877bb2b7 |
|
MD5 | ab9187544d1d76f083256d61ea7887ad |
|
BLAKE2b-256 | bd846ea33f036cdb7688bdb09f776ea3861de019ea9ac8030cdc2fe562e1efbf |
Close
Hashes for liknorm-1.1.6-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8a5c93747a6c961b4fb7b08d6c8a1ce8bbfedcd7b95ec19cb3260167739929 |
|
MD5 | 184d44dc7f3511e523a79c34d19c9662 |
|
BLAKE2b-256 | 5bcf56433e6178843a6bb465c1d1917c0e3c7e9d7562d5d4192d0097eb6bd20c |
Close
Hashes for liknorm-1.1.6-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec2b40cc2b0457026c2219158758dc28b52633a7fa0cf226a42ee2dd6e7deefd |
|
MD5 | 2b322854a4895d93a2912b831b960ea9 |
|
BLAKE2b-256 | 400600800a6c6d5350e2fbacfc75228cd34618f9e0610f4199165f5f717258fb |