Skip to content

Commit

Permalink
fix: neighborhood self weight (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
flekschas-ozette authored Aug 31, 2023
1 parent 418a7c9 commit 8c85c0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cev/_compare_metric_dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def callback():
"viridis",
"viridis_r",
value_range_slider.value,
("Low", "High", "Neighborhood"),
("Similar", "Dissimilar", "Neighborhood"),
)
else:
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion src/cev/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def confusion(df: pd.DataFrame) -> pd.Series:
def neighborhood(df: pd.DataFrame, max_depth: int = 1) -> pd.DataFrame:
categories = df["label"].cat.categories
neighborhood_scores = cev_metrics.neighborhood(df, max_depth)
np.fill_diagonal(neighborhood_scores, 1)
np.fill_diagonal(neighborhood_scores, 0)
return pd.DataFrame(neighborhood_scores, index=categories, columns=categories)


Expand Down

0 comments on commit 8c85c0e

Please sign in to comment.