Tabular classification training issues and probability output with fastai v2

Try changing the dependent variable from one-hot encoding into one target column with different levels A, B, C, D, E. The standard output of a classifier will be probabilities for each class that sum up to one.

Since you are solving a classification problem you need to use a loss function for classification, i.e. CrossEntropyLossFlat instead of F.mse_loss. You can also try not specifying any loss function. Usually fastai picks the right one for you automatically based on the structure of your data. Also, thre is no need to specify y_range for classification problems.

3 Likes