{"id":28268365,"url":"https://github.com/riskified/ps-matching","last_synced_at":"2026-04-02T02:58:54.780Z","repository":{"id":145527045,"uuid":"591924346","full_name":"Riskified/ps-matching","owner":"Riskified","description":"python class to perform propensity score matching","archived":false,"fork":false,"pushed_at":"2025-02-10T19:47:03.000Z","size":972,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-20T15:12:41.832Z","etag":null,"topics":[],"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/Riskified.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-22T11:17:24.000Z","updated_at":"2025-02-10T19:47:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"2bea5115-abc1-495d-a881-d61640744864","html_url":"https://github.com/Riskified/ps-matching","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Riskified/ps-matching","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riskified%2Fps-matching","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riskified%2Fps-matching/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riskified%2Fps-matching/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riskified%2Fps-matching/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Riskified","download_url":"https://codeload.github.com/Riskified/ps-matching/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Riskified%2Fps-matching/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260223675,"owners_count":22977260,"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":[],"created_at":"2025-05-20T15:12:43.282Z","updated_at":"2026-04-02T02:58:54.742Z","avatar_url":"https://github.com/Riskified.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ps-matching\npython class to perform propensity score matching\n\n# How to Use the ps-matching code:\n## Set global variables:\n```\nPS_GROUP = 'treatment'    # set the group variable (treatment/control)\nTARGET = 'target'         # set the target variable, the outcome of interest\nFILE_PATH = 'data/df.csv' # dataframe contains all dependant and independent variables\n```\n\n## PrepData Class initiation:\n```\ndata = PrepData(FILE_PATH, group=PS_GROUP, target=TARGET,  index_col=\"id\")\n```\n\n## initiate the PScorer and estimate the Propensity Score:\n```\nscorer = PScorer()\nscorer.fit(data.input, data.group_label)\nps_scores: Series = scorer.predict(data.input)\n```\n\n## Get ROC curve to assess model fit:\n```\nScorePlotter.plot_roc_curve(ps_scores, data.group_label) \n```\n\n## Initiate the ObsMatcher class, set the matching ratio and the caliper:\n```\nmatcher = ObsMatcher(n_matches=1, caliper=0.001)\nmatched_index: List[int] = matcher.match_scores(ps_scores, data.group_label) \n```\n\n## Plot SMD before and after matching:\n```\n ScorePlotter.plot_smd_comparison(\n        data=data.input,\n        matched_index=matched_index,\n        treatment=data.group_label\n        )\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friskified%2Fps-matching","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friskified%2Fps-matching","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friskified%2Fps-matching/lists"}