12345678910111213141516171819202122 |
- def create_kfold_directories(K_FOLDS):
- try:
- os.mkdir("folds")
- except:
- print("Directory 'folds' already exists")
- for i in range(K_FOLDS):
- try:
- os.mkdir(f"folds/fold{i}/")
- os.mkdir(f"folds/fold{i}/train")
- os.mkdir(f"folds/fold{i}/validation")
- os.mkdir(f"folds/fold{i}/train/Alarmed")
- os.mkdir(f"folds/fold{i}/train/Annoyed")
- os.mkdir(f"folds/fold{i}/train/Curious")
- os.mkdir(f"folds/fold{i}/train/Relaxed")
- os.mkdir(f"folds/fold{i}/validation/Alarmed")
- os.mkdir(f"folds/fold{i}/validation/Annoyed")
- os.mkdir(f"folds/fold{i}/validation/Curious")
- os.mkdir(f"folds/fold{i}/validation/Relaxed")
- except:
- print("Can't create directory because it already exists")
|