Skip to content

Commit

Permalink
Fix bug in rmse evaluation
Browse files Browse the repository at this point in the history
This should not affect any existing results because all regression datasets are single (not multi-) task, i.e., `y_true.shape[1]` is 1.
  • Loading branch information
weihua916 authored Sep 21, 2022
1 parent c8efe8e commit dd9e3d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ogb/graphproppred/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def _eval_rmse(self, y_true, y_pred):
for i in range(y_true.shape[1]):
# ignore nan values
is_labeled = y_true[:,i] == y_true[:,i]
rmse_list.append(np.sqrt(((y_true[is_labeled] - y_pred[is_labeled])**2).mean()))
rmse_list.append(np.sqrt(((y_true[is_labeled,i] - y_pred[is_labeled,i])**2).mean()))

return {'rmse': sum(rmse_list)/len(rmse_list)}

Expand Down

0 comments on commit dd9e3d0

Please sign in to comment.