The number of outputs will depend on the task and the number of targets. In the case of medical grading, you can either interpret the problem as:
- a classification i.e. each grade is a class (5 outputs, one for each class)
- a regression: predict a grade and round the result (1 output)
Make sure to check the loss function for each task. That will usually tell you how the code writer decided to approach the problem. To come back to your example, the first task should have a classification loss (crossentropy for instance) and the second a regression (MSE). Also check for the last layer activation function: usually softmax/sigmoid for classification and None for regression.
It's complicated to say what would work without seeing the data. A recent competition (Janestreet Market predicition) also saw people approach the problem both as a classification and a regression. The highest rated public notebook on the private set so far is a regression-based approach.
I suspect that this happened because the classification (of whether a stock is going to have a positive return in the future) requires to binarize the labels which basically lead to information loss.