Skip to content

Commit 190aa6e

Browse files
committed
Removed dead code
1 parent 4832a00 commit 190aa6e

3 files changed

Lines changed: 2 additions & 6 deletions

File tree

causal_testing/__main__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,13 @@ def main() -> None:
216216
# Need to reset index to allow for multiple files having the same index (i.e. starting at zero).
217217
# Otherwise you end up with duplicate indices, which causes problems further down the line
218218
df = pd.concat([read_dataframe(path) for path in args.data_paths]).reset_index()
219-
print(df)
220219
if args.variables:
221220
df = df[args.variables]
222221
# Drop unnamed columns
223222
unnamed_columns = [c for c in df.columns if c.startswith("Unnamed: ")]
224223
if unnamed_columns:
225224
warn(f"Dropping unnamed columns: {unnamed_columns}")
226-
df = df.drop(unnamed_columns)
225+
df = df.drop(unnamed_columns, axis=1)
227226

228227
discover_class = discover_map[args.technique].load()
229228
discover = discover_class(

causal_testing/estimation/abstract_regression_estimator.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,6 @@ def _predict(self, df) -> pd.DataFrame:
182182
for k, v in self.adjustment_config.items():
183183
x[k] = v
184184
x = dmatrix(self.formula.split("~")[1], x, return_type="dataframe")
185-
for col in x:
186-
if isinstance(x[col], pd.CategoricalDtype) or pd.api.types.is_object_dtype(x[col]):
187-
x = pd.get_dummies(x, columns=[col], drop_first=True)
188185

189186
return model.get_prediction(x).summary_frame()
190187

tests/estimation_tests/test_linear_regression_estimator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_no_formula_of_adjustment_set(self):
146146
"""
147147
with self.assertRaises(ValueError) as e:
148148
LinearRegressionEstimator(treatment_variable="cut", outcome_variable="price")
149-
self.assertEqual(e.exception, f"Please specify either a formula or an adjustment set.")
149+
self.assertEqual(e.exception, "Please specify either a formula or an adjustment set.")
150150

151151
def test_linear_regression_categorical_ate(self):
152152
df = self.scarf_df.copy()

0 commit comments

Comments
 (0)