{"id":34108205,"url":"https://github.com/almost-matching-exactly/dame-flame-python-package","last_synced_at":"2026-04-09T04:02:35.001Z","repository":{"id":40014116,"uuid":"197606762","full_name":"almost-matching-exactly/DAME-FLAME-Python-Package","owner":"almost-matching-exactly","description":"A Python Package providing two algorithms, DAME and FLAME, for fast and interpretable treatment-control matches of categorical data","archived":false,"fork":false,"pushed_at":"2025-07-26T19:14:06.000Z","size":5151,"stargazers_count":62,"open_issues_count":16,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-08T00:31:41.091Z","etag":null,"topics":["causal-inference","data-science","econometrics","machine-learning","matching","python"],"latest_commit_sha":null,"homepage":"https://almost-matching-exactly.github.io/DAME-FLAME-Python-Package/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/almost-matching-exactly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2019-07-18T14:52:23.000Z","updated_at":"2025-10-18T00:30:55.000Z","dependencies_parsed_at":"2025-07-28T04:31:02.420Z","dependency_job_id":null,"html_url":"https://github.com/almost-matching-exactly/DAME-FLAME-Python-Package","commit_stats":{"total_commits":124,"total_committers":7,"mean_commits":"17.714285714285715","dds":0.3629032258064516,"last_synced_commit":"470f202ee50cf89af5d614ddf87a21ea9ee14a35"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/almost-matching-exactly/DAME-FLAME-Python-Package","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almost-matching-exactly%2FDAME-FLAME-Python-Package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almost-matching-exactly%2FDAME-FLAME-Python-Package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almost-matching-exactly%2FDAME-FLAME-Python-Package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almost-matching-exactly%2FDAME-FLAME-Python-Package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/almost-matching-exactly","download_url":"https://codeload.github.com/almost-matching-exactly/DAME-FLAME-Python-Package/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/almost-matching-exactly%2FDAME-FLAME-Python-Package/sbom","scorecard":{"id":186166,"data":{"date":"2025-08-11","repo":{"name":"github.com/almost-matching-exactly/DAME-FLAME-Python-Package","commit":"6dcbc3c3945f1eb4f89f8386ef6418e72755ba73"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"29 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-cr5q-6q9f-rq6q","Warn: Project is vulnerable to: GHSA-j6gc-792m-qgm2","Warn: Project is vulnerable to: GHSA-pj73-v5mw-pm9j","Warn: Project is vulnerable to: GHSA-48wp-p9qv-4j64","Warn: Project is vulnerable to: GHSA-4qw4-jpp4-8gvp","Warn: Project is vulnerable to: GHSA-636f-xm5j-pj9m","Warn: Project is vulnerable to: GHSA-7vh7-fw88-wj87","Warn: Project is vulnerable to: GHSA-fmx4-26r3-wxpf","Warn: Project is vulnerable to: GHSA-52p9-v744-mwjj","Warn: Project is vulnerable to: GHSA-353f-x4gh-cqq8","Warn: Project is vulnerable to: GHSA-5w6v-399v-w3cc","Warn: Project is vulnerable to: GHSA-mrxw-mxhj-p664","Warn: Project is vulnerable to: GHSA-r95h-9x8f-r3f7","Warn: Project is vulnerable to: GHSA-vvfq-8hwr-qm4m","Warn: Project is vulnerable to: GHSA-xc9x-jj77-9p9j","Warn: Project is vulnerable to: GHSA-2rxp-v6pw-ch6m","Warn: Project is vulnerable to: GHSA-4xqq-m2hx-25v8","Warn: Project is vulnerable to: GHSA-5866-49gr-22v4","Warn: Project is vulnerable to: GHSA-r55c-59qm-vjw6","Warn: Project is vulnerable to: GHSA-vg3r-rm7w-2xgh","Warn: Project is vulnerable to: GHSA-vmwr-mc7x-5vc3","Warn: Project is vulnerable to: GHSA-hgjp-83m4-h4fj","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: GHSA-6p56-wp2h-9hxr","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2020-73","Warn: Project is vulnerable to: PYSEC-2024-110 / GHSA-jw8x-6495-233v","Warn: Project is vulnerable to: PYSEC-2020-108 / GHSA-jxfp-4rvq-9h9m"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T19:50:19.026Z","repository_id":40014116,"created_at":"2025-08-16T19:50:19.026Z","updated_at":"2025-08-16T19:50:19.026Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31584820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"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":["causal-inference","data-science","econometrics","machine-learning","matching","python"],"created_at":"2025-12-14T18:14:44.946Z","updated_at":"2026-04-09T04:02:34.989Z","avatar_url":"https://github.com/almost-matching-exactly.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Build Status](https://app.travis-ci.com/almost-matching-exactly/DAME-FLAME-Python-Package.svg?branch=master)](https://app.travis-ci.com/almost-matching-exactly/DAME-FLAME-Python-Package)\n[![Coverage Status](https://coveralls.io/repos/github/almost-matching-exactly/DAME-FLAME-Python-Package/badge.svg)](https://coveralls.io/github/almost-matching-exactly/DAME-FLAME-Python-Package)\n\n\u003c!-- Comment hi.  --\u003e\n# DAME-FLAME\nA Python package for performing matching for observational causal inference on datasets containing discrete covariates\n--------------------------------------------------\n\n## Documentation [here](https://almost-matching-exactly.github.io/DAME-FLAME-Python-Package/)\n\nDAME-FLAME is a Python package for performing matching for observational causal inference on datasets containing discrete covariates. It implements the Dynamic Almost Matching Exactly (DAME) and Fast, Large-Scale Almost Matching Exactly (FLAME) algorithms, which match treatment and control units on subsets of the covariates. The resulting matched groups are interpretable, because the matches are made on covariates, and high-quality, because machine learning is used to determine which covariates are important to match on.\n\n### Installation\n\n#### Dependencies\n`dame-flame` requires Python version (\u003e=3.6.5). Install from [here](https://www.python.org/downloads/) if needed.\n\n- pandas\u003e=0.11.0\n- numpy\u003e= 1.16.5\n- scikit-learn\u003e=0.23.2\n\n\nIf your python version does not have these packages, install from [here](https://packaging.python.org/tutorials/installing-packages/).\n\nTo run the examples in the examples folder (these are not part of the package), Jupyter Notebooks or Jupyter Lab (available [here](https://jupyter.org/install)) and Matplotlib (\u003e=2.0.0) is also required.\n\n#### User Installation\n\nDownload from PyPi via\n$ pip install dame-flame\n\n\n# A Tutorial to FLAME-database version\n\n#### Make toy dataset \n```\nimport pandas as pd\nfrom dame_flame.flame_db.utils import *\nfrom dame_flame.flame_db.FLAME_db_algorithm import *\n\ntrain_df = pd.DataFrame([[0,1,1,1,0,5], [0,1,1,0,0,6], [1,0,1,1,1,7], [1,1,1,1,1,7]], \n                  columns=[\"x1\", \"x2\", \"x3\", \"x4\", \"treated\", \"outcome\"])\ntest_df = pd.DataFrame([[0,1,1,1,0,5], [0,1,1,0,0,6], [1,0,1,1,1,7], [1,1,1,1,1,7]], \n                  columns=[\"x1\", \"x2\", \"x3\", \"x4\", \"treated\", \"outcome\"])                 \n```\n\n#### Connect to the database\n```\nselect_db = \"postgreSQL\"  # Select the database you are using: \"MySQL\", \"postgreSQL\",\"Microsoft SQL server\"\ndatabase_name='tmp' # database name you use \nhost = 'localhost' \nport = \"5432\"\nuser=\"postgres\"\npassword= \"\"\n\nconn = connect_db(database_name, user, password, host, port)\n```\n\n\n\n#### Insert the data to be matched into database\n\nIf you already have the dataset in the database, please ignore this step. Insert the test_df (data to be matched) into the database you are using.\n```\nfrom dame_flame.flame_db.gen_insert_data import *\ninsert_data_to_db(\"datasetToBeMatched\", # The name of your table containing the dataset to be matched\n                  test_df,\n                  treatment_column_name= \"treated\",\n                  outcome_column_name= 'outcome',conn = conn)\n```\n#### Run FLAME_db\n\n```\nres = FLAME_db(input_data = \"datasetToBeMatched\", # The name of your table containing the dataset to be matched\n              holdout_data = train_df, # holdout set. We will use holdout set to train our model\n              conn = conn # connector object that connects to your database. This is the output from function connect_db.\n              )\n```\n\n#### Analysis results\n```\nres[0]:\n    data frame of matched groups. Each row represent one matched groups.\n    res[0]['avg_outcome_control']: \n        average of control units' outcomes in each matched group   \n    res[0]['avg_outcome_treated']: \n        average of treated units' outcomes in each matched group   \n    res[0]['num_control']:\n        the number of control units in each matched group\n    res[0]['num_treated']:\n        the number of treated units in each matched group\n    res[0]['is_matched']:\n        the level each matched group belongs to\nres[1]:\n    a list of level numbers where we have matched groups\nres[2]:\n    a list of covariate names that we dropped\n```\n#### Postprocessing\n\n```\nATE_db(res) # Get ATE for the whole dataset\nATT_db(res) # Get ATT for the whole dataset\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmost-matching-exactly%2Fdame-flame-python-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falmost-matching-exactly%2Fdame-flame-python-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falmost-matching-exactly%2Fdame-flame-python-package/lists"}