shlomihod commited on
Commit
3185f7c
·
1 Parent(s): 1514644

Use stable version combination: imbalanced-learn 0.11.0 + scikit-learn 1.3.2

Browse files
Files changed (2) hide show
  1. app.py +4 -10
  2. requirements.txt +2 -2
app.py CHANGED
@@ -463,16 +463,10 @@ def prepare_datasets(
463
  df = df[[label_column] + input_columns]
464
 
465
  if train_size is not None and test_size is not None:
466
- # Try to apply undersampling, but fallback if there are compatibility issues
467
- try:
468
- undersample = RandomUnderSampler(
469
- sampling_strategy="not minority", random_state=dataset_split_seed
470
- )
471
- df, df[label_column] = undersample.fit_resample(df, df[label_column])
472
- except Exception as e:
473
- # Log the error and continue without undersampling
474
- LOGGER.warning(f"Undersampling failed: {e}. Proceeding without undersampling.")
475
-
476
  sss = StratifiedShuffleSplit(
477
  n_splits=1,
478
  train_size=train_size,
 
463
  df = df[[label_column] + input_columns]
464
 
465
  if train_size is not None and test_size is not None:
466
+ undersample = RandomUnderSampler(
467
+ sampling_strategy="not minority", random_state=dataset_split_seed
468
+ )
469
+ df, df[label_column] = undersample.fit_resample(df, df[label_column])
 
 
 
 
 
 
470
  sss = StratifiedShuffleSplit(
471
  n_splits=1,
472
  train_size=train_size,
requirements.txt CHANGED
@@ -4,12 +4,12 @@ cohere
4
  datasets
5
  einops
6
  huggingface_hub[inference]
7
- imbalanced-learn==0.12.3
8
  numpy==1.23.5
9
  pandas
10
  matplotlib
11
  openai
12
- scikit-learn==1.5.2
13
  spacy
14
  streamlit==1.20.0
15
  tenacity
 
4
  datasets
5
  einops
6
  huggingface_hub[inference]
7
+ imbalanced-learn==0.11.0
8
  numpy==1.23.5
9
  pandas
10
  matplotlib
11
  openai
12
+ scikit-learn==1.3.2
13
  spacy
14
  streamlit==1.20.0
15
  tenacity