# Can I use the training rows multiple times while training with different labels attached to it?

If I have a data set where for every text message, same but two labels are given. It could be that only one label has been filled. To visualise this scenario in real life, one may classify the accent to belong to 'US English' and 'UK English'.

Here is an example where fro every text, atmost 2 sentiments' values are given.

• text - Sentiment - sentiment
• Ron is very amicable person - 5 - 4
• That is so not the place to enjoy - 1
• Rita is not so caring - 1 - 2

Now, I have to predict SINGLE sentiment column for the given text column.

Can I create the training dataset as below for training purpose? What could be difficulties in doing so?

• text - Sentiment
• Ron is very amicable person - 5
• Ron is very amicable person - 4
• That is so not the place to enjoy - 1
• Rita is not so caring - 1
• Rita is not so caring - 2

Edit: My focus is not on choosing a single class for given text but on the decision to include that text two times with different class attributed to it.

The problem you are describing is a perfect use case for Fuzzy Logic.

Contrary to boolean logic where things are either black or white, fuzzy logic allows things to be grey.

Take the example of weather. Given a temperature, some people might say it is cold whereas other would say it is warm. There will be situations where all say it is cold, but there exists a mid-term where the classification isn't $\{0,1\}$ but rather $[0,1]$.

Therefore, it won't be a problem given that your chosen algorithm allows for probabilistic output.

So given the temperature example. You have the classes [cold, warm, hot]. If your algorithm can only output binary classifications (e.g. [0, 1, 0]), then better only input data points with only 1 label. However, if your algorithm can output probabilistic classifications (e.g. [0.2, 0.7, 0.1]) then you can input the same datapoint with multiple labels.

In the end, you can pick the class with the largest probability, but you need to understand that this might not give the output you are expecting. If you get a classification of [0.49, 0.51, 0.0], you might say is class 2 where in truth the model is not actually telling you that.

I think there is no problem in doing so. However, what I would do is aggregate. That is, I would take every unique text and create a unique instance with it. The question remains on which sentiment I would associate with it. I would do it with the median, as it is more robust than the mean. That is, if I have the following:

• Ron is very amicable person - 5
• Ron is very amicable person - 4
• Ron is very amicable person - 4
• Ron is very amicable person - 1

I would aggregate this into:

• Ron is very amicable person - 4

This is in order to give the same importance to text that appears repeated many times and text that appears only once. In principle, they should be equally important, so there is not any reason to make one of them appear in your learning algorithm much more. If an instance appears many times in a learning algorithm, the cost function is very influenced much more by that instance than others, and I think that is not what you want in this case.

Edit

I am not sure if your question says that every instance appears at most two times. In that case, the median is the same as the mean, so you can aggregate with the mean.

• I have now mentioned in the question too that I am more focussed on the implications of using the text with two classes separately. If text- class1-class2 is the row, on separating it into text-class1 and text-class2 in the training set, what would happen? At first, it looks like it will overfit because of using the same text. But I am not sure of any other caveats. Jun 7, 2018 at 8:13
• Depending on the algorithm you use, but I think it will be similar to what I said, plus having the problem of repeated instances. Jun 7, 2018 at 8:16