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.4.tar.gz
(6.2 kB
view hashes)
Built Distributions
Close
Hashes for liknorm-1.1.4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88083eb86795684057155ee016ccc7c3446bec6b08edece0edcce46cdb40de7b |
|
MD5 | ead59e09aa9bb4754c550ab08add06ac |
|
BLAKE2b-256 | e19338fe0238815e4f111b5e02f7911150d7990cf6f3b689abc735e9658b2709 |
Close
Hashes for liknorm-1.1.4-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4f24812a99d751c81e38a3e953fa9332de1c0b52801c80dbc07a506570d761f |
|
MD5 | 92034a575e1e858c36ce25c0f9ce4366 |
|
BLAKE2b-256 | 4e2b0c867e0f65f7a97f0535d33caf66459de5391e16b62e6ec5dadf8b62cb7d |
Close
Hashes for liknorm-1.1.4-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a206aafb76817e408f4cdbcb46b6eb5377421ce36ba83b3172e10e643c36d7a3 |
|
MD5 | 5db426877cfdf98f81a33f95a5faa28f |
|
BLAKE2b-256 | 5545ad3f6308ffa1f5f9323fda90eb8af92d95fca8ee9bf4395c69da8a97659d |
Close
Hashes for liknorm-1.1.4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a5fc715fa16abe4736905a8aa776843cb72523c6a5bc80f5d1430bb5353a140 |
|
MD5 | 96112a8708ef3f50d0809bde91c3b7a4 |
|
BLAKE2b-256 | 1477b6abba86cfc0f5ead345cb2aba0ae3c5e1a270d9fbba7f891093e1bdbc3c |
Close
Hashes for liknorm-1.1.4-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23158cdfa98ff2bb62eed15fcb088ba63eff414e51190221e3b9688f5add8fd0 |
|
MD5 | 772c5b0dc45fd54e75d8217394e6f9ba |
|
BLAKE2b-256 | a8f286ab043e45ac26019d498da96cbba6be943d4fa17bc259d02897e5844bdf |
Close
Hashes for liknorm-1.1.4-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c5b5bee272b41378a962df3d1d5eddd4a0caec2318d9dcd8f14af31e69d4e05 |
|
MD5 | 563bef1ffb1b18124c5ed5e5cd22934a |
|
BLAKE2b-256 | 8429832a954cee0bf11d0f0ebfae7c7099b0a5ff76c90bcab0bf0f0e31e2c53f |