Skip to content

Commit

Permalink
feat: renamed json files
Browse files Browse the repository at this point in the history
  • Loading branch information
qh681248 committed Oct 17, 2024
1 parent 52e7869 commit db3d3ee
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 78 deletions.
74 changes: 0 additions & 74 deletions benchmark/benchmark_results.json

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion benchmark/blobs_benchmark_visualiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def print_metrics_table(data: dict, sample_size: str) -> None:
def main() -> None:
"""Load the data and print metrics in table format per sample size."""
# Load the JSON data
with open("coreset_comparison_results.json", encoding="utf-8") as f:
with open("blobs_benchmark_results.json", encoding="utf-8") as f:
data = json.load(f)

# Print tables for each sample size
Expand Down
4 changes: 2 additions & 2 deletions benchmark/mnist_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def train_model(data_bundle: dict, key, config) -> dict:

def save_results(results: dict) -> None:
"""Save results to JSON."""
with open("benchmark_results.json", "w", encoding="utf-8") as f:
with open("mnist_benchmark_results.json", "w", encoding="utf-8") as f:
json.dump(results, f, indent=4)

print("Data has been saved to 'benchmark_results.json'")
Expand Down Expand Up @@ -500,7 +500,7 @@ def main() -> None:
results[name][size] = {}

# Store accuracy result in nested structure
results[name][size][i] = result["final_test_accuracy"]
results[name][size][i] = float(result["final_test_accuracy"])

save_results(results)

Expand Down
8 changes: 8 additions & 0 deletions benchmark/mnist_benchmark_results.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"RandomSample": {
"25": {
"0": 0.4541817307472229,
"1": 0.5102042555809021
}
}
}
2 changes: 1 addition & 1 deletion benchmark/mnist_benchmark_visualiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

def main() -> None:
"""Load benchmark results and visualize the algorithm performance."""
with open("benchmark_results.json", "r", encoding="utf-8") as file:
with open("mnist_benchmark_results.json", "r", encoding="utf-8") as file:
# Load the JSON data into a Python object
data_by_solver = json.load(file)

Expand Down

0 comments on commit db3d3ee

Please sign in to comment.