Skip to content

Commit

Permalink
big fix in prd
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all committed Sep 1, 2024
1 parent 982c5f4 commit d02e164
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ async def train(secret: str):
features_labeled = features.merge(player_data, left_index=True, right_index=True)

print(pd.DataFrame(features_labeled.iloc[:, -1].value_counts()))
# Count occurrences of each category in the target column
target_counts = features_labeled["target"].value_counts()

# we need at least 100 users
to_little_data_labels = (
pd.DataFrame(features_labeled.iloc[:, -1].value_counts())
.query("target < 100")
.index
)
mask = ~(features_labeled["target"].isin(to_little_data_labels))
# Filter categories with fewer than 100 occurrences
to_little_data_labels = target_counts[target_counts < 100].index

# Apply the mask to filter out those categories
mask = ~features_labeled["target"].isin(to_little_data_labels)
features_labeled = features_labeled[mask]

# create train test data
Expand Down

0 comments on commit d02e164

Please sign in to comment.