Home > Mobile >  How to know which prediction belongs to which id in classification with neural networks?
How to know which prediction belongs to which id in classification with neural networks?

Time:09-03

I have attributes, label column and id column in my dataset. Label column consists of 1 and 0. I'm trying to predict a disease for each person but I had to drop id column for training model. I need to use CNN and LSTM to compare results. I need to get prediction probabilities and predicted labels. How do I get predictions for each id?

CodePudding user response:

I will try to answer while there are a lot of unknowns here.

Firstly, you need to train some kind of model to be able to get something meaningful predictions for your dataset. Have you been able to implement a CNN or LSTM for this problem?

If so and you are able to train your model at the very end you need to do an evaluation. In order to get the probabilities you should run the prediction with the trained model for each id in turn. (For example in a loop for samples ordered by id).

Have you managed to write any code for your problem?

CodePudding user response:

I could solve it by creating a dataframe for ids of x_test and dropped id column from x_train and x_test after train_test_split. Then I merged predicted labels, probabilities and ids into a dataframe.

  • Related