{"id":18654833,"url":"https://github.com/mynameisvinn/basilisk","last_synced_at":"2025-11-05T17:30:34.931Z","repository":{"id":83935660,"uuid":"181494047","full_name":"mynameisvinn/basilisk","owner":"mynameisvinn","description":"bayesian networks made easy","archived":false,"fork":false,"pushed_at":"2019-04-24T11:39:56.000Z","size":289,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-27T14:25:46.083Z","etag":null,"topics":["bayesian-network","causal-inference","causal-models"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mynameisvinn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-15T13:35:56.000Z","updated_at":"2021-10-21T22:14:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"ba218916-fc6d-486f-b0ae-cf3067b75a55","html_url":"https://github.com/mynameisvinn/basilisk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameisvinn%2Fbasilisk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameisvinn%2Fbasilisk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameisvinn%2Fbasilisk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameisvinn%2Fbasilisk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mynameisvinn","download_url":"https://codeload.github.com/mynameisvinn/basilisk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239467450,"owners_count":19643605,"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-network","causal-inference","causal-models"],"created_at":"2024-11-07T07:16:42.955Z","updated_at":"2025-11-05T17:30:34.882Z","avatar_url":"https://github.com/mynameisvinn.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# basilisk\nquickly construct bayesian networks with basilisk. define the graph and provide joint observations, and basilik will handle everything else.\n\n## a working example\nlets use [murphy's classic sprinkler example](https://www.cs.ubc.ca/~murphyk/Bayes/bayes_tutorial.pdf).\n\nfirst, define nodes and their corresponding parents. in bayesian networks, a parent has a *casual* relationship with its children.\n```\nC = Node(\"cloudy\")\nR = Node(\"rain\", [C])  # rain's parent is cloudy\nS = Node(\"sprinkler\", [C])\nW = Node(\"wet\", [R, S])\n\nls_nodes = [C, R, S, W]\n```\nthen, instantiate a model and fit with joint observations.\n```\nmodel = BN(ls_nodes)\n\nobs = pd.read_csv(\"observations.csv\")  # joint observations\nmodel.fit(obs)  # fit a model, scikit-style\n\nmodel.draw_graph(node_size=1000)\n```\nwe can inspect conditional probability tables.\n```\nW.cpt  # basilik automatically computes conditional probabilities\n```\nwe can sample from any node in the graph.\n```\nmodel.execute(W)\n\n# {'cloudy': 'True', 'sprinkler': 'False', 'rain': 'True', 'wet': 'False'}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmynameisvinn%2Fbasilisk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmynameisvinn%2Fbasilisk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmynameisvinn%2Fbasilisk/lists"}