Skip to content

Commit

Permalink
fix feature correlation model output(#5228)
Browse files Browse the repository at this point in the history
Signed-off-by: Yu Wu <yolandawu131@gmail.com>
  • Loading branch information
nemirorox committed Nov 22, 2023
1 parent 4da16d0 commit 5b14d69
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/fate/ml/statistics/pearson_correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ def fix_vif(remainds_vif, remainds_indexes, size):
return vif"""

def get_model(self):
output_model = {"data": {"local_corr": self.local_corr.to_dict(),
"remote_corr": self.remote_corr.to_dict(),
output_model = {"data": {"local_corr": self.local_corr.to_dict() if self.local_corr is not None else None,
"remote_corr": self.remote_corr.to_dict() if self.remote_corr is not None else None,
"vif": self.vif.to_dict() if self.vif is not None else None},
"meta": {"model_type": "feature_correlation",
"column_anonymous_map": dict(zip(self.select_cols, self.select_anonymous_cols))}}
"column_anonymous_map": dict(zip(self.select_cols, self.select_anonymous_cols))
if self.select_anonymous_cols else None}}
return output_model

0 comments on commit 5b14d69

Please sign in to comment.