Implement Pearson and Spearman per-bit correleration #3

Merged
eeeck merged 4 commits from dev-inter-byte-correlation into main 2026-07-13 21:54:40 +02:00
Showing only changes of commit ce74c7fcd9 - Show all commits
+1 -1
View File
@@ -33,7 +33,7 @@ def calculate_correlation(df: pd.DataFrame, target_id: str | None = None) -> pd.
def max_abs_corr(group: pd.DataFrame) -> pd.Series:
corr_arr = np.abs(group.corr().to_numpy().copy())
np.fill_diagonal(corr_arr, 0.0)
return pd.Series(corr_arr.max(axis=0), index=group.columns)
return pd.Series(corr_arr.max(axis=0), index=group.columns).fillna(0.0)
return df_bytes.groupby("Identifier")[available_cols].apply(max_abs_corr)