Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Krebs committed Aug 29, 2024
1 parent 16cbc20 commit ce04b84
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion deepcave/evaluators/mo_fanova.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def calculate(
objectives, budget, specific=True, include_combined_cost=True
)


# normalize objectives
objectives_normed = list()
for obj in objectives:
Expand Down
1 change: 0 additions & 1 deletion deepcave/evaluators/mo_lpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def calculate(
objectives=objectives, budget=budget, specific=True, include_combined_cost=True
)


# normalize objectives
assert isinstance(objectives, list)
objectives_normed = list()
Expand Down
10 changes: 4 additions & 6 deletions deepcave/utils/multi_objective_importance.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

from typing import List

import pandas as pd
import numpy as np
import pandas as pd


def is_pareto_efficient(costs):
Expand All @@ -42,7 +42,7 @@ def is_pareto_efficient(costs):
is_efficient = np.ones(costs.shape[0], dtype=bool)
for i, c in enumerate(costs):
is_efficient[i] = np.all(np.any(costs[:i] > c, axis=1)) and np.all(
np.any(costs[i + 1:] > c, axis=1)
np.any(costs[i + 1 :] > c, axis=1)
)
return is_efficient

Expand All @@ -65,7 +65,5 @@ def get_weightings(objectives_normed: List[str], df: pd.DataFrame) -> np.ndarray
"""
optimized = is_pareto_efficient(df[objectives_normed].to_numpy())
return (
df[optimized][objectives_normed]
.T.apply(lambda values: values / values.sum())
.T.to_numpy()
)
df[optimized][objectives_normed].T.apply(lambda values: values / values.sum()).T.to_numpy()
)

0 comments on commit ce04b84

Please sign in to comment.