-
Notifications
You must be signed in to change notification settings - Fork 0
Evaluation_Cache_Format
Each evaluation runner writes per-case results into cache files.
The cache allows different methods to be run independently and evaluated together later.
Cache directory:
outputs/evaluation/<DATASET>/cache/
Example:
outputs/evaluation/MME/cache/
Each case is saved as:
case_0000.json
case_0001.json
case_0002.json
...
Function:
cache_path_for(cache_dir, index)Example:
cache_path_for(cache_dir, 0)returns:
outputs/evaluation/MME/cache/case_0000.json
Example:
{
"case_index": 0,
"hpo_terms": ["HP:0001263", "HP:0001250"],
"ground_truth": ["ORPHA:123"],
"total_elapsed_seconds": 12.345,
"method_elapsed_seconds": {
"set_jaccard": 0.021,
"set_cosine": 0.020
},
"methods_run": [
"set_cosine",
"set_jaccard"
],
"results": {
"set_jaccard": [
{
"disease_id": "ORPHA:123",
"label": "Disease name",
"score": 0.87,
"rank": 1
}
]
}
}Integer case index.
The patient HPO terms used for the case.
The confirmed disease IDs for the case.
A case may have multiple ground-truth IDs.
Accumulated runtime for this case.
When multiple runners add results to the same case file, save_cache() adds the new runtime to the existing total.
Runtime per method.
Example:
"method_elapsed_seconds": {
"set_jaccard": 0.021,
"tfidf": 0.054
}Sorted list of methods available in the cache file.
Used by resume logic.
Ranked disease results per method.
Example:
"results": {
"set_jaccard": [
{
"disease_id": "ORPHA:123",
"label": "Disease name",
"score": 0.87,
"rank": 1
}
]
}Each result should contain at least:
disease_id or canonical_disease_id or ordo_id
rank
score
label
Preferred format:
{
"disease_id": "ORPHA:123",
"label": "Example disease",
"score": 0.87,
"rank": 1
}The evaluator can extract disease IDs from:
disease_id
canonical_disease_id
ordo_id
Function:
save_cache(...)The save function:
1. Loads an existing case cache if it exists.
2. Merges new method results into existing results.
3. Merges new method timing into existing timing.
4. Updates methods_run.
5. Writes the file back to disk.
This means these commands can be run independently:
python scripts/evaluation/run_set_based.py --test-set data/datasets/phenobrain_testdata/MME.json
python scripts/evaluation/run_tfidf.py --test-set data/datasets/phenobrain_testdata/MME.json
python scripts/evaluation/run_semantic.py --test-set data/datasets/phenobrain_testdata/MME.jsonAll runners write into:
outputs/evaluation/MME/cache/
and each case file accumulates results from all methods.
Function:
methods_already_cached(cache_file, required_methods)Returns True if every required method is already present in the cache file.
Default behavior:
resume = True
Disable resume:
python scripts/evaluation/run_set_based.py \
--test-set data/datasets/phenobrain_testdata/MME.json \
--no-resumeUse --no-resume when:
old cache should be overwritten
If a case fails, the runner writes an error file next to the cache files.
Example:
case_0003.error
The file contains:
ExceptionType: error message
This allows the batch process to continue even if one case fails.
Getting Started
Web Interface (Frontend)
Project Overview
Similarity Methods
Validation Tools
Evaluate RareSim methods
- Evaluation Workflow Overview
- Batch Runners and Shared Utilities
- Evaluation Cache Format
- Evaluator and Metrics
- Adding a New Evaluation Method
Ontology Scripts
Datasets
TODO
Shared Artifact Generation
- Shared Artifact Overview
- Raw Sources and Ontology Loading
- Disease ID Normalization and Mapping
- Disease Profile Construction
- Artifact File Reference and Runtime Loading
- Full Artifact Workflow