Outputs the precision (number of correct substitutes / number of total substitutes predicted) and the recall (number of substitutes in the ground truth that are predicted / number of total substitutes in the ground truth).
python3 evaluate.py -p [path_to_prediction] -g [path_to_ground_truth]
Precision: 0.998468606431853, Recall:0.998468606431853
Outputs the precision and recall for each individual ingredient in the file evaluations/metrics_by_ingredient.json
.
python3 evaluate.py -p [path_to_prediction] -g [path_to_ground_truth] -each True
{
"american cheese": {
"precision": 0.9705882352941176,
"recall": 0.9705882352941176
},
"apple juice": {
"precision": 1.0,
"recall": 1.0
},
}
Outputs the missing substitutes for each ingredient in the file evaluations/missing_ingredients.json
python3 evaluate.py -p [path_to_prediction] -g [path_to_ground_truth] -gm True
{
"american cheese": {
"cheddar cheese"
},
"apple juice": {
"apple cider",
"pear juice"
},
}
Outputs the wrong substitutes for each ingredient in the file evaluations/wrong_ingredients.json
python3 evaluate.py -p [path_to_prediction] -g [path_to_ground_truth] -gw True
{
"american cheese": {
"apple cider",
"pear juice"
},
"apple juice": {
"cheddar cheese"
},
}