training and Predicting probabilities using logistic regression model
Since your output variable is continuous it can't be used directly in classification. There are some steps through which you can achieve inference.


Based on the probability, convert your 'y' (output) variable into a class label.


for example, if your class A &amp; class B has a probability of 0.6, 0.4 respectively. convert it into a single variable y and it should have the value that represent the respective classes.

Now you have the features mapped to their respective class label. Now we can train the model with the available data.
After training the model, the prediction will give you class probabilities on your test data.


Note : Use softmax in case of neural networks to squash the output values to probabilities.