Skip to main content

Liknorm Python wrapper

Project description

liknorm-py

Travis

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for liknorm, version 1.2.3
Filename, size File type Python version Upload date Hashes
Filename, size liknorm-1.2.3-cp36-cp36m-macosx_10_6_intel.whl (16.4 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size liknorm-1.2.3-cp36-cp36m-manylinux1_x86_64.whl (34.6 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size liknorm-1.2.3-cp36-cp36m-manylinux2010_x86_64.whl (34.6 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size liknorm-1.2.3-cp36-cp36m-win_amd64.whl (15.5 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size liknorm-1.2.3-cp37-cp37m-macosx_10_6_intel.whl (16.4 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size liknorm-1.2.3-cp37-cp37m-manylinux1_x86_64.whl (34.6 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size liknorm-1.2.3-cp37-cp37m-manylinux2010_x86_64.whl (34.6 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size liknorm-1.2.3-cp37-cp37m-win_amd64.whl (15.5 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size liknorm-1.2.3-cp38-cp38-macosx_10_9_x86_64.whl (12.6 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size liknorm-1.2.3-cp38-cp38-manylinux1_x86_64.whl (35.2 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size liknorm-1.2.3-cp38-cp38-manylinux2010_x86_64.whl (35.2 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size liknorm-1.2.3-cp38-cp38-win_amd64.whl (15.5 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size liknorm-1.2.3.tar.gz (6.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page