How to set up Trainer for a regression?

Yes, you can see that in the source code here.

Note that you can also set the problem_type of the model to “regression” (which is equivalent to setting num_labels=1).

4 Likes