Structured data but output is category?

Is it possible to adapt the Rossmann notebook to try to predict a class instead of a continuous variable ?

And if yes, can we apply weights on the classes like in image classification ?

yes you can use the approach in the rossmann notebook for classification instead of regression. There is an argument to ColumnarData.from_data_frame() that is called is_reg that indicates whether the data is for classification or regression. There is also a argument called is_multi that indicates whether it is a multilabel classification problem or not.

What do you mean with weights on the classes?

A good example would be to try and submit a solution to the titanic kaggle competition with a neural network and fastai. It was a great exercise for me. I may have the notebook with my solution somewhere

Thanks Marius, I will try the is_reg parameter.

As for my comment on the weights: my data is strongly unbalanced. So when I was using images as an input, my code below was giving more weights to the classes that were a minority versus the other majority classes:

data = ImageClassifierData.from_paths(PATH, tfms=tfms_from_model(arch, sz))
learn = ConvLearner.pretrained(arch, data, precompute=True)
loss_weights = torch.FloatTensor([0.99,0.01]).cuda()
learn.crit = partial(F.cross_entropy, weight=loss_weights), 15)

The 2 lines I added are loss_weights and learn.crit, following the discussion in this thread:

I wonder if there is something similar we can use for classification of structured data using classes as output.