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
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.13.tar.gz
(6.4 kB
view hashes)
Built Distributions
Close
Hashes for liknorm-1.1.13-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 160e0fc9b589cdc41e5a8bb6b69883302bdbdd7f6588ad083095271bc301b929 |
|
MD5 | 1472b2606c7fdbe758c0269bbc65bb88 |
|
BLAKE2b-256 | ee10a4ed9995f75b3104c23c1782432774dee1876d0f1bc979777017c0977281 |
Close
Hashes for liknorm-1.1.13-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7830cc275e81b6ecda4e972a725a1d4e2717a0ae9838e0b3e4eeafa5d6e7500d |
|
MD5 | 49db9dda422bb3fc306a3475ecf58142 |
|
BLAKE2b-256 | 516bfda2680b05b37ed433446a48627b5cf3d1c8ac98b98259b95b088366e43f |
Close
Hashes for liknorm-1.1.13-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3daf9211a2eb019a39e6a7b760dd4eb16e83d7cc4e6166b1f6f0052da8442a9e |
|
MD5 | 3901d513f8d8867e56a13fd97c139140 |
|
BLAKE2b-256 | 29d8ea3a7bc8e87dc5f3b48f11311617e312025d492e499b7454b756d49d27ac |
Close
Hashes for liknorm-1.1.13-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 880b27e94577c2e0e7249b2e0a787493dd577146a0decaa68b2c211d07a52be9 |
|
MD5 | 288ea577a705c3e4753ca360a4277c6d |
|
BLAKE2b-256 | e1d55dcb3abc5b710863b417644ee82e5096c49e2d22132c543bf8097c28d456 |
Close
Hashes for liknorm-1.1.13-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc55fd7a40d311289c46581984539112b7b759e6e47fef8aabbe3eca392ff122 |
|
MD5 | 3a8d6a8c6a72eb5281c5bec35c3f15c9 |
|
BLAKE2b-256 | c1546dcbcda50e86eb485047d7efb18baf6e8e54b9b221ec3bc7e796e40ee5d4 |
Close
Hashes for liknorm-1.1.13-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc861553931040cc989e8b6f0265136a3205523fb6f16e42239c6443b4100777 |
|
MD5 | 203283d178d1db0ceb0fb464c8016768 |
|
BLAKE2b-256 | 3f49a7fe21d70abe5f88fdc7c019fa3adbba74d2ec6172ccc2718f60d83e38bb |
Close
Hashes for liknorm-1.1.13-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b14566d74f67e6ff4a4a4e9ad6e958049f5fb6b718d5808dd2614728674424b |
|
MD5 | 8c3836349b1676ce4c9b93250b330673 |
|
BLAKE2b-256 | 4311dd5f2c55a30b9b296d6104ff97fa215e52e16aca5c2f0bf33124a0fc0ea5 |
Close
Hashes for liknorm-1.1.13-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cff4bb90257f08b0b4a9daf61a74614f60e573b507a2045a1ad6fb3f413d1ee0 |
|
MD5 | 31dfcf700f4d38a098e4b5124354cacd |
|
BLAKE2b-256 | 3881da97046697ff29fbc68f5071e7f169a423302d5125e3e9a8105eceb4432e |
Close
Hashes for liknorm-1.1.13-cp27-cp27m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5caeebf01aa06976a0389ca916a1290f5f0bd0dd44610c525cc96cd0924c75d |
|
MD5 | 7bb19f9f27a817eb66dd7c6fc54bbb74 |
|
BLAKE2b-256 | 05ecedc6dce0760f2fd17079750f8e61a028ed9dc71aa91225c683c4079ab799 |