Skip to content

Commit

Permalink
Adding missing copy function calls in Optimization (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
reluzita authored Feb 20, 2024
1 parent 5d48298 commit 37bf697
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/aequitas/flow/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,15 @@ def run(self) -> None:
f"'{method_name}' in '{dataset_name}'."
)
objective = ObjectiveFunction(
X_train=dataset["train"]["X"],
y_train=dataset["train"]["y"],
s_train=dataset["train"]["s"],
X_val=dataset["validation"]["X"],
y_val=dataset["validation"]["y"],
s_val=dataset["validation"]["s"],
X_test=dataset["test"]["X"],
y_test=dataset["test"]["y"],
s_test=dataset["test"]["s"],
X_train=dataset["train"]["X"].copy(deep=True),
y_train=dataset["train"]["y"].copy(deep=True),
s_train=dataset["train"]["s"].copy(deep=True),
X_val=dataset["validation"]["X"].copy(deep=True),
y_val=dataset["validation"]["y"].copy(deep=True),
s_val=dataset["validation"]["s"].copy(deep=True),
X_test=dataset["test"]["X"].copy(deep=True),
y_test=dataset["test"]["y"].copy(deep=True),
s_test=dataset["test"]["s"].copy(deep=True),
threshold=threshold,
preprocessing_method=pre, # type: ignore
preprocessing_configs=pre_configs.args,
Expand Down Expand Up @@ -295,4 +295,4 @@ def plot_pareto(
self.plot = Plot(
results, dataset, fairness_metric, performance_metric, split=split
)
return self.plot.visualize()
return self.plot.visualize()
8 changes: 4 additions & 4 deletions src/aequitas/flow/optimization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ def __call__(self, trial: BaseTrial) -> float:
start_time = time.process_time()
preprocessing.fit(self.X_train, self.y_train, self.s_train)
preprocessing_output = preprocessing.transform(
self.X_train,
self.y_train,
self.s_train,
self.X_train.copy(),
self.y_train.copy(),
self.s_train.copy(),
)
inprocessing.fit(*preprocessing_output)

Expand Down Expand Up @@ -292,4 +292,4 @@ def omegaconf_to_dict(config: Optional[DictConfig]) -> Union[dict, None]:
if config is not None:
return OmegaConf.to_container(config)
else:
return None
return None

0 comments on commit 37bf697

Please sign in to comment.