Log regression task metrics in multitask model#3648
Log regression task metrics in multitask model#3648ntravis22 wants to merge 7 commits intoflairNLP:masterfrom
Conversation
MattGPT-ai
left a comment
There was a problem hiding this comment.
Are there metrics for regression type models that we could put into scores, or do those perhaps go into the "classification report" - e.g. Pearson, spearman. In the regression models, results is written as
eval_metrics = {
"loss": eval_loss.item(),
"mse": metric.mean_squared_error(),
"mae": metric.mean_absolute_error(),
"pearson": metric.pearsonr(),
"spearman": metric.spearmanr(),
}
So maybe we could either check for the base model class that defines evaluate, or just check for the keys. Then maybe we could write e.g. scores[(task_id, 'mse')]. What do you think?
Ok I added mse. |
|
Oh actually, can we just add all four of the metrics? |
Done |
|
@ntravis22 @MattGPT-ai Could you paste a script to test this PR? |
|
@alanakbik Here is a script to test: Running this with the changes in this PR you can see lines printed like: |
Recently per-task metrics were added to multitask_model, however we did not include any for regression tasks and we did not check that the metric keys are present which can throw an error, so this addresses both of those concerns.