{"id":31553585,"url":"https://github.com/felixleopoldo/trilearn","last_synced_at":"2025-10-04T20:26:53.132Z","repository":{"id":29780171,"uuid":"121228805","full_name":"felixleopoldo/trilearn","owner":"felixleopoldo","description":"Bayesian structure learning and classification in decomposable graphical models.","archived":false,"fork":false,"pushed_at":"2024-01-22T09:25:51.000Z","size":1681,"stargazers_count":11,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-30T14:48:23.761Z","etag":null,"topics":["bayesian-inference","bayesian-statistics","classification","covariance-selection","decomposable-graphical-models","decomposable-graphs","gaussian-graphical-models","log-linear-model","machine-learning","markov-networks","predictive-modeling","sequential-monte-carlo"],"latest_commit_sha":null,"homepage":"https://trilearn.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felixleopoldo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-12T09:51:46.000Z","updated_at":"2025-03-12T01:44:24.000Z","dependencies_parsed_at":"2023-12-08T16:29:40.914Z","dependency_job_id":"8c6f798c-c737-4e9b-a20d-eb3817b59ced","html_url":"https://github.com/felixleopoldo/trilearn","commit_stats":{"total_commits":152,"total_committers":5,"mean_commits":30.4,"dds":0.25,"last_synced_commit":"94a2b37013148ad96513e335e42f45023dd35cf2"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/felixleopoldo/trilearn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixleopoldo%2Ftrilearn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixleopoldo%2Ftrilearn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixleopoldo%2Ftrilearn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixleopoldo%2Ftrilearn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felixleopoldo","download_url":"https://codeload.github.com/felixleopoldo/trilearn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixleopoldo%2Ftrilearn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278367977,"owners_count":25975364,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-inference","bayesian-statistics","classification","covariance-selection","decomposable-graphical-models","decomposable-graphs","gaussian-graphical-models","log-linear-model","machine-learning","markov-networks","predictive-modeling","sequential-monte-carlo"],"created_at":"2025-10-04T20:26:49.477Z","updated_at":"2025-10-04T20:26:53.127Z","avatar_url":"https://github.com/felixleopoldo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub](https://img.shields.io/github/license/felixleopoldo/trilearn)\n![PyPI](https://img.shields.io/pypi/v/trilearn)\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/pypi/trilearn)\n\n# Bayesian inference in decomposable graphical models using sequential Monte Carlo methods\nThis library contains Bayesian inference in decomposable (triangulated) graphical models based on sequential Monte Carlo methods.\nCurrently supported functionalities include:\n\n- Bayesian structure learning for discrete log-linear and Gaussian data.\n\n- Estimation of the number of decomopsable graphs with a \ngiven number of nodes.\n\n- Predictive classification using Bayesian model averaging (BMA).\n\n- Random generation of junction trees (the Christmas tree algorithm).\n\n### Installation\nIf graphviz is not installed, you can install it from brew / aptitude / pacman for example\n```\n$ brew install graphviz\n```\nOn Ubuntu you might need to run\n```\nsudo apt-get install python-dev graphviz libgraphviz-dev pkg-config\n```\n\nThen run\n```\n$ pip install trilearn\n```\n\nIt is also possible to pull trilearn as a docker image by\n```\n$ docker pull onceltuca/trilearn\n```\n\n### Running the tests\n\n```\n$ make test\n```\n## Usage\nSee the Jupyter notebooks for examples of usage.\n\n\n## Scripts\n### Continuous data\nTo approximate the underlying decomposable graph posterior given the dataset sample_data/data_ar1-5.csv run\n```\n$ pgibbs_ggm_sample -N 50 -M 1000 -f sample_data/data_ar1-5.csv -o results_ggm\n```\nthis will produce a file containing the Markov chain generated by the particle Gibbs algorithm. \nIn order to analyze the chain run\n```\n$ analyze_graph_tajectories -i results_ggm -o results_ggm/plots\n```\nthis will produce a bunch of files in the current directory to be analyzed.\n\n### Discrete data\nThe data set examples/data/czech_autoworkers.csv contains six binary variables.\nTo generate a particle Gibbs trajectory of decomposable graphs type\n```\n$ pgibbs_loglinear_sample -N 50 -M 300 -f sample_data/czech_autoworkers.csv  -o results_loglin\n```\nand\n```\n$ analyze_graph_tajectories -i results_loglin -o results_loglin/plots\n```\nthis will produce a number of files in the current directory.\n\n### Estimate the number of decomposable graphs\n\nTo estimate the number of decomposable graphs with up to 15 nodes run for example\n```\n$ count_chordal_graphs -p 15 -N 20000\n```\n## Built With\n\n* [NetworkX](https://networkx.github.io/documentation/stable/index.html)\n\n* [NumPy](https://docs.scipy.org/doc/)\n\n* [Scipy](https://docs.scipy.org/doc/)\n\n* [Pandas](http://pandas.pydata.org/pandas-docs/stable/)\n\n* [Seaborn](https://seaborn.pydata.org/api.html)\n## Authors\n\n* **Felix L. Rios** just send me an e-mail in case of any questions, felix.leopoldo.rios at gmail com \n\n## References\n* [J. Olsson, T. Pavlenko, and F. L. Rios. Bayesian learning of weakly structural Markov graph laws using sequential Monte Carlo methods. *Electron. J. Statist.*, 13(2):2865–2897, 2019.](https://projecteuclid.org/euclid.ejs/1567065622)\n* [J. Olsson, T. Pavlenko, F. L. Rios, Sequential sampling of junction trees for decomposable graphs,\n *Statistics and Computing* 32, 80, 2022]( https://doi.org/10.1007/s11222-022-10113-2)\n* [T. Pavlenko, F. L. Rios, Graphical posterior predictive classifier: Bayesian model averaging with particle Gibbs, Theor. Probability and Math. Statist. 109: 81-99, 2023](https://www.ams.org/journals/tpms/2023-109-00/S0094-9000-2023-01198-0/)\n\n## License\n\nThis project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details\n\n## Acknowledgments\n\n* **Jim Holmstrom**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixleopoldo%2Ftrilearn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixleopoldo%2Ftrilearn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixleopoldo%2Ftrilearn/lists"}