Advice on proper use of Dataset labels


Per documentation in DataSet class, labels “… should be binarized label matrices such that the specified label has a value of 1 in the desired column with the label)”.
I am wondering if it is OK to use DataSet in such way that the parameter INDArray “second” can contain INDArray of row vectors whose values are floats in (0,1) interval. In other words, instead of having row vectors such as [1.0,0,0,0,0] they can be something like [0.97, 0.08, 0.01, 0.02, 0.05].
Specifically, I am interested in whether or not the fit function would be able to properly calculate and backpropagate errors if labels are not in the [1.0,0,0,0,0] especially if I am using sigmoid activation function in each layer including the output layer. I am not looking to classify output, but rather build a non-linear model that would map features to output.

Thank you in advance!


What you are looking to do is called “regression”, and yes, when doing regression (with the appropriate loss function), there is no problem with using labels that aren’t one-hot encoded


Awesome! Thank you very much for responding so quickly!
I am looking to scale the label data to be between 0 and 1 and use MEAN_SQUARED_LOGARITHMIC_ERROR for loss function. Does that sound reasonable to you?

Yes, the MSE variants are usually reasonable for regression problems.

Perfect, thank you very much!