-
Notifications
You must be signed in to change notification settings - Fork 12
chore: drop FAISS; cap compute (AUC, Contours, SeqLen, Subsets); handle empty tgt_data #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -300,11 +300,13 @@ def prepare_data_for_embeddings( | |
|
|
||
| # cap to Q95 sequence length of original to avoid excessive samples per group distorting results | ||
| if tgt_context_key is not None: | ||
| cap_sequence_length = 100 | ||
| q95_sequence_length = trn_tgt_data.groupby(key).size().quantile(0.95) | ||
| syn_tgt_data = syn_tgt_data.groupby(key).sample(frac=1).groupby(key).head(n=q95_sequence_length) | ||
| trn_tgt_data = trn_tgt_data.groupby(key).sample(frac=1).groupby(key).head(n=q95_sequence_length) | ||
| max_sequence_length = min(q95_sequence_length, cap_sequence_length) | ||
|
Comment on lines
+303
to
+305
|
||
| syn_tgt_data = syn_tgt_data.groupby(key).sample(frac=1).groupby(key).head(n=max_sequence_length) | ||
| trn_tgt_data = trn_tgt_data.groupby(key).sample(frac=1).groupby(key).head(n=max_sequence_length) | ||
| hol_tgt_data = ( | ||
| hol_tgt_data.groupby(key).sample(frac=1).groupby(key).head(n=q95_sequence_length) if hol else None | ||
| hol_tgt_data.groupby(key).sample(frac=1).groupby(key).head(n=max_sequence_length) if hol else None | ||
| ) | ||
|
|
||
| # drop key from data as its not relevant for embeddings | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -181,6 +181,8 @@ def report( | |||||||||
| check_min_sample_size(trn_sample_size, 90, "training") | ||||||||||
| if hol_tgt_data is not None: | ||||||||||
| check_min_sample_size(hol_sample_size, 10, "holdout") | ||||||||||
|
||||||||||
| check_min_sample_size(hol_sample_size, 10, "holdout") | |
| check_min_sample_size(hol_sample_size, 10, "holdout") | |
| if hol_tgt_data.shape[1] == 0: | |
| raise PrerequisiteNotMetError("Holdout data has no columns.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Hardcoding the groups count to 3 for correlated and random groups may not suit all datasets; consider whether a dynamic calculation based on the number of features could yield more robust grouping.