{"id":19647072,"url":"https://github.com/idsia/crema","last_synced_at":"2025-04-28T15:31:15.406Z","repository":{"id":45426743,"uuid":"263960245","full_name":"IDSIA/crema","owner":"IDSIA","description":"Crema: Credal Models Algorithms","archived":false,"fork":false,"pushed_at":"2024-03-06T10:19:11.000Z","size":472844,"stargazers_count":10,"open_issues_count":15,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T09:22:52.006Z","etag":null,"topics":["bayesian","bayesian-models","credal","credal-models","crema","imprecise-probability","inference","probabilistic-graphical-models","probability"],"latest_commit_sha":null,"homepage":"https://crema-toolbox.readthedocs.io/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IDSIA.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.bib","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-14T15:58:04.000Z","updated_at":"2023-11-28T15:16:59.000Z","dependencies_parsed_at":"2024-11-11T14:53:07.893Z","dependency_job_id":null,"html_url":"https://github.com/IDSIA/crema","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDSIA%2Fcrema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDSIA%2Fcrema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDSIA%2Fcrema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IDSIA%2Fcrema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IDSIA","download_url":"https://codeload.github.com/IDSIA/crema/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251338606,"owners_count":21573584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian","bayesian-models","credal","credal-models","crema","imprecise-probability","inference","probabilistic-graphical-models","probability"],"created_at":"2024-11-11T14:42:15.826Z","updated_at":"2025-04-28T15:31:12.887Z","avatar_url":"https://github.com/IDSIA.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub version](https://badge.fury.io/gh/idsia%2Fcrema.svg)](https://badge.fury.io/gh/idsia%2Fcrema)\n![example workflow](https://github.com/IDSIA/crema/actions/workflows/maven.yaml/badge.svg?branch=master)\n\n\u003cimg src=\"docs/_static/img/logo.png\" alt=\"Crema\" width=\"500\"/\u003e\n\nCreMA is an open-source java toolbox that provides multiple\nlearning and inference algorithms for credal models.\n\nAn example of exact inference in a credal network is given below.\n\n```java\nimport ch.idsia.crema.core.ObservationBuilder;\nimport ch.idsia.crema.core.Strides;\nimport ch.idsia.crema.factor.credal.vertex.separate.VertexFactor;\nimport ch.idsia.crema.factor.credal.vertex.separate.VertexFactorFactory;\nimport ch.idsia.crema.inference.ve.CredalVariableElimination;\nimport ch.idsia.crema.model.graphical.DAGModel;\nimport ch.idsia.crema.model.graphical.GraphicalModel;\n\npublic class Starting {\n\tpublic static void main(String[] args) {\n\t\tdouble p = 0.2;\n\t\tdouble eps = 0.0001;\n\n\t\t/*  CN defined with vertex Factor  */\n\n\t\t// Define the model (with vertex factors)\n\t\tGraphicalModel\u003cVertexFactor\u003e model = new DAGModel\u003c\u003e();\n\t\tint A = model.addVariable(3);\n\t\tint B = model.addVariable(2);\n\n\t\tmodel.addParent(B, A);\n\n\t\t// Define a credal set of the partent node\n\t\tVertexFactor fu = VertexFactorFactory.factory().domain(model.getDomain(A), Strides.empty())\n\t\t\t\t.addVertex(new double[]{0., 1 - p, p})\n\t\t\t\t.addVertex(new double[]{1 - p, 0., p})\n\t\t\t\t.get();\n\n\t\tmodel.setFactor(A, fu);\n\n\t\t// Define the credal set of the child\n\t\tVertexFactor fx = VertexFactorFactory.factory().domain(model.getDomain(B), model.getDomain(A))\n\t\t\t\t.addVertex(new double[]{1., 0.,}, 0)\n\t\t\t\t.addVertex(new double[]{1., 0.,}, 1)\n\t\t\t\t.addVertex(new double[]{0., 1.,}, 2)\n\t\t\t\t.get();\n\n\t\tmodel.setFactor(B, fx);\n\n\t\t// Run exact inference\n\t\tCredalVariableElimination inf = new CredalVariableElimination();\n\t\tinf.query(model, ObservationBuilder.observe(B, 0), A);\n\t}\n}\n``` \n\n## Installation\n\nAdd the following code in the  pom.xml of your project:\n\n```xml\n    \u003crepositories\u003e\n        \u003crepository\u003e\n            \u003cid\u003ecremaRepo\u003c/id\u003e\n            \u003curl\u003ehttps://raw.github.com/idsia/crema/mvn-repo/\u003c/url\u003e\n        \u003c/repository\u003e\n    \u003c/repositories\u003e\n\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ech.idsia\u003c/groupId\u003e\n            \u003cartifactId\u003ecrema\u003c/artifactId\u003e\n            \u003cversion\u003e0.2.1\u003c/version\u003e\n            \u003cscope\u003ecompile\u003c/scope\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n```\n\n## Citation\n\nIf you write a scientific paper describing research that made use of the CREMA library, please cite the following paper:\n\n```\nHuber, D., Cabañas, R., Antonucci, A., Zaffalon, M. (2020).\nCREMA: a Java library for credal network inference.\nIn Jaeger, M., Nielsen, T.D. (Eds), \nProceedings of the 10th International Conference on Probabilistic Graphical Models (PGM 2020), \nProceedings of Machine Learning Research, PMLR, Aalborg, Denmark.\n```\n\nIn BiBTeX format (for your convenience):\n\n```bibtex\n@INPROCEEDINGS{huber2020a,\n   title = {{CREMA}: a {J}ava library for credal network inference},\n   editor = {Jaeger, M. and Nielsen, T.D.},\n   publisher = {PMLR},\n   address = {Aalborg, Denmark},\n   series = {Proceedings of Machine Learning Research},\n   booktitle = {Proceedings of the 10th International Conference on Probabilistic Graphical Models ({PGM} 2020)},\n   author = {Huber, D. and Caba\\~nas, R. and Antonucci, A. and Zaffalon, M.},\n   year = {2020},\n   url = {https://pgm2020.cs.aau.dk}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidsia%2Fcrema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidsia%2Fcrema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidsia%2Fcrema/lists"}