The Almost Matching Exactly Lab has produced four main algorithms for interpretable matching. Each algorithm has its own unique applications. Use the information below to decide which algorithm is right for you!

DAME (Dynamic Almost Matching Exactly):
Languages: Python
Input Data: Categorical covariates, small to moderately-sized datasets
Matching Method: Uses bit-vector computations to match units based on a learned, weighted Hamming distance
Included Functions:
(Python Package)
DAME returns all of the units that were matched and the covariates that they were matched on.
mmg_of_unit returns the main matched group of the specified unit.
te_of_unit returns the treatment effect for the specified unit.
mmg_and_te_of_unit returns both the main matched group and the treatment effect for the specified unit.
Paper: Interpretable Almost Matching Exactly for Causal Inference
FLAME (Fast Large-Scale Almost Matching Exactly):
Languages: R, Python
Input Data: Categorical covariates, scales well to large datasets with millions of observations
Matching Method: Uses bit-vector computations to match units based on a learned, weighted Hamming distance. FLAME successively drops irrelevant covariates to lessen the computational load while still maintaining enough covariates for high-quality conditional average treatment effect (CATE) estimation.
Included Functions:
(R Package)
FLAME returns the original data frame; indicating which units were matched, on what covariates, and how many times; a list of all matched groups formed; the CATE of every matched group; and a vector indicating which covariates were dropped at each iteration.
gen_data generates sample data for matching.
CATE returns the CATEs for the specified units.
ATT returns the average treatment effect on the treated (ATT) for a matched dataset.
ATE returns the average treatment effect (ATE) for a matched dataset.
MG returns the matched groups for the specified units.
Included Functions:
(Python Package)
FLAME returns all of the units that were matched and the covariates that they were matched on.
mmg_of_unit returns the main matched group of the specified unit.
te_of_unit returns the treatment effect for the specified unit.
mmg_and_te_of_unit returns both the main matched group and the treatment effect for the specified unit.
Paper: FLAME: A Fast Large-scale Almost Matching Exactly Approach to Causal Inference
MALTS (Matching After Learning to Stretch):
Languages: Python
Input Data: Continuous, categorical or mixed (continous or categorical) covariates
Matching Method: Uses exact matching for discrete variables and learned, generalized Mahalanobis distances for continuous variables. Instead of a predetermined distance metric, the covariates contributing more towards predicting the outcome are given higher weights.
Included Functions:
(Python Package)
malts_mf sets up the model for learning the distance metric.
MG_matrix returns a square matrix of size equal to the number of data entries. Entry (i,j) stores the weight of unit j in the matched group for unit i.
CATE_df returns a matrix containing the CATE estimations and standard deviations for every unit along with the treated and outcome columns.
Paper: Matching After Learning To Stretch
AHB (Adaptive Hyper-box Matching):
Languages: R
Input Data: Continuous, categorical or mixed (continous or categorical) covariates
Matching Method: AHB matches units with others in unit-specific, hyper-box-shaped regions of the covariate space.The regions are found as either the solution to a mixed integer program, or using a (fast) approximation algorithm.
Included Functions:
(R Package)
AHB_fast_match returns a list with five entries: data to be matched, units_id for each treated units, CATE for each matched group, bins for each hpyerbox, MGs (matched groups) for each treated units.
AHB_MIP_match returns a list with five entries: data to be matched, units_id for each treated units, CATE for each matched group, bins for each hpyerbox, MGs (matched groups) for each treated units.
gen_data generates sample data for matching.
ATT returns the average treatment effect on the treated (ATT) for a matched dataset.
ATE returns the average treatment effect (ATE) for a matched dataset.
Paper: Adaptive Hyper-box Matching for Interpretable Individualized Treatment Effect Estimation

Additional Algorithms

While not included in the FLAME packages, the database implementation of FLAME is extremely powerful for analyzing datasets which are too large to fit on memory. The algorithm uses SQL queries to operate directly on the database and is specialized to be highly efficient. To use this algorithm, visit the almost-matching-exactly Github.

Recommended for datasets with many features, the Hybrid FLAME-DAME algorithm uses FLAME to quickly remove less relevant features, and then switches to DAME to produce high-quality interpretable matches. This algorithm scales well without noticable loss in the quality of matches. To use this approach, install the FLAME Python package and read the Key Parameters section for information on how to implement the hybrid algorithm using the pre_dame parameter.

For the purpose of instrumental variable analysis, the FLAME IV algorithm yields high quality, interpretable matching outcomes using a learned, adaptive distance metric. Much like the traditional FLAME implementation, FLAME IV scales easily to large datasets. To use this approach, visit the almost-matching-exactly Github. To learn more about this implementation of FLAME, click here to read the relevant paper (also available in 'Additional Resources').

Finally, the FLAME Networks algorithm leverages these same matching techniques to recover direct treatment effects from randomized experiments in which units interfere with each other. The algorithm uses observed network interactions to account for treatment interference between units and outputs highly interpretable results. To use this approach, visit the author's Github. To learn more about this implementation of FLAME, click here to read the relevant paper (also available in 'Additional Resources').