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.0.tar.gz
(6.4 kB
view hashes)
Built Distributions
Close
Hashes for liknorm-1.2.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c20cf929ff76a5e8ba5477fc0cacd765ec343bccd4565417758d4376e38d5d1a |
|
MD5 | babf4a2e2af6d6d1b7533c11b71c7ebf |
|
BLAKE2b-256 | 2ace8b096de067786dd7c86544d08c33894680ede9aa3ba317cff7bfa1665252 |
Close
Hashes for liknorm-1.2.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32501e2dac7512187b41db3a2c871506dc5e7b17e167adea845c11aba61c546d |
|
MD5 | fddcc0761e3c8a86b49b668773c824ac |
|
BLAKE2b-256 | 93857b8a601e1bad15621e6a99bdf7f3c50942edc8458634ea19b1e85162b4f8 |
Close
Hashes for liknorm-1.2.0-cp37-cp37m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eccd2d8e0f249ae4a29b0bc9275e32ce2394632b3a27e3878e49ab4a58de11a |
|
MD5 | 222b954132ba72d6f965521db3a2bf6d |
|
BLAKE2b-256 | c17806e02add7aad1e4d8e2c1e1a828c9d20ebe7b913031716c133f7f3cb105f |
Close
Hashes for liknorm-1.2.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdd52ef8e7f0e2ad0d7719ddabb8f62991161ff7cf4f150c14905086198659c0 |
|
MD5 | 6d397c3761e4640fdac648e227a9f0f4 |
|
BLAKE2b-256 | 38988b6ac6548444a61a94487c0c93341de859ea85610b377f908804fc02d800 |
Close
Hashes for liknorm-1.2.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e540d968a0931a561e5a4a6e761626d5a16ffcd806a70332d1b3e25983ba6956 |
|
MD5 | 0a92739ec3edb3ef7437c9fb89d58005 |
|
BLAKE2b-256 | 57d623ebd3698b679da459260b95b1f631f4c0ca920f7413a9600b0fa0b99a6e |
Close
Hashes for liknorm-1.2.0-cp36-cp36m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f51d73534881e32bc2eb675623c6789d466f4e581ece3029ecaa592fb3c20920 |
|
MD5 | 3c687890bebb5ea08a501903a84a6479 |
|
BLAKE2b-256 | 560a12f2385e6ab56db9e9aaee1991ceb68e78ec301ac28e5e870649f0ddafb0 |
Close
Hashes for liknorm-1.2.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | caf2cdb36d6d1b8281d673519a3c3d5e884bd10e09cf8ff15c1c1385b593ff9a |
|
MD5 | 57cbe073e8233d54d032ed698267ca9c |
|
BLAKE2b-256 | f949dc93f286a29e599d2e2b1ead1005ada14d9d0d3ab639e92cd2e69ae807ca |
Close
Hashes for liknorm-1.2.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 208a822b04999237d9091c489224d868f451918a0a8e61e68aaf078637e1b841 |
|
MD5 | 5fb05df03f53671d2953afb502936193 |
|
BLAKE2b-256 | d6b743a2a277b88bee248e585d7291c3086d0e6db66a6485b6e71242d933fbae |
Close
Hashes for liknorm-1.2.0-cp27-cp27m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1018db03bf652dd0395a73c05debf750e41067d62fb4e456c744d03e108a8f84 |
|
MD5 | 84093ba2c00b760b10fc51f135d343f7 |
|
BLAKE2b-256 | 686bb68c51f07e4ce3b5436c8e57a411c893f4b25e680fa0c33924e0a6914c0f |