Constraint Satisfaction Matcher
The ConstraintSatisfactionMatcher can be used to optimize any linear function of the baseline covariates. We support constraints on the size of the subset populations and the allowed mismatch.
Here, we demonstrate the optimization of balance subject to size constraints only. Namely, we solve:
\begin{equation} \begin{aligned} & \underset{\hat{P}}{\text{minimize}} & & \sum_k |\mu_{\hat{P}k} - \mu_{Tk}| \\ & \text{subject to} & & |\hat{P}| = P^* \\ & & & |\hat{T}| = T^* \\ \end{aligned} \end{equation}
where \(P\) and \(T\) refer to two populations we are trying to match, \(\hat{P}\) and \(\hat{T}\) are the subsets of \(P\) and \(T\) we are seeking, \(P^*\) and \(T^*\) are fixed integers, and \(k\) indexes the covariates of \(P\) and \(T\).
[1]:
import logging
logging.basicConfig(
format="%(levelname)-4s [%(filename)s:%(lineno)d] %(message)s",
level='INFO',
)
from pybalance.utils import (
BetaBalance,
BetaXBalance,
GammaBalance,
GammaXBalance,
GammaXTreeBalance
)
from pybalance.sim import generate_toy_dataset
from pybalance.lp import ConstraintSatisfactionMatcher
from pybalance.visualization import (
plot_numeric_features,
plot_categoric_features,
plot_binary_features,
plot_per_feature_loss,
)
[2]:
time_limit = 60
[3]:
m = generate_toy_dataset()
m
[3]:
['age', 'height', 'weight']
Headers Categoric:
['gender', 'haircolor', 'country', 'binary_0', 'binary_1', 'binary_2', 'binary_3']
Populations
['pool', 'target']
| age | height | weight | gender | haircolor | country | population | binary_0 | binary_1 | binary_2 | binary_3 | patient_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 62.511573 | 190.229250 | 105.165097 | 0.0 | 2 | 3 | pool | 0 | 0 | 0 | 0 | 0 |
| 1 | 68.505065 | 161.121236 | 95.001474 | 0.0 | 1 | 1 | pool | 1 | 0 | 1 | 0 | 1 |
| 2 | 50.071384 | 162.325356 | 84.290576 | 1.0 | 0 | 5 | pool | 0 | 0 | 1 | 1 | 2 |
| 3 | 44.423692 | 150.948096 | 82.031381 | 1.0 | 2 | 2 | pool | 0 | 0 | 0 | 1 | 3 |
| 4 | 41.695052 | 132.952651 | 54.857540 | 0.0 | 1 | 3 | pool | 0 | 0 | 1 | 1 | 4 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 995 | 21.474205 | 168.602546 | 70.342128 | 0.0 | 2 | 5 | target | 0 | 0 | 0 | 1 | 10995 |
| 996 | 40.643320 | 188.188724 | 61.611744 | 0.0 | 2 | 4 | target | 1 | 0 | 0 | 1 | 10996 |
| 997 | 29.472765 | 161.408162 | 57.214095 | 0.0 | 0 | 1 | target | 0 | 1 | 1 | 1 | 10997 |
| 998 | 41.291949 | 150.968833 | 91.270798 | 0.0 | 0 | 3 | target | 0 | 0 | 0 | 0 | 10998 |
| 999 | 67.530294 | 155.124741 | 56.196505 | 1.0 | 0 | 1 | target | 1 | 0 | 0 | 0 | 10999 |
11000 rows × 12 columns
Optimize Beta (Mean Absolute SMD)
[4]:
objective = beta = BetaBalance(m)
matcher = matcher_beta = ConstraintSatisfactionMatcher(
m,
time_limit=time_limit,
objective=objective,
ps_hinting=False,
num_workers=4)
matcher.get_params()
INFO [matcher.py:66] Scaling features by factor 240.00 in order to use integer solver with <= 0.2841% loss.
[4]:
{'objective': 'beta',
'pool_size': 1000,
'target_size': 1000,
'max_mismatch': None,
'time_limit': 60,
'num_workers': 4,
'ps_hinting': False,
'verbose': True}
[5]:
matcher.match()
INFO [matcher.py:499] Solving for match population with pool size = 1000 and target size = 1000, optimizing balance (no max_mismatch cap).
INFO [matcher.py:503] Matching on 15 dimensions ...
INFO [matcher.py:510] Building model variables and constraints ...
INFO [matcher.py:519] Calculating bounds on feature variables ...
INFO [matcher.py:609] Applying size constraints on pool and target ...
INFO [matcher.py:239] Solving with 4 workers ...
INFO [matcher.py:91] Initial balance score: 0.2328
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 1, time = 0.02 m
INFO [matcher.py:102] Objective: 452948000.0
INFO [matcher.py:123] Balance (beta): 0.2298
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 2, time = 0.03 m
INFO [matcher.py:102] Objective: 452876000.0
INFO [matcher.py:123] Balance (beta): 0.2297
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 3, time = 0.04 m
INFO [matcher.py:102] Objective: 452777000.0
INFO [matcher.py:123] Balance (beta): 0.2297
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 4, time = 0.04 m
INFO [matcher.py:102] Objective: 452736000.0
INFO [matcher.py:123] Balance (beta): 0.2296
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 5, time = 0.04 m
INFO [matcher.py:102] Objective: 452730000.0
INFO [matcher.py:123] Balance (beta): 0.2296
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 6, time = 0.05 m
INFO [matcher.py:102] Objective: 452596000.0
INFO [matcher.py:123] Balance (beta): 0.2295
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 7, time = 0.05 m
INFO [matcher.py:102] Objective: 452537000.0
INFO [matcher.py:123] Balance (beta): 0.2294
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 8, time = 0.06 m
INFO [matcher.py:102] Objective: 452040000.0
INFO [matcher.py:123] Balance (beta): 0.2291
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 9, time = 0.08 m
INFO [matcher.py:102] Objective: 451825000.0
INFO [matcher.py:123] Balance (beta): 0.2289
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 10, time = 0.08 m
INFO [matcher.py:102] Objective: 451808000.0
INFO [matcher.py:123] Balance (beta): 0.2289
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 11, time = 0.08 m
INFO [matcher.py:102] Objective: 451755000.0
INFO [matcher.py:123] Balance (beta): 0.2289
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 12, time = 0.08 m
INFO [matcher.py:102] Objective: 22699000.0
INFO [matcher.py:123] Balance (beta): 0.0104
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 13, time = 0.10 m
INFO [matcher.py:102] Objective: 22422000.0
INFO [matcher.py:123] Balance (beta): 0.0124
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 14, time = 0.12 m
INFO [matcher.py:102] Objective: 22306000.0
INFO [matcher.py:123] Balance (beta): 0.0124
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 15, time = 0.13 m
INFO [matcher.py:102] Objective: 22291000.0
INFO [matcher.py:123] Balance (beta): 0.0124
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 16, time = 0.14 m
INFO [matcher.py:102] Objective: 22121000.0
INFO [matcher.py:123] Balance (beta): 0.0122
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 17, time = 0.16 m
INFO [matcher.py:102] Objective: 22119000.0
INFO [matcher.py:123] Balance (beta): 0.0102
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 18, time = 0.21 m
INFO [matcher.py:102] Objective: 22103000.0
INFO [matcher.py:123] Balance (beta): 0.0121
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 19, time = 0.23 m
INFO [matcher.py:102] Objective: 22101000.0
INFO [matcher.py:123] Balance (beta): 0.0122
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 20, time = 0.25 m
INFO [matcher.py:102] Objective: 22099000.0
INFO [matcher.py:123] Balance (beta): 0.0122
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 21, time = 0.27 m
INFO [matcher.py:102] Objective: 22088000.0
INFO [matcher.py:123] Balance (beta): 0.0122
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 22, time = 0.60 m
INFO [matcher.py:102] Objective: 22084000.0
INFO [matcher.py:123] Balance (beta): 0.0122
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:252] Status = FEASIBLE
INFO [matcher.py:253] Number of solutions found: 22
[5]:
['age', 'height', 'weight']
Headers Categoric:
['gender', 'haircolor', 'country', 'binary_0', 'binary_1', 'binary_2', 'binary_3']
Populations
['pool', 'target']
| age | height | weight | gender | haircolor | country | population | binary_0 | binary_1 | binary_2 | binary_3 | patient_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 55.261578 | 139.396134 | 94.438359 | 0.0 | 2 | 2 | target | 0 | 0 | 1 | 1 | 10000 |
| 1 | 63.113091 | 165.563337 | 67.433016 | 1.0 | 2 | 2 | target | 0 | 1 | 1 | 0 | 10001 |
| 2 | 58.232216 | 160.859857 | 71.915385 | 1.0 | 0 | 2 | target | 0 | 0 | 0 | 0 | 10002 |
| 3 | 58.996941 | 140.357415 | 115.606615 | 1.0 | 0 | 3 | target | 1 | 1 | 0 | 0 | 10003 |
| 4 | 36.850195 | 189.983706 | 53.000581 | 0.0 | 2 | 5 | target | 0 | 0 | 0 | 0 | 10004 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 9933 | 68.194783 | 127.495418 | 69.177329 | 0.0 | 1 | 5 | pool | 1 | 1 | 0 | 0 | 9933 |
| 9958 | 51.722321 | 170.350117 | 80.695438 | 0.0 | 2 | 4 | pool | 0 | 1 | 0 | 1 | 9958 |
| 9966 | 40.121009 | 168.339212 | 100.428001 | 1.0 | 2 | 4 | pool | 0 | 1 | 1 | 0 | 9966 |
| 9981 | 39.006118 | 133.419182 | 71.135407 | 0.0 | 1 | 4 | pool | 0 | 0 | 0 | 0 | 9981 |
| 9982 | 50.575808 | 139.401060 | 89.848616 | 0.0 | 1 | 1 | pool | 0 | 0 | 0 | 1 | 9982 |
2000 rows × 12 columns
Note that it is possible for the “balance” value to go up (hopefully only slightly) as the solver progresses. This behavior is due to rounding errors incurred when casting a continuous problem into the discrete space understood by the solver. The “balance” reported here is the actual balance computed to full accuracy on the original dataset; the “objective” value here is the actual quantity being optimized and should never increase.
[6]:
matcher.get_best_match()
[6]:
['age', 'height', 'weight']
Headers Categoric:
['gender', 'haircolor', 'country', 'binary_0', 'binary_1', 'binary_2', 'binary_3']
Populations
['pool', 'target']
| age | height | weight | gender | haircolor | country | population | binary_0 | binary_1 | binary_2 | binary_3 | patient_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 55.261578 | 139.396134 | 94.438359 | 0.0 | 2 | 2 | target | 0 | 0 | 1 | 1 | 10000 |
| 1 | 63.113091 | 165.563337 | 67.433016 | 1.0 | 2 | 2 | target | 0 | 1 | 1 | 0 | 10001 |
| 2 | 58.232216 | 160.859857 | 71.915385 | 1.0 | 0 | 2 | target | 0 | 0 | 0 | 0 | 10002 |
| 3 | 58.996941 | 140.357415 | 115.606615 | 1.0 | 0 | 3 | target | 1 | 1 | 0 | 0 | 10003 |
| 4 | 36.850195 | 189.983706 | 53.000581 | 0.0 | 2 | 5 | target | 0 | 0 | 0 | 0 | 10004 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 9933 | 68.194783 | 127.495418 | 69.177329 | 0.0 | 1 | 5 | pool | 1 | 1 | 0 | 0 | 9933 |
| 9958 | 51.722321 | 170.350117 | 80.695438 | 0.0 | 2 | 4 | pool | 0 | 1 | 0 | 1 | 9958 |
| 9966 | 40.121009 | 168.339212 | 100.428001 | 1.0 | 2 | 4 | pool | 0 | 1 | 1 | 0 | 9966 |
| 9981 | 39.006118 | 133.419182 | 71.135407 | 0.0 | 1 | 4 | pool | 0 | 0 | 0 | 0 | 9981 |
| 9982 | 50.575808 | 139.401060 | 89.848616 | 0.0 | 1 | 1 | pool | 0 | 0 | 0 | 1 | 9982 |
2000 rows × 12 columns
[7]:
%matplotlib inline
match = matcher.get_best_match()
m_data = m.copy().get_population('pool')
m_data.loc[:, 'population'] = m_data['population'] + ' (prematch)'
match.append(m_data)
# fig = plot_per_feature_loss(match, beta, 'target', debin=False)
fig = plot_numeric_features(match, hue_order=['pool (prematch)', 'pool', 'target', ])
fig = plot_categoric_features(match, hue_order=['pool (prematch)', 'pool', 'target'])
Optimize Beta With Cross Terms Added
Sometimes it helps to add a known (non-optimal) solution as a hint to the solver. A natural choice for hinting the solver is to take a solution from PS matching. We can choose to use the PS as a hint to the solver by passing ps_hinting=True.
[8]:
objective = beta_x = BetaXBalance(m)
matcher = matcher_betax = ConstraintSatisfactionMatcher(
m,
time_limit=time_limit,
objective=objective,
ps_hinting=True,
num_workers=4)
matcher.get_params()
INFO [preprocess.py:548] Added cross term height * weight to matching features.
INFO [preprocess.py:548] Added cross term gender * age to matching features.
INFO [preprocess.py:548] Added cross term binary_0 * binary_3 to matching features.
INFO [preprocess.py:548] Added cross term binary_0 * age to matching features.
INFO [preprocess.py:548] Added cross term binary_3 * weight to matching features.
INFO [preprocess.py:548] Added cross term binary_2 * weight to matching features.
INFO [preprocess.py:548] Added cross term binary_1 * binary_3 to matching features.
INFO [preprocess.py:548] Added cross term binary_2 * binary_3 to matching features.
INFO [preprocess.py:548] Added cross term binary_2 * height to matching features.
INFO [preprocess.py:548] Added cross term binary_0 * binary_2 to matching features.
INFO [matcher.py:66] Scaling features by factor 240.00 in order to use integer solver with <= 0.3751% loss.
[8]:
{'objective': 'beta_x',
'pool_size': 1000,
'target_size': 1000,
'max_mismatch': None,
'time_limit': 60,
'num_workers': 4,
'ps_hinting': True,
'verbose': True}
[9]:
matcher.match()
INFO [matcher.py:499] Solving for match population with pool size = 1000 and target size = 1000, optimizing balance (no max_mismatch cap).
INFO [matcher.py:503] Matching on 25 dimensions ...
INFO [matcher.py:510] Building model variables and constraints ...
INFO [matcher.py:519] Calculating bounds on feature variables ...
INFO [matcher.py:609] Applying size constraints on pool and target ...
INFO [matcher.py:615] Applying hint ...
INFO [matcher.py:622] Training PS model as guide for solver ...
INFO [preprocess.py:548] Added cross term height * weight to matching features.
INFO [preprocess.py:548] Added cross term gender * age to matching features.
INFO [preprocess.py:548] Added cross term binary_0 * binary_3 to matching features.
INFO [preprocess.py:548] Added cross term binary_0 * age to matching features.
INFO [preprocess.py:548] Added cross term binary_3 * weight to matching features.
INFO [preprocess.py:548] Added cross term binary_2 * weight to matching features.
INFO [preprocess.py:548] Added cross term binary_1 * binary_3 to matching features.
INFO [preprocess.py:548] Added cross term binary_2 * binary_3 to matching features.
INFO [preprocess.py:548] Added cross term binary_2 * height to matching features.
INFO [preprocess.py:548] Added cross term binary_0 * binary_2 to matching features.
INFO [matcher.py:179] Training model SGDClassifier (iter 1/50, 0.001 min) ...
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: SGDClassifier
INFO [matcher.py:142] * alpha: 0.1045355473186929
INFO [matcher.py:142] * class_weight: None
INFO [matcher.py:142] * early_stopping: False
INFO [matcher.py:142] * fit_intercept: False
INFO [matcher.py:142] * loss: modified_huber
INFO [matcher.py:142] * max_iter: 1500
INFO [matcher.py:142] * penalty: l1
INFO [matcher.py:143] Score (beta_x): 0.1723
INFO [matcher.py:144] Solution time: 0.002 min
INFO [matcher.py:179] Training model SGDClassifier (iter 2/50, 0.003 min) ...
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: SGDClassifier
INFO [matcher.py:142] * alpha: 0.0354658577371722
INFO [matcher.py:142] * class_weight: None
INFO [matcher.py:142] * early_stopping: False
INFO [matcher.py:142] * fit_intercept: False
INFO [matcher.py:142] * loss: modified_huber
INFO [matcher.py:142] * max_iter: 1500
INFO [matcher.py:142] * penalty: l2
INFO [matcher.py:143] Score (beta_x): 0.0887
INFO [matcher.py:144] Solution time: 0.004 min
INFO [matcher.py:179] Training model LogisticRegression (iter 3/50, 0.004 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: LogisticRegression
INFO [matcher.py:142] * C: 0.7627616953429366
INFO [matcher.py:142] * fit_intercept: True
INFO [matcher.py:142] * max_iter: 500
INFO [matcher.py:142] * penalty: l2
INFO [matcher.py:142] * solver: saga
INFO [matcher.py:143] Score (beta_x): 0.0670
INFO [matcher.py:144] Solution time: 0.008 min
INFO [matcher.py:179] Training model LogisticRegression (iter 4/50, 0.008 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: LogisticRegression
INFO [matcher.py:142] * C: 0.015804928600429955
INFO [matcher.py:142] * fit_intercept: True
INFO [matcher.py:142] * max_iter: 500
INFO [matcher.py:142] * penalty: l2
INFO [matcher.py:142] * solver: saga
INFO [matcher.py:143] Score (beta_x): 0.0615
INFO [matcher.py:144] Solution time: 0.010 min
INFO [matcher.py:179] Training model LogisticRegression (iter 5/50, 0.010 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 6/50, 0.029 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 7/50, 0.054 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 8/50, 0.077 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 9/50, 0.079 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 10/50, 0.100 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 11/50, 0.122 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 12/50, 0.124 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 13/50, 0.139 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 14/50, 0.164 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 15/50, 0.166 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 16/50, 0.168 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 17/50, 0.194 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 18/50, 0.196 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 19/50, 0.197 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 20/50, 0.200 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 21/50, 0.202 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 22/50, 0.227 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 23/50, 0.229 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 24/50, 0.231 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 25/50, 0.233 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 26/50, 0.235 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 27/50, 0.243 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 28/50, 0.245 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 29/50, 0.264 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 30/50, 0.266 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 31/50, 0.284 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 32/50, 0.309 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 33/50, 0.311 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 34/50, 0.314 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 35/50, 0.316 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 36/50, 0.317 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: LogisticRegression
INFO [matcher.py:142] * C: 2.1909794891956405
INFO [matcher.py:142] * fit_intercept: False
INFO [matcher.py:142] * max_iter: 500
INFO [matcher.py:142] * penalty: l1
INFO [matcher.py:142] * solver: saga
INFO [matcher.py:143] Score (beta_x): 0.0610
INFO [matcher.py:144] Solution time: 0.341 min
INFO [matcher.py:179] Training model LogisticRegression (iter 37/50, 0.341 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 38/50, 0.344 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 39/50, 0.346 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 40/50, 0.370 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 41/50, 0.388 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 42/50, 0.398 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 43/50, 0.401 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 44/50, 0.403 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 45/50, 0.417 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 46/50, 0.424 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 47/50, 0.426 min) ...
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: SGDClassifier
INFO [matcher.py:142] * alpha: 0.08294085369181486
INFO [matcher.py:142] * class_weight: balanced
INFO [matcher.py:142] * early_stopping: True
INFO [matcher.py:142] * fit_intercept: True
INFO [matcher.py:142] * loss: log_loss
INFO [matcher.py:142] * max_iter: 1500
INFO [matcher.py:142] * penalty: l2
INFO [matcher.py:143] Score (beta_x): 0.0594
INFO [matcher.py:144] Solution time: 0.427 min
INFO [matcher.py:179] Training model SGDClassifier (iter 48/50, 0.428 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 49/50, 0.430 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 50/50, 0.431 min) ...
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: SGDClassifier
INFO [matcher.py:142] * alpha: 0.08294085369181486
INFO [matcher.py:142] * class_weight: balanced
INFO [matcher.py:142] * early_stopping: True
INFO [matcher.py:142] * fit_intercept: True
INFO [matcher.py:142] * loss: log_loss
INFO [matcher.py:142] * max_iter: 1500
INFO [matcher.py:142] * penalty: l2
INFO [matcher.py:143] Score (beta_x): 0.0594
INFO [matcher.py:144] Solution time: 0.427 min
INFO [matcher.py:659] Hint achieves objective value = 150510.
INFO [matcher.py:661] Applying hints ...
INFO [matcher.py:239] Solving with 4 workers ...
INFO [matcher.py:91] Initial balance score: 0.2324
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 1, time = 0.10 m
INFO [matcher.py:102] Objective: 150510000.0
INFO [matcher.py:123] Balance (beta_x): 0.0594
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 2, time = 0.10 m
INFO [matcher.py:102] Objective: 150275000.0
INFO [matcher.py:123] Balance (beta_x): 0.0592
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 3, time = 0.11 m
INFO [matcher.py:102] Objective: 150126000.0
INFO [matcher.py:123] Balance (beta_x): 0.0593
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 4, time = 0.11 m
INFO [matcher.py:102] Objective: 149549000.0
INFO [matcher.py:123] Balance (beta_x): 0.0590
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 5, time = 0.13 m
INFO [matcher.py:102] Objective: 149538000.0
INFO [matcher.py:123] Balance (beta_x): 0.0591
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 6, time = 0.13 m
INFO [matcher.py:102] Objective: 149451000.0
INFO [matcher.py:123] Balance (beta_x): 0.0592
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 7, time = 0.14 m
INFO [matcher.py:102] Objective: 149266000.0
INFO [matcher.py:123] Balance (beta_x): 0.0591
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 8, time = 0.14 m
INFO [matcher.py:102] Objective: 149098000.0
INFO [matcher.py:123] Balance (beta_x): 0.0590
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 9, time = 0.15 m
INFO [matcher.py:102] Objective: 149054000.0
INFO [matcher.py:123] Balance (beta_x): 0.0590
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 10, time = 0.17 m
INFO [matcher.py:102] Objective: 148612000.0
INFO [matcher.py:123] Balance (beta_x): 0.0589
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 11, time = 0.17 m
INFO [matcher.py:102] Objective: 148570000.0
INFO [matcher.py:123] Balance (beta_x): 0.0590
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 12, time = 0.18 m
INFO [matcher.py:102] Objective: 148457000.0
INFO [matcher.py:123] Balance (beta_x): 0.0589
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 13, time = 0.18 m
INFO [matcher.py:102] Objective: 148402000.0
INFO [matcher.py:123] Balance (beta_x): 0.0588
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 14, time = 0.21 m
INFO [matcher.py:102] Objective: 148292000.0
INFO [matcher.py:123] Balance (beta_x): 0.0588
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 15, time = 0.24 m
INFO [matcher.py:102] Objective: 148241000.0
INFO [matcher.py:123] Balance (beta_x): 0.0587
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 16, time = 0.27 m
INFO [matcher.py:102] Objective: 148137000.0
INFO [matcher.py:123] Balance (beta_x): 0.0588
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 17, time = 0.28 m
INFO [matcher.py:102] Objective: 148062000.0
INFO [matcher.py:123] Balance (beta_x): 0.0587
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 18, time = 0.30 m
INFO [matcher.py:102] Objective: 148015000.0
INFO [matcher.py:123] Balance (beta_x): 0.0588
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 19, time = 0.32 m
INFO [matcher.py:102] Objective: 147905000.0
INFO [matcher.py:123] Balance (beta_x): 0.0587
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 20, time = 0.35 m
INFO [matcher.py:102] Objective: 147665000.0
INFO [matcher.py:123] Balance (beta_x): 0.0587
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 21, time = 0.38 m
INFO [matcher.py:102] Objective: 147445000.0
INFO [matcher.py:123] Balance (beta_x): 0.0587
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 22, time = 0.43 m
INFO [matcher.py:102] Objective: 147387000.0
INFO [matcher.py:123] Balance (beta_x): 0.0587
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 23, time = 0.44 m
INFO [matcher.py:102] Objective: 147292000.0
INFO [matcher.py:123] Balance (beta_x): 0.0587
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 24, time = 0.50 m
INFO [matcher.py:102] Objective: 146776000.0
INFO [matcher.py:123] Balance (beta_x): 0.0586
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 25, time = 0.50 m
INFO [matcher.py:102] Objective: 146598000.0
INFO [matcher.py:123] Balance (beta_x): 0.0585
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 26, time = 0.56 m
INFO [matcher.py:102] Objective: 146233000.0
INFO [matcher.py:123] Balance (beta_x): 0.0584
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 27, time = 0.58 m
INFO [matcher.py:102] Objective: 145754000.0
INFO [matcher.py:123] Balance (beta_x): 0.0584
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 28, time = 0.60 m
INFO [matcher.py:102] Objective: 145603000.0
INFO [matcher.py:123] Balance (beta_x): 0.0583
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 29, time = 0.62 m
INFO [matcher.py:102] Objective: 145161000.0
INFO [matcher.py:123] Balance (beta_x): 0.0581
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 30, time = 0.64 m
INFO [matcher.py:102] Objective: 144785000.0
INFO [matcher.py:123] Balance (beta_x): 0.0580
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 31, time = 0.67 m
INFO [matcher.py:102] Objective: 144740000.0
INFO [matcher.py:123] Balance (beta_x): 0.0580
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 32, time = 0.70 m
INFO [matcher.py:102] Objective: 144439000.0
INFO [matcher.py:123] Balance (beta_x): 0.0579
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 33, time = 0.70 m
INFO [matcher.py:102] Objective: 144288000.0
INFO [matcher.py:123] Balance (beta_x): 0.0578
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 34, time = 0.71 m
INFO [matcher.py:102] Objective: 144198000.0
INFO [matcher.py:123] Balance (beta_x): 0.0578
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 35, time = 0.73 m
INFO [matcher.py:102] Objective: 144077000.0
INFO [matcher.py:123] Balance (beta_x): 0.0578
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 36, time = 0.77 m
INFO [matcher.py:102] Objective: 144032000.0
INFO [matcher.py:123] Balance (beta_x): 0.0579
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 37, time = 0.81 m
INFO [matcher.py:102] Objective: 143921000.0
INFO [matcher.py:123] Balance (beta_x): 0.0578
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:252] Status = FEASIBLE
INFO [matcher.py:253] Number of solutions found: 37
[9]:
['age', 'height', 'weight']
Headers Categoric:
['gender', 'haircolor', 'country', 'binary_0', 'binary_1', 'binary_2', 'binary_3']
Populations
['pool', 'target']
| age | height | weight | gender | haircolor | country | population | binary_0 | binary_1 | binary_2 | binary_3 | patient_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 55.261578 | 139.396134 | 94.438359 | 0.0 | 2 | 2 | target | 0 | 0 | 1 | 1 | 10000 |
| 1 | 63.113091 | 165.563337 | 67.433016 | 1.0 | 2 | 2 | target | 0 | 1 | 1 | 0 | 10001 |
| 2 | 58.232216 | 160.859857 | 71.915385 | 1.0 | 0 | 2 | target | 0 | 0 | 0 | 0 | 10002 |
| 3 | 58.996941 | 140.357415 | 115.606615 | 1.0 | 0 | 3 | target | 1 | 1 | 0 | 0 | 10003 |
| 4 | 36.850195 | 189.983706 | 53.000581 | 0.0 | 2 | 5 | target | 0 | 0 | 0 | 0 | 10004 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 9933 | 68.194783 | 127.495418 | 69.177329 | 0.0 | 1 | 5 | pool | 1 | 1 | 0 | 0 | 9933 |
| 9947 | 64.290077 | 168.091011 | 63.511962 | 1.0 | 2 | 2 | pool | 0 | 0 | 0 | 1 | 9947 |
| 9975 | 51.242281 | 130.812647 | 87.967028 | 1.0 | 0 | 4 | pool | 1 | 0 | 1 | 0 | 9975 |
| 9983 | 68.616093 | 167.546870 | 58.683367 | 1.0 | 0 | 2 | pool | 0 | 0 | 0 | 0 | 9983 |
| 9997 | 66.480954 | 169.018678 | 76.221503 | 1.0 | 2 | 4 | pool | 0 | 1 | 0 | 1 | 9997 |
2000 rows × 12 columns
[10]:
%matplotlib inline
match = matcher.get_best_match()
m_data = m.copy().get_population('pool')
m_data.loc[:, 'population'] = m_data['population'] + ' (prematch)'
match.append(m_data)
fig = plot_per_feature_loss(match, objective, 'target', debin=False)
Optimize Gamma (Area Between CDFs)
[11]:
objective = gamma = GammaBalance(m)
matcher = matcher_gamma = ConstraintSatisfactionMatcher(
m,
time_limit=time_limit,
objective=objective,
ps_hinting=True,
num_workers=4)
matcher.get_params()
INFO [preprocess.py:340] Discretized age with bins [18.05, 27.54, 37.04, 46.53, 56.02, 65.51, 75.0].
INFO [preprocess.py:340] Discretized height with bins [125.01, 136.68, 148.34, 160.01, 171.67, 183.34, 195.0].
INFO [preprocess.py:340] Discretized weight with bins [50.0, 61.67, 73.33, 85.0, 96.66, 108.33, 120.0].
INFO [matcher.py:66] Scaling features by factor 200.00 in order to use integer solver with <= 0.0000% loss.
[11]:
{'objective': 'gamma',
'pool_size': 1000,
'target_size': 1000,
'max_mismatch': None,
'time_limit': 60,
'num_workers': 4,
'ps_hinting': True,
'verbose': True}
[12]:
matcher.match()
INFO [matcher.py:499] Solving for match population with pool size = 1000 and target size = 1000, optimizing balance (no max_mismatch cap).
INFO [matcher.py:503] Matching on 27 dimensions ...
INFO [matcher.py:510] Building model variables and constraints ...
INFO [matcher.py:519] Calculating bounds on feature variables ...
INFO [matcher.py:609] Applying size constraints on pool and target ...
INFO [matcher.py:615] Applying hint ...
INFO [matcher.py:622] Training PS model as guide for solver ...
INFO [preprocess.py:340] Discretized age with bins [18.05, 27.54, 37.04, 46.53, 56.02, 65.51, 75.0].
INFO [preprocess.py:340] Discretized height with bins [125.01, 136.68, 148.34, 160.01, 171.67, 183.34, 195.0].
INFO [preprocess.py:340] Discretized weight with bins [50.0, 61.67, 73.33, 85.0, 96.66, 108.33, 120.0].
INFO [matcher.py:179] Training model SGDClassifier (iter 1/50, 0.001 min) ...
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: SGDClassifier
INFO [matcher.py:142] * alpha: 4.774501445415405
INFO [matcher.py:142] * class_weight: None
INFO [matcher.py:142] * early_stopping: True
INFO [matcher.py:142] * fit_intercept: False
INFO [matcher.py:142] * loss: modified_huber
INFO [matcher.py:142] * max_iter: 1500
INFO [matcher.py:142] * penalty: elasticnet
INFO [matcher.py:143] Score (gamma): 0.2142
INFO [matcher.py:144] Solution time: 0.002 min
INFO [matcher.py:179] Training model LogisticRegression (iter 2/50, 0.003 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: LogisticRegression
INFO [matcher.py:142] * C: 0.058541995189524146
INFO [matcher.py:142] * fit_intercept: False
INFO [matcher.py:142] * max_iter: 500
INFO [matcher.py:142] * penalty: l2
INFO [matcher.py:142] * solver: saga
INFO [matcher.py:143] Score (gamma): 0.0472
INFO [matcher.py:144] Solution time: 0.005 min
INFO [matcher.py:179] Training model LogisticRegression (iter 3/50, 0.005 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: LogisticRegression
INFO [matcher.py:142] * C: 0.0909955270741388
INFO [matcher.py:142] * fit_intercept: True
INFO [matcher.py:142] * max_iter: 500
INFO [matcher.py:142] * penalty: l1
INFO [matcher.py:142] * solver: saga
INFO [matcher.py:143] Score (gamma): 0.0448
INFO [matcher.py:144] Solution time: 0.007 min
INFO [matcher.py:179] Training model SGDClassifier (iter 4/50, 0.007 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 5/50, 0.009 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 6/50, 0.010 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: LogisticRegression
INFO [matcher.py:142] * C: 0.15085738749804528
INFO [matcher.py:142] * fit_intercept: False
INFO [matcher.py:142] * max_iter: 500
INFO [matcher.py:142] * penalty: l1
INFO [matcher.py:142] * solver: saga
INFO [matcher.py:143] Score (gamma): 0.0347
INFO [matcher.py:144] Solution time: 0.037 min
INFO [matcher.py:179] Training model SGDClassifier (iter 7/50, 0.038 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 8/50, 0.039 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 9/50, 0.041 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 10/50, 0.045 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: LogisticRegression
INFO [matcher.py:142] * C: 22.70303412073022
INFO [matcher.py:142] * fit_intercept: False
INFO [matcher.py:142] * max_iter: 500
INFO [matcher.py:142] * penalty: l1
INFO [matcher.py:142] * solver: saga
INFO [matcher.py:143] Score (gamma): 0.0331
INFO [matcher.py:144] Solution time: 0.072 min
INFO [matcher.py:179] Training model LogisticRegression (iter 11/50, 0.072 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 12/50, 0.084 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 13/50, 0.086 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 14/50, 0.111 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 15/50, 0.115 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 16/50, 0.116 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 17/50, 0.118 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 18/50, 0.121 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 19/50, 0.123 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: LogisticRegression
INFO [matcher.py:142] * C: 0.7964686611607528
INFO [matcher.py:142] * fit_intercept: False
INFO [matcher.py:142] * max_iter: 500
INFO [matcher.py:142] * penalty: l1
INFO [matcher.py:142] * solver: saga
INFO [matcher.py:143] Score (gamma): 0.0308
INFO [matcher.py:144] Solution time: 0.150 min
INFO [matcher.py:179] Training model LogisticRegression (iter 20/50, 0.150 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 21/50, 0.173 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 22/50, 0.175 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 23/50, 0.176 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 24/50, 0.201 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 25/50, 0.202 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 26/50, 0.204 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 27/50, 0.217 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 28/50, 0.219 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 29/50, 0.220 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 30/50, 0.226 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 31/50, 0.227 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 32/50, 0.228 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 33/50, 0.232 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 34/50, 0.255 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 35/50, 0.264 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 36/50, 0.265 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 37/50, 0.266 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 38/50, 0.268 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 39/50, 0.279 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 40/50, 0.280 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 41/50, 0.282 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 42/50, 0.289 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 43/50, 0.290 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 44/50, 0.292 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 45/50, 0.294 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 46/50, 0.297 min) ...
INFO [matcher.py:179] Training model LogisticRegression (iter 47/50, 0.299 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
INFO [matcher.py:179] Training model LogisticRegression (iter 48/50, 0.301 min) ...
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1381: FutureWarning: 'penalty' was deprecated in version 1.8 and will be removed in 1.10. To avoid this warning, leave 'penalty' set to its default value and use 'l1_ratio' or 'C' instead. Use l1_ratio=0 instead of penalty='l2', l1_ratio=1 instead of penalty='l1', l1_ratio set to a float between 0 and 1 instead of penalty='elasticnet', and C=np.inf instead of penalty=None.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_logistic.py:1407: UserWarning: Inconsistent values: penalty=l1 with l1_ratio=0.0. penalty is deprecated. Please use l1_ratio only.
warnings.warn(
/Users/gmema/src/matching-fork/venv/lib/python3.12/site-packages/sklearn/linear_model/_sag.py:348: ConvergenceWarning: The max_iter was reached which means the coef_ did not converge
warnings.warn(
INFO [matcher.py:179] Training model SGDClassifier (iter 49/50, 0.328 min) ...
INFO [matcher.py:179] Training model SGDClassifier (iter 50/50, 0.330 min) ...
INFO [matcher.py:139] Best propensity score match found:
INFO [matcher.py:140] Model: LogisticRegression
INFO [matcher.py:142] * C: 0.7964686611607528
INFO [matcher.py:142] * fit_intercept: False
INFO [matcher.py:142] * max_iter: 500
INFO [matcher.py:142] * penalty: l1
INFO [matcher.py:142] * solver: saga
INFO [matcher.py:143] Score (gamma): 0.0308
INFO [matcher.py:144] Solution time: 0.150 min
INFO [matcher.py:659] Hint achieves objective value = 100400.
INFO [matcher.py:661] Applying hints ...
INFO [matcher.py:239] Solving with 4 workers ...
INFO [matcher.py:91] Initial balance score: 0.2110
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 1, time = 0.06 m
INFO [matcher.py:102] Objective: 115600000.0
INFO [matcher.py:123] Balance (gamma): 0.0349
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 2, time = 0.15 m
INFO [matcher.py:102] Objective: 115400000.0
INFO [matcher.py:123] Balance (gamma): 0.0349
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 3, time = 0.16 m
INFO [matcher.py:102] Objective: 114600000.0
INFO [matcher.py:123] Balance (gamma): 0.0346
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 4, time = 0.17 m
INFO [matcher.py:102] Objective: 114400000.0
INFO [matcher.py:123] Balance (gamma): 0.0346
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 5, time = 0.18 m
INFO [matcher.py:102] Objective: 113800000.0
INFO [matcher.py:123] Balance (gamma): 0.0344
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 6, time = 0.20 m
INFO [matcher.py:102] Objective: 102000000.0
INFO [matcher.py:123] Balance (gamma): 0.0310
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 7, time = 0.21 m
INFO [matcher.py:102] Objective: 101400000.0
INFO [matcher.py:123] Balance (gamma): 0.0308
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 8, time = 0.23 m
INFO [matcher.py:102] Objective: 100800000.0
INFO [matcher.py:123] Balance (gamma): 0.0306
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 9, time = 0.24 m
INFO [matcher.py:102] Objective: 100400000.0
INFO [matcher.py:123] Balance (gamma): 0.0305
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 10, time = 0.31 m
INFO [matcher.py:102] Objective: 97800000.0
INFO [matcher.py:123] Balance (gamma): 0.0300
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 11, time = 0.32 m
INFO [matcher.py:102] Objective: 97200000.0
INFO [matcher.py:123] Balance (gamma): 0.0298
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 12, time = 0.39 m
INFO [matcher.py:102] Objective: 97000000.0
INFO [matcher.py:123] Balance (gamma): 0.0298
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 13, time = 0.39 m
INFO [matcher.py:102] Objective: 96600000.0
INFO [matcher.py:123] Balance (gamma): 0.0297
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 14, time = 0.45 m
INFO [matcher.py:102] Objective: 91000000.0
INFO [matcher.py:123] Balance (gamma): 0.0282
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 15, time = 0.45 m
INFO [matcher.py:102] Objective: 90800000.0
INFO [matcher.py:123] Balance (gamma): 0.0282
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 16, time = 0.47 m
INFO [matcher.py:102] Objective: 90600000.0
INFO [matcher.py:123] Balance (gamma): 0.0281
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 17, time = 0.52 m
INFO [matcher.py:102] Objective: 80800000.0
INFO [matcher.py:123] Balance (gamma): 0.0249
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 18, time = 0.53 m
INFO [matcher.py:102] Objective: 80600000.0
INFO [matcher.py:123] Balance (gamma): 0.0248
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 19, time = 0.54 m
INFO [matcher.py:102] Objective: 80400000.0
INFO [matcher.py:123] Balance (gamma): 0.0247
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 20, time = 0.60 m
INFO [matcher.py:102] Objective: 19000000.0
INFO [matcher.py:123] Balance (gamma): 0.0070
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 21, time = 0.79 m
INFO [matcher.py:102] Objective: 18800000.0
INFO [matcher.py:123] Balance (gamma): 0.0069
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:97] =========================================
INFO [matcher.py:98] Solution 22, time = 0.80 m
INFO [matcher.py:102] Objective: 18400000.0
INFO [matcher.py:123] Balance (gamma): 0.0068
INFO [matcher.py:128] Patients (pool): 1000
INFO [matcher.py:130] Patients (target): 1000
INFO [matcher.py:146]
INFO [matcher.py:252] Status = OPTIMAL
INFO [matcher.py:253] Number of solutions found: 22
[12]:
['age', 'height', 'weight']
Headers Categoric:
['gender', 'haircolor', 'country', 'binary_0', 'binary_1', 'binary_2', 'binary_3']
Populations
['pool', 'target']
| age | height | weight | gender | haircolor | country | population | binary_0 | binary_1 | binary_2 | binary_3 | patient_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 55.261578 | 139.396134 | 94.438359 | 0.0 | 2 | 2 | target | 0 | 0 | 1 | 1 | 10000 |
| 1 | 63.113091 | 165.563337 | 67.433016 | 1.0 | 2 | 2 | target | 0 | 1 | 1 | 0 | 10001 |
| 2 | 58.232216 | 160.859857 | 71.915385 | 1.0 | 0 | 2 | target | 0 | 0 | 0 | 0 | 10002 |
| 3 | 58.996941 | 140.357415 | 115.606615 | 1.0 | 0 | 3 | target | 1 | 1 | 0 | 0 | 10003 |
| 4 | 36.850195 | 189.983706 | 53.000581 | 0.0 | 2 | 5 | target | 0 | 0 | 0 | 0 | 10004 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 9932 | 72.514956 | 159.248205 | 118.505187 | 0.0 | 1 | 5 | pool | 1 | 1 | 0 | 1 | 9932 |
| 9933 | 68.194783 | 127.495418 | 69.177329 | 0.0 | 1 | 5 | pool | 1 | 1 | 0 | 0 | 9933 |
| 9957 | 63.949429 | 170.485188 | 99.498013 | 1.0 | 2 | 5 | pool | 0 | 0 | 1 | 0 | 9957 |
| 9981 | 39.006118 | 133.419182 | 71.135407 | 0.0 | 1 | 4 | pool | 0 | 0 | 0 | 0 | 9981 |
| 9988 | 74.994562 | 142.069423 | 59.899521 | 1.0 | 1 | 4 | pool | 0 | 1 | 0 | 1 | 9988 |
2000 rows × 12 columns
[13]:
%matplotlib inline
match = matcher.get_best_match()
m_data = m.copy().get_population('pool')
m_data.loc[:, 'population'] = m_data['population'] + ' (prematch)'
match.append(m_data)
fig = plot_per_feature_loss(match, objective, 'target', debin=False)
fig = plot_numeric_features(match, hue_order=['pool (prematch)', 'pool', 'target', ])
fig = plot_categoric_features(match, hue_order=['pool (prematch)', 'pool', 'target'])