# liknorm-py
Liknorm Python wrapper.
## Install
It can be done via [pip](https://pypi.org/) or [conda](https://conda.io/).
### Pip
```bash
pip install liknorm
```
### Conda
```bash
conda install -c conda-forge liknorm-py
```
## Running the tests
After installation, you can test it
```bash
python -c "import liknorm; liknorm.test()"
```
as long as you have [pytest](http://docs.pytest.org/en/latest/).
## Example
```python
>>> 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
* [Danilo Horta](https://github.com/horta)
## License
This project is licensed under the
[MIT License](https://raw.githubusercontent.com/limix/liknorm-py/master/LICENSE.md).
Raw data
{
"_id": null,
"home_page": "https://github.com/limix/liknorm-py",
"name": "liknorm",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<3.12",
"maintainer_email": "",
"keywords": "liknorm,integration",
"author": "Danilo Horta",
"author_email": "danilo.horta@pm.me",
"download_url": "https://files.pythonhosted.org/packages/8c/ef/36617aa24e72591e59611b72b0f9f6ae2c5d368ab6a4ae7fa0760ef9ffb7/liknorm-1.2.10.tar.gz",
"platform": null,
"description": "# liknorm-py\n\nLiknorm Python wrapper.\n\n## Install\n\nIt can be done via [pip](https://pypi.org/) or [conda](https://conda.io/).\n\n### Pip\n\n```bash\npip install liknorm\n```\n\n### Conda\n\n```bash\nconda install -c conda-forge liknorm-py\n```\n\n## Running the tests\n\nAfter installation, you can test it\n\n```bash\npython -c \"import liknorm; liknorm.test()\"\n```\n\nas long as you have [pytest](http://docs.pytest.org/en/latest/).\n\n## Example\n\n```python\n>>> from numpy import empty\n>>> from numpy.random import RandomState\n>>> from liknorm import LikNormMachine\n>>>\n>>> machine = LikNormMachine('bernoulli')\n>>> random = RandomState(0)\n>>> outcome = random.randint(0, 2, 5)\n>>> tau = random.rand(5)\n>>> eta = random.randn(5) * tau\n>>>\n>>> log_zeroth = empty(5)\n>>> mean = empty(5)\n>>> variance = empty(5)\n>>>\n>>> moments = {'log_zeroth': log_zeroth, 'mean': mean, 'variance': variance}\n>>> machine.moments(outcome, eta, tau, moments)\n>>>\n>>> print('%.3f %.3f %.3f' % (log_zeroth[0], mean[0], variance[0]))\n-0.671 -0.515 0.946\n```\n\n## Authors\n\n* [Danilo Horta](https://github.com/horta)\n\n## License\n\nThis project is licensed under the\n[MIT License](https://raw.githubusercontent.com/limix/liknorm-py/master/LICENSE.md).\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Liknorm Python wrapper",
"version": "1.2.10",
"split_keywords": [
"liknorm",
"integration"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b53cad0f4e687a0aa147cfde044bfa890fe7d195f320d9d39ee5173a68739a9e",
"md5": "d2e0165548afb7510fec0a5fed2e665e",
"sha256": "cce7639070efc4b9b4dbbae9d403cf25c3772b0ebaddb2e8bb7b28ab1a866089"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp310-cp310-macosx_11_0_x86_64.whl",
"has_sig": false,
"md5_digest": "d2e0165548afb7510fec0a5fed2e665e",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8,<3.12",
"size": 72642,
"upload_time": "2023-01-22T13:43:13",
"upload_time_iso_8601": "2023-01-22T13:43:13.025317Z",
"url": "https://files.pythonhosted.org/packages/b5/3c/ad0f4e687a0aa147cfde044bfa890fe7d195f320d9d39ee5173a68739a9e/liknorm-1.2.10-cp310-cp310-macosx_11_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7c9acb36db122be10cd020de0a72c1c17d191016d2b4e36097488571e42ba261",
"md5": "08a35624e040d00ed05c3445da3a74dd",
"sha256": "a7548914df61fcdf64cd0b7197e3b1cf01c90ee5aae0ce2a8f1f97f720a69fda"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "08a35624e040d00ed05c3445da3a74dd",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8,<3.12",
"size": 114695,
"upload_time": "2023-01-22T13:43:14",
"upload_time_iso_8601": "2023-01-22T13:43:14.618016Z",
"url": "https://files.pythonhosted.org/packages/7c/9a/cb36db122be10cd020de0a72c1c17d191016d2b4e36097488571e42ba261/liknorm-1.2.10-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "72e3bd09f41240157d74b02ac5707e368a111cc739c60ed98708681643709c46",
"md5": "8f8b1f32ff48627ce8c93b9723eae9ec",
"sha256": "6d84f7a6a4c1a77a2fad80cd53ec8d95e778ac9e44e7687156ca0e1774230be6"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp310-cp310-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "8f8b1f32ff48627ce8c93b9723eae9ec",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8,<3.12",
"size": 117938,
"upload_time": "2023-01-22T13:43:16",
"upload_time_iso_8601": "2023-01-22T13:43:16.311868Z",
"url": "https://files.pythonhosted.org/packages/72/e3/bd09f41240157d74b02ac5707e368a111cc739c60ed98708681643709c46/liknorm-1.2.10-cp310-cp310-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "05ddd00ec67eb0b6bbc1d13408a83213838b6fe8545085aa3e11fe3b056f8632",
"md5": "eda373c03e37597fa7d8028e21024376",
"sha256": "0fb484bc51111fbcdf7a4539dee30d0fad2b584d88f0ef64fb1815c4a949aa81"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "eda373c03e37597fa7d8028e21024376",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8,<3.12",
"size": 57594,
"upload_time": "2023-01-22T13:43:17",
"upload_time_iso_8601": "2023-01-22T13:43:17.644549Z",
"url": "https://files.pythonhosted.org/packages/05/dd/d00ec67eb0b6bbc1d13408a83213838b6fe8545085aa3e11fe3b056f8632/liknorm-1.2.10-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e67157d43157cb94fd2218ac7c8cb1ce9a63dc647d73842a68e773fefead8a89",
"md5": "c4dbb33a47eb8dc2dafbd4135328e1e3",
"sha256": "3ab75b3199bca3df7cbc0d4e920f5ab38413bc94e02000fce5bab3888c9ab523"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp311-cp311-macosx_11_0_x86_64.whl",
"has_sig": false,
"md5_digest": "c4dbb33a47eb8dc2dafbd4135328e1e3",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8,<3.12",
"size": 88208,
"upload_time": "2023-01-22T13:43:19",
"upload_time_iso_8601": "2023-01-22T13:43:19.165890Z",
"url": "https://files.pythonhosted.org/packages/e6/71/57d43157cb94fd2218ac7c8cb1ce9a63dc647d73842a68e773fefead8a89/liknorm-1.2.10-cp311-cp311-macosx_11_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "10168bf0635f0adfe0612499cb2d43f8f53e805fb27881cea0693fe4d9e1a388",
"md5": "e4e0564c92cc3efcd3f911ca11df1200",
"sha256": "f385d1004184f7ca1e51b95982929091e0f86adb52a2ff93a02058a52bb019c9"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "e4e0564c92cc3efcd3f911ca11df1200",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8,<3.12",
"size": 143259,
"upload_time": "2023-01-22T13:43:21",
"upload_time_iso_8601": "2023-01-22T13:43:21.077535Z",
"url": "https://files.pythonhosted.org/packages/10/16/8bf0635f0adfe0612499cb2d43f8f53e805fb27881cea0693fe4d9e1a388/liknorm-1.2.10-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "092325ae21d60f7122250d1344b110293d533b5a5525ec8c6740bdafd8fbdd11",
"md5": "fc0ac6ef9c63e08af128c2e10bc31f0e",
"sha256": "d8e6c144dcc4f1d59748ad99e274004d2c49f3a8658e03573e57682dfd6b7ecc"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp311-cp311-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "fc0ac6ef9c63e08af128c2e10bc31f0e",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8,<3.12",
"size": 147660,
"upload_time": "2023-01-22T13:43:22",
"upload_time_iso_8601": "2023-01-22T13:43:22.667478Z",
"url": "https://files.pythonhosted.org/packages/09/23/25ae21d60f7122250d1344b110293d533b5a5525ec8c6740bdafd8fbdd11/liknorm-1.2.10-cp311-cp311-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b639b2f5c13348d99668d48ed92aa2cd4428c53fb14504a84e23ee7fe8bf7d3f",
"md5": "599dad47e9cd9c94c9dfd98073a18226",
"sha256": "e1fcd35bd6e020622e6e8eb227feae327faa119c909c35576546687acd5f2253"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "599dad47e9cd9c94c9dfd98073a18226",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8,<3.12",
"size": 74234,
"upload_time": "2023-01-22T13:43:24",
"upload_time_iso_8601": "2023-01-22T13:43:24.069429Z",
"url": "https://files.pythonhosted.org/packages/b6/39/b2f5c13348d99668d48ed92aa2cd4428c53fb14504a84e23ee7fe8bf7d3f/liknorm-1.2.10-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a233bb5362b7137947293c9d0914972351cd937040989113a1736d9723e481ee",
"md5": "92439abfd390066b5fef382c015610e3",
"sha256": "e71c751f1cf5ee92f76c429b05e873b1ef32c91a87bfa8325de2c97d475ce7f2"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp38-cp38-macosx_10_16_x86_64.whl",
"has_sig": false,
"md5_digest": "92439abfd390066b5fef382c015610e3",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8,<3.12",
"size": 41534,
"upload_time": "2023-01-22T13:43:25",
"upload_time_iso_8601": "2023-01-22T13:43:25.184745Z",
"url": "https://files.pythonhosted.org/packages/a2/33/bb5362b7137947293c9d0914972351cd937040989113a1736d9723e481ee/liknorm-1.2.10-cp38-cp38-macosx_10_16_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b84b188fb1e0245343ca69388e34532e21f8592f8ad43ab60ff81ff68b80c6f9",
"md5": "31c129b66a2e2f2a0efe05e735e36594",
"sha256": "be9b731239c6afe0b619ac84458d183304abfe5556b3b78fbcc81279e5ace1ab"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "31c129b66a2e2f2a0efe05e735e36594",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8,<3.12",
"size": 57683,
"upload_time": "2023-01-22T13:43:26",
"upload_time_iso_8601": "2023-01-22T13:43:26.744408Z",
"url": "https://files.pythonhosted.org/packages/b8/4b/188fb1e0245343ca69388e34532e21f8592f8ad43ab60ff81ff68b80c6f9/liknorm-1.2.10-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "351d4f9b6935ed2b66bf548cb0874af78b474deb8b65410b9ae49ff685c364a9",
"md5": "604c99ed9505cb6a3e5a1ba8acc95fde",
"sha256": "0db6e22dbcada6e3421fab90c4ab0eca7d5f490a5613569ac4e7bebf13d72d51"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp38-cp38-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "604c99ed9505cb6a3e5a1ba8acc95fde",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8,<3.12",
"size": 58637,
"upload_time": "2023-01-22T13:43:28",
"upload_time_iso_8601": "2023-01-22T13:43:28.365690Z",
"url": "https://files.pythonhosted.org/packages/35/1d/4f9b6935ed2b66bf548cb0874af78b474deb8b65410b9ae49ff685c364a9/liknorm-1.2.10-cp38-cp38-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "347b45733e8d2c0918cd02951a710e10a6e0a7c9c336b93a67cb6107f11852a9",
"md5": "d211928fc34ee0faebe663d2ad813a7e",
"sha256": "a6577fd76257bc254fe8da0afcb6c84cb842d9c83d743fef6612ac60b7bbcebc"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp38-cp38-win_amd64.whl",
"has_sig": false,
"md5_digest": "d211928fc34ee0faebe663d2ad813a7e",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8,<3.12",
"size": 24307,
"upload_time": "2023-01-22T13:43:29",
"upload_time_iso_8601": "2023-01-22T13:43:29.481192Z",
"url": "https://files.pythonhosted.org/packages/34/7b/45733e8d2c0918cd02951a710e10a6e0a7c9c336b93a67cb6107f11852a9/liknorm-1.2.10-cp38-cp38-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2ea89ce3cd247ccdabc9df2d17b3a309306661fc34ff0ee599a6b81736811b3d",
"md5": "c51baabbb1054188045023f71529a0fe",
"sha256": "bf5ee88dacf57f26d1ae7f951c885bda32b5972b693bf3b19c1522b57656a499"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp39-cp39-macosx_11_0_x86_64.whl",
"has_sig": false,
"md5_digest": "c51baabbb1054188045023f71529a0fe",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8,<3.12",
"size": 57078,
"upload_time": "2023-01-22T13:43:31",
"upload_time_iso_8601": "2023-01-22T13:43:31.254473Z",
"url": "https://files.pythonhosted.org/packages/2e/a8/9ce3cd247ccdabc9df2d17b3a309306661fc34ff0ee599a6b81736811b3d/liknorm-1.2.10-cp39-cp39-macosx_11_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8ec087b332539e8a36effeedb1718b8af445f367123b471ae1629537be281901",
"md5": "cc2fc803bc9860d10bafe45f750fc5f0",
"sha256": "c2882ce7bb2ccf85d1d94960dc8796342eb00d155e8436d47b552140fcc29cc8"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "cc2fc803bc9860d10bafe45f750fc5f0",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8,<3.12",
"size": 86089,
"upload_time": "2023-01-22T13:43:32",
"upload_time_iso_8601": "2023-01-22T13:43:32.457062Z",
"url": "https://files.pythonhosted.org/packages/8e/c0/87b332539e8a36effeedb1718b8af445f367123b471ae1629537be281901/liknorm-1.2.10-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f1cdc1e2cc9d1e16ab2d87efb3dd2baddb4d8fb6dcd5609345551638986c7ed2",
"md5": "a1da10dd2b72eedf12234a862a43544a",
"sha256": "22eb130bad9880f38a68b39faf7dae01aaeab9046158d38fcb61f22d6673e643"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp39-cp39-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "a1da10dd2b72eedf12234a862a43544a",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8,<3.12",
"size": 88186,
"upload_time": "2023-01-22T13:43:34",
"upload_time_iso_8601": "2023-01-22T13:43:34.149070Z",
"url": "https://files.pythonhosted.org/packages/f1/cd/c1e2cc9d1e16ab2d87efb3dd2baddb4d8fb6dcd5609345551638986c7ed2/liknorm-1.2.10-cp39-cp39-manylinux_2_17_x86_64.manylinux_2_5_x86_64.manylinux1_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "86ce7dfedbb237c307b8e8b2b133ff4f221ac1c36e933612cb1295a4149e3f47",
"md5": "83113bf67447a9fba188a4fb8eb48368",
"sha256": "11ae3e46898963cf908dcaf06531151d0ec7c551a11ee59e70ee376e681d9544"
},
"downloads": -1,
"filename": "liknorm-1.2.10-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "83113bf67447a9fba188a4fb8eb48368",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8,<3.12",
"size": 40951,
"upload_time": "2023-01-22T13:43:35",
"upload_time_iso_8601": "2023-01-22T13:43:35.758641Z",
"url": "https://files.pythonhosted.org/packages/86/ce/7dfedbb237c307b8e8b2b133ff4f221ac1c36e933612cb1295a4149e3f47/liknorm-1.2.10-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8cef36617aa24e72591e59611b72b0f9f6ae2c5d368ab6a4ae7fa0760ef9ffb7",
"md5": "e25edf2db52e666d661aa943e0d26917",
"sha256": "ce1fec274584e52ae8879aec9fb9849e9081d0c99485a45b87266ee1f6c803d7"
},
"downloads": -1,
"filename": "liknorm-1.2.10.tar.gz",
"has_sig": false,
"md5_digest": "e25edf2db52e666d661aa943e0d26917",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<3.12",
"size": 7373,
"upload_time": "2023-01-22T13:43:36",
"upload_time_iso_8601": "2023-01-22T13:43:36.944769Z",
"url": "https://files.pythonhosted.org/packages/8c/ef/36617aa24e72591e59611b72b0f9f6ae2c5d368ab6a4ae7fa0760ef9ffb7/liknorm-1.2.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-22 13:43:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "limix",
"github_project": "liknorm-py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "liknorm"
}