nazneen commited on
Commit
fa5cfac
1 Parent(s): 2cadbb9

fixed downsamp bug

Browse files
interactive_model_cards/utils/misc.py CHANGED
@@ -66,7 +66,7 @@ def down_samp(embedding):
66
  #but keep the proportional representation of groups
67
  down_samp = 1/(sum(max_sample)/(5000-user_data))
68
 
69
- max_samp = floor(max_sample*down_samp).astype(int).to_dict()
70
  max_samp['Your Sentences'] = user_data
71
 
72
  #sample down for each group in the data frame
 
66
  #but keep the proportional representation of groups
67
  down_samp = 1/(sum(max_sample)/(5000-user_data))
68
 
69
+ max_samp = max_sample.apply(lambda x: floor(x*down_samp)).astype(int).to_dict()
70
  max_samp['Your Sentences'] = user_data
71
 
72
  #sample down for each group in the data frame