I don't think there is a little misstake here, since you can have defined r2_score for some output, but not all.

A test would be needed for that case.