-
Notifications
You must be signed in to change notification settings - Fork 0
/
unifica_folds.py
45 lines (38 loc) · 1.61 KB
/
unifica_folds.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import os
import pandas as pd
path = "./Fairness/Datasets/MAR-random_MultivariadoAll"
for name_dataset in ["german_credit",
"adult",
"bank",
"credit_card",
"diabetes",
"dutch",
"law",
"ricci",
"compass_7k",
"compass_4k",
"student_math",
"student_port",
"kdd"
]:
for model_impt in ["mean",
"customKNN",
"mice",
"pmivae",
#"saei",
"gain",
"softImpute"
]:
for mr in [10,20,40,60]:
folds = []
#features_protected = MyPipeline.retorna_featuresFairness(name_dataset)
#for x_miss in features_protected:
for fold in range (5):
arq = f"{name_dataset}_{model_impt}_fold{fold}_md{mr}.csv"
#arq = f"{name_dataset}_{model_impt}_fold{fold}_md{mr}_{x_miss}.csv"
df = pd.read_csv(os.path.join(path,arq))
folds.append(df)
df_unificado = pd.concat(folds, ignore_index=True)
#df_unificado.to_csv(f"/home/cruncher/Desktop/@MestradoArthur/Fairness/Datasets/{name_dataset}_{model_impt}_md{mr}_{x_miss}.csv", index=False)
df_unificado.to_csv(f"/home/cruncher/Desktop/@MestradoArthur/Fairness/Datasets/{name_dataset}_{model_impt}_md{mr}.csv", index=False)
print("done")