Skip to content

Commit

Permalink
add intersect count for intersection component
Browse files Browse the repository at this point in the history
Signed-off-by: mgqa34 <mgq3374541@163.com>
  • Loading branch information
mgqa34 committed Jan 17, 2023
1 parent 4f879a5 commit 3f0ea5e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/fate/ml/intersection/raw_intersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def fit(self, ctx: Context, train_data, validate_data=None):
for intersect_index in intersect_indexes:
intersect_data = intersect_data.loc(intersect_index)

intersect_count = intersect_data.count()
ctx.hosts.put("intersect_count", intersect_count)

logger.info(f"intersect count={intersect_count}")
return intersect_data


Expand All @@ -46,4 +50,6 @@ def fit(self, ctx: Context, train_data, validate_data=None):
# ctx.guest.put("intersect_index", intersect_data.index.tolist())
ctx.guest.put("intersect_index", intersect_data.index.values)

intersect_count = ctx.guest.get("intersect_count")
logger.info(f"intersect count={intersect_count}")
return intersect_data

0 comments on commit 3f0ea5e

Please sign in to comment.