clip-protocol 2.2.14__tar.gz → 2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {clip_protocol-2.2.14 → clip_protocol-2.3}/PKG-INFO +1 -1
- clip_protocol-2.3/evaluation/AOI datasets/S1.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S10.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S11.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S12.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S13.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S14.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S15.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S16.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S17.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S18.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S19.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S2.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S20.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S3.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S4.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S5.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S6.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S7.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S8.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/S9.xlsx +0 -0
- clip_protocol-2.3/evaluation/AOI datasets/process.py +57 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/experiment_1.py +5 -37
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/experiment_2.py +3 -2
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/experiment_3.py +5 -4
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/experiment_4.py +2 -2
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/experiment_5.py +2 -2
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experiment_2_params.json +2 -2
- {clip_protocol-2.2.14 → clip_protocol-2.3}/pyproject.toml +1 -1
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/main/setup.py +1 -0
- clip_protocol-2.2.14/evaluation/datasets-article/process.py +0 -46
- {clip_protocol-2.2.14 → clip_protocol-2.3}/.github/workflows/python-app.yml +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/.gitignore +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/.readthedocs.yaml +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/.vscode/settings.json +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/LICENSE +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/README.md +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/docs/api-reference.md +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/docs/assets/images/logo.png +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/docs/assets/images/overview.png +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/docs/index.md +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/docs/installation.md +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/docs/requirements.txt +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-3000-d1.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-3000-d2.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-3000-d3.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-3000-d4.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-4000-d1.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-4000-d2.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-4000-d3.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-4000-d4.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-5000-d1.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-5000-d2.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-5000-d3.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-5000-d4.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-6000-d1.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-6000-d2.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-6000-d3.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-6000-d4.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-7000-d1.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-7000-d2.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-7000-d3.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets-article → clip_protocol-2.3/evaluation/Synthetic datasets}/SynLog-7000-d4.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d1-3000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d1-4000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d1-5000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d1-6000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d1-7000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d2-3000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d2-4000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d2-5000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d2-6000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d2-7000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d3-3000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d3-4000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d3-5000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d3-6000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d3-7000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d4-3000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d4-4000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d4-5000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d4-6000.xlsx +0 -0
- {clip_protocol-2.2.14/evaluation/datasets → clip_protocol-2.3/evaluation/TFG datasets}/aoi-hits-d4-7000.xlsx +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/__init__.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/experiment_7.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experiment_4_params.json +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experiment_5.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experiment_5_size_comparison.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experimet_4_d1_PCMeS.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experimet_4_d1_PHCMS.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experimet_4_d2_PCMeS.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experimet_4_d2_PHCMS.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experimet_4_d3_PCMeS.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experimet_4_d3_PHCMS.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experimet_4_d4_PCMeS.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experimet_4_d4_PHCMS.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/table_experiment_3_PCMeS.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/table_experiment_3_PHCMS.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/frecuencias_por_archivo.csv +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/generate_dataset.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/real_frequencies.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/mkdocs.yml +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/requirements.txt +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/__init__.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/__init__.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/cli.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/count_mean/__init__.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/count_mean/cms_client_mean.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/count_mean/private_cms_client.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/count_mean/private_cms_server.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/hadamard_count_mean/__init__.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/hadamard_count_mean/private_hcms_client.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/hadamard_count_mean/private_hcms_server.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/main/__init__.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/main/agregate.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/main/estimate.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/main/mask.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/utils/__init__.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/utils/errors.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/utils/utils.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/tests/__init__.py +0 -0
- {clip_protocol-2.2.14 → clip_protocol-2.3}/tests/test_sample.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clip_protocol
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3
|
|
4
4
|
Summary: Protocol to ensure the privatization of
|
|
5
5
|
Project-URL: Homepage, https://github.com/martaajonees/Local_Privacy
|
|
6
6
|
Project-URL: Issues, https://github.com/martaajonees/Local_Privacy/issues
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
import glob
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
# Carpeta actual donde está el script
|
|
6
|
+
current_folder = os.getcwd()
|
|
7
|
+
|
|
8
|
+
# Buscar todos los archivos .xlsx en la carpeta actual
|
|
9
|
+
xlsx_files = glob.glob(os.path.join(current_folder, "*.xlsx"))
|
|
10
|
+
|
|
11
|
+
for file_path in xlsx_files:
|
|
12
|
+
try:
|
|
13
|
+
# Leer el archivo
|
|
14
|
+
df_temp = pd.read_excel(file_path)
|
|
15
|
+
|
|
16
|
+
if any(col.startswith("Unnamed") for col in df_temp.columns):
|
|
17
|
+
df = pd.read_excel(file_path, header=1)
|
|
18
|
+
else:
|
|
19
|
+
df = df_temp
|
|
20
|
+
|
|
21
|
+
# --- MEJORA: Limpiar nombres de columnas ---
|
|
22
|
+
# Eliminamos espacios en blanco extra y pasamos a minúsculas para comparar fácilmente
|
|
23
|
+
df.columns = [str(c).strip() for c in df.columns]
|
|
24
|
+
cols_lower = [c.lower() for c in df.columns]
|
|
25
|
+
|
|
26
|
+
# Buscamos los índices de las columnas que necesitamos (sin importar mayúsculas)
|
|
27
|
+
target_p = 'participant'
|
|
28
|
+
target_a = 'aoi hit'
|
|
29
|
+
|
|
30
|
+
if target_p in cols_lower and target_a in cols_lower:
|
|
31
|
+
# Identificar los nombres reales de las columnas en este archivo específico
|
|
32
|
+
real_col_p = df.columns[cols_lower.index(target_p)]
|
|
33
|
+
real_col_a = df.columns[cols_lower.index(target_a)]
|
|
34
|
+
|
|
35
|
+
# Obtener el nombre del archivo sin extensión para el participante
|
|
36
|
+
participant_name = os.path.splitext(os.path.basename(file_path))[0]
|
|
37
|
+
|
|
38
|
+
# Reemplazar valores y filtrar
|
|
39
|
+
df[real_col_p] = participant_name
|
|
40
|
+
|
|
41
|
+
# Mantener solo las dos columnas y limpiar nulos
|
|
42
|
+
df = df[[real_col_p, real_col_a]]
|
|
43
|
+
df = df[df[real_col_a].notna()]
|
|
44
|
+
|
|
45
|
+
# Renombrar a los nombres finales deseados
|
|
46
|
+
df.columns = ['Participant', 'AOI hit']
|
|
47
|
+
|
|
48
|
+
# Sobrescribir el archivo original
|
|
49
|
+
df.to_excel(file_path, index=False)
|
|
50
|
+
print(f"✅ Procesado: {os.path.basename(file_path)}")
|
|
51
|
+
else:
|
|
52
|
+
print(f"❌ Columnas no encontradas en {os.path.basename(file_path)}. Columnas detectadas: {list(df.columns)}")
|
|
53
|
+
|
|
54
|
+
except Exception as e:
|
|
55
|
+
print(f"⚠️ Error procesando {os.path.basename(file_path)}: {e}")
|
|
56
|
+
|
|
57
|
+
print("\nProceso finalizado.")
|
|
@@ -24,38 +24,6 @@ def run_command(e, k, m, df, privacy_method):
|
|
|
24
24
|
|
|
25
25
|
return compute_error_table(get_real_frequency(df), df_estimated, 2), df_estimated
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
def plot_latex(errors, path):
|
|
29
|
-
lines = [
|
|
30
|
-
r"\begin{figure}[h]",
|
|
31
|
-
r"\centering",
|
|
32
|
-
r"\begin{tikzpicture}",
|
|
33
|
-
r"\begin{axis}[",
|
|
34
|
-
r" xlabel={$\epsilon$}, ylabel={Error},",
|
|
35
|
-
r" legend style={at={(0.5,-0.15)}, anchor=north,legend columns=-1},",
|
|
36
|
-
r" xmin=0, grid=major, width=12cm, height=8cm,",
|
|
37
|
-
r" cycle list name=color list,",
|
|
38
|
-
r"]"
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
for metric, points in errors.items():
|
|
42
|
-
name = "Lp Norm" if metric == "Lρ Norm" else metric
|
|
43
|
-
lines.append(r"\addplot coordinates {")
|
|
44
|
-
lines += [f" ({eps}, {err})" for eps, err in sorted(points)]
|
|
45
|
-
lines.append(r"};")
|
|
46
|
-
lines.append(fr"\addlegendentry{{{name}}}")
|
|
47
|
-
|
|
48
|
-
lines += [
|
|
49
|
-
r"\end{axis}",
|
|
50
|
-
r"\end{tikzpicture}",
|
|
51
|
-
r"\caption{Evolución del error por métrica en función del parámetro $\epsilon$}",
|
|
52
|
-
r"\end{figure}"
|
|
53
|
-
]
|
|
54
|
-
|
|
55
|
-
with open(path, "w") as f:
|
|
56
|
-
f.write("\n".join(lines))
|
|
57
|
-
print(f"✅ LaTeX graph saved to {path}")
|
|
58
|
-
|
|
59
27
|
def run_experiment1(df, privacy_method):
|
|
60
28
|
k = int(input("🔑 Enter k value: "))
|
|
61
29
|
m = int(input("🔢 Enter m value: "))
|
|
@@ -65,13 +33,13 @@ def run_experiment1(df, privacy_method):
|
|
|
65
33
|
epsilons = [round(e, 1) for e in list(reversed([x * 0.5 for x in range(1, 21)])) + [0.4, 0.3, 0.2, 0.1]]
|
|
66
34
|
|
|
67
35
|
for eps in epsilons:
|
|
68
|
-
|
|
36
|
+
print(f"Running with epsilon: {eps}")
|
|
37
|
+
table, _ = run_command(eps, k, m, df, privacy_method)
|
|
69
38
|
for metric, val in table:
|
|
70
39
|
error_history.setdefault(metric, []).append((eps, val))
|
|
71
40
|
|
|
72
41
|
df = pd.DataFrame(error_history)
|
|
73
|
-
df.to_csv(f"
|
|
74
|
-
plot_latex(error_history, f"figures/experiment_1_{privacy_method}.tex")
|
|
42
|
+
df.to_csv(f"table_experiment_1_{privacy_method}.csv", index=False)
|
|
75
43
|
|
|
76
44
|
if __name__ == "__main__":
|
|
77
45
|
parser = argparse.ArgumentParser(description="Run experiment 1")
|
|
@@ -79,8 +47,8 @@ if __name__ == "__main__":
|
|
|
79
47
|
args = parser.parse_args()
|
|
80
48
|
|
|
81
49
|
distribution = input(" Enter the distribution 1/2/3/4: ")
|
|
82
|
-
|
|
83
|
-
pattern = f"
|
|
50
|
+
|
|
51
|
+
pattern = f"SynLog-5000-d{distribution}"
|
|
84
52
|
matching_files = [f for f in os.listdir(args.f) if pattern in f and f.endswith(".xlsx")]
|
|
85
53
|
|
|
86
54
|
file_path = os.path.join(args.f, matching_files[0])
|
|
@@ -115,7 +115,7 @@ def run_experiment_2(datasets_by_size, params):
|
|
|
115
115
|
"Iteraciones PCMeS", "Tiempo de ejecución PCMeS"]
|
|
116
116
|
df_pivot = df_pivot[final_cols]
|
|
117
117
|
|
|
118
|
-
df_pivot.to_csv("
|
|
118
|
+
df_pivot.to_csv("table_experiment_2.csv", index=False)
|
|
119
119
|
|
|
120
120
|
|
|
121
121
|
if __name__ == "__main__":
|
|
@@ -133,7 +133,8 @@ if __name__ == "__main__":
|
|
|
133
133
|
|
|
134
134
|
datasets = {}
|
|
135
135
|
for size in sizes:
|
|
136
|
-
|
|
136
|
+
|
|
137
|
+
pattern = f"SynLog-{size}-d{distribution}"
|
|
137
138
|
file_path = os.path.join(args.f, pattern + ".xlsx")
|
|
138
139
|
header = 1 if "Unnamed" in pd.read_excel(file_path, nrows=1).columns[0] else 0
|
|
139
140
|
df = pd.read_excel(file_path, header=header)
|
|
@@ -66,7 +66,8 @@ def optimize_e(k, m, df, e_r, privacy_level, error_value, tolerance, privacy_met
|
|
|
66
66
|
def run_experiment_3(datasets, params):
|
|
67
67
|
error_value = 0.05
|
|
68
68
|
tolerance = 0.01
|
|
69
|
-
privacy_level = "high"
|
|
69
|
+
# privacy_level = "high"
|
|
70
|
+
privacy_level = "low"
|
|
70
71
|
|
|
71
72
|
for method in ["PCMeS", "PHCMS"]:
|
|
72
73
|
row_apple = {"Método": "Método de Apple"}
|
|
@@ -89,7 +90,7 @@ def run_experiment_3(datasets, params):
|
|
|
89
90
|
row_clip[size] = f"{epsilon:.2f} / {pe_error:.2f}"
|
|
90
91
|
|
|
91
92
|
df_result = pd.DataFrame([row_apple, row_clip])
|
|
92
|
-
df_result.to_csv(f"
|
|
93
|
+
df_result.to_csv(f"table_experiment_3_{method}.csv", index=False)
|
|
93
94
|
|
|
94
95
|
|
|
95
96
|
if __name__ == "__main__":
|
|
@@ -107,11 +108,11 @@ if __name__ == "__main__":
|
|
|
107
108
|
|
|
108
109
|
datasets = {}
|
|
109
110
|
for size in sizes:
|
|
110
|
-
pattern = f"
|
|
111
|
+
pattern = f"SynLog-{size}-d{distribution}"
|
|
111
112
|
file_path = os.path.join(args.f, pattern + ".xlsx")
|
|
112
113
|
header = 1 if "Unnamed" in pd.read_excel(file_path, nrows=1).columns[0] else 0
|
|
113
114
|
df = pd.read_excel(file_path, header=header)
|
|
114
115
|
datasets[size] = df
|
|
115
116
|
|
|
116
117
|
|
|
117
|
-
run_experiment_3(datasets, params)
|
|
118
|
+
run_experiment_3(datasets, params)
|
|
@@ -84,7 +84,7 @@ def run_experiment_4(datasets, params):
|
|
|
84
84
|
cleaned_table = [[col[0], col[1].replace('%', '') if isinstance(col[1], str) else col[1]] for col in filtered_table]
|
|
85
85
|
|
|
86
86
|
error_by_aoi = pd.DataFrame(cleaned_table, columns=['AOI', 'Error'])
|
|
87
|
-
path_individual = f"
|
|
87
|
+
path_individual = f"experimet_4_d{distribution}_{method}.csv"
|
|
88
88
|
error_by_aoi.to_csv(path_individual, index=False)
|
|
89
89
|
|
|
90
90
|
if __name__ == "__main__":
|
|
@@ -101,7 +101,7 @@ if __name__ == "__main__":
|
|
|
101
101
|
|
|
102
102
|
datasets = {}
|
|
103
103
|
for distribution in distributions:
|
|
104
|
-
pattern = f"
|
|
104
|
+
pattern = f"SynLog-5000-d{distribution}"
|
|
105
105
|
file_path = os.path.join(args.f, pattern + ".xlsx")
|
|
106
106
|
header = 1 if "Unnamed" in pd.read_excel(file_path, nrows=1).columns[0] else 0
|
|
107
107
|
df = pd.read_excel(file_path, header=header)
|
|
@@ -149,10 +149,10 @@ def run_experiment_5(datasets, privatized_path):
|
|
|
149
149
|
privatized_data.to_csv(filename, index=False)
|
|
150
150
|
|
|
151
151
|
performance_df = pd.DataFrame(performance_records)
|
|
152
|
-
performance_df.to_csv("
|
|
152
|
+
performance_df.to_csv("experiment_5.csv", index=False)
|
|
153
153
|
|
|
154
154
|
size_df = pd.DataFrame(size_comparison_records)
|
|
155
|
-
size_df.to_csv("
|
|
155
|
+
size_df.to_csv("experiment_5_size_comparison.csv", index=False)
|
|
156
156
|
|
|
157
157
|
def load_excel_with_header_check(filepath):
|
|
158
158
|
try:
|
|
@@ -76,6 +76,7 @@ class Setup:
|
|
|
76
76
|
self.df['value'] = self.df['value'].astype(str).apply(lambda x: x.strip())
|
|
77
77
|
self.df = self.df[self.df['value'] != '-']
|
|
78
78
|
self.df = self.df[self.df['value'].str.contains(r'\w', na=False)]
|
|
79
|
+
self.df = self.df.sample(frac=1, random_state=None).reset_index(drop=True)
|
|
79
80
|
self.N = len(self.df)
|
|
80
81
|
|
|
81
82
|
def run_command(self, e, k, m):
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import glob
|
|
3
|
-
import re
|
|
4
|
-
import pandas as pd
|
|
5
|
-
import random
|
|
6
|
-
import string
|
|
7
|
-
import hashlib
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# ID único que quieres usar
|
|
11
|
-
UNIQUE_USER_ID= ''.join(random.choices(string.ascii_uppercase + string.digits, k=5))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
# Buscar todos los archivos xlsx en el directorio actual
|
|
15
|
-
files = glob.glob("*.xlsx")
|
|
16
|
-
|
|
17
|
-
for file in files:
|
|
18
|
-
print(f"Procesando {file}...")
|
|
19
|
-
|
|
20
|
-
# Leer el Excel
|
|
21
|
-
df = pd.read_excel(file)
|
|
22
|
-
|
|
23
|
-
# 1️⃣ Cambiar todos los user_id a uno único
|
|
24
|
-
if "user_id" in df.columns:
|
|
25
|
-
df["user_id"] = UNIQUE_USER_ID
|
|
26
|
-
else:
|
|
27
|
-
print(f"⚠️ No se encontró columna 'user_id' en {file}")
|
|
28
|
-
|
|
29
|
-
# 2️⃣ Renombrar la segunda columna a 'events'
|
|
30
|
-
if len(df.columns) >= 2:
|
|
31
|
-
cols = list(df.columns)
|
|
32
|
-
cols[1] = "events"
|
|
33
|
-
df.columns = cols
|
|
34
|
-
else:
|
|
35
|
-
print(f"⚠️ El archivo {file} no tiene al menos 2 columnas")
|
|
36
|
-
|
|
37
|
-
# 3️⃣ Reemplazar subevent_X → eX dentro de la columna events
|
|
38
|
-
if "events" in df.columns:
|
|
39
|
-
df["events"] = df["events"].astype(str).apply(
|
|
40
|
-
lambda x: re.sub(r"subevent_(\d+)", r"e\1", x)
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
# Guardar sobrescribiendo el archivo
|
|
44
|
-
df.to_excel(file, index=False)
|
|
45
|
-
|
|
46
|
-
print("✅ Procesamiento terminado.")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clip_protocol-2.2.14 → clip_protocol-2.3}/evaluation/figures/experiment_5_size_comparison.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/count_mean/private_cms_client.py
RENAMED
|
File without changes
|
{clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/count_mean/private_cms_server.py
RENAMED
|
File without changes
|
{clip_protocol-2.2.14 → clip_protocol-2.3}/src/clip_protocol/hadamard_count_mean/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|