Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongyoonlee committed Aug 1, 2024
1 parent 5b8c063 commit f8aa150
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions causalml/inference/meta/rlearner.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,17 @@ def fit(self, X, treatment, y, p=None, sample_weight=None, verbose=True):
self.models_tau[group].fit(
X=X_train_filt,
y=(y_train_filt - yhat_train_filt) / (w_train - p_train_filt),
sample_weight=sample_weight_train_filt * ((w_train - p_train_filt) ** 2),
sample_weight=sample_weight_train_filt
* ((w_train - p_train_filt) ** 2),
eval_set=[
(
X_test_filt,
(y_test_filt - yhat_test_filt) / (w_test - p_test_filt),
)
],
sample_weight_eval_set=[sample_weight_test_filt * ((w_test - p_test_filt) ** 2)],
sample_weight_eval_set=[
sample_weight_test_filt * ((w_test - p_test_filt) ** 2)
],
verbose=verbose,
)

Expand Down
4 changes: 3 additions & 1 deletion causalml/metrics/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,9 @@ def plot_qini(
def plot_tmlegain(
df,
inference_col,
learner=LGBMRegressor(num_leaves=64, learning_rate=0.05, n_estimators=300, verbose=-1),
learner=LGBMRegressor(
num_leaves=64, learning_rate=0.05, n_estimators=300, verbose=-1
),
outcome_col="y",
treatment_col="w",
p_col="tau",
Expand Down
4 changes: 3 additions & 1 deletion causalml/propensity.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ class GradientBoostedPropensityModel(PropensityModel):
def __init__(self, early_stop=False, clip_bounds=(1e-3, 1 - 1e-3), **model_kwargs):
self.early_stop = early_stop

super(GradientBoostedPropensityModel, self).__init__(clip_bounds, **model_kwargs)
super(GradientBoostedPropensityModel, self).__init__(
clip_bounds, **model_kwargs
)

@property
def _model(self):
Expand Down

0 comments on commit f8aa150

Please sign in to comment.