I am trying to use my data to predict the classes of the input. My data are as the following:

x1 = [0.2, 0.25, 0.15, 0.22] y = 1
x2 = [0.124, 0.224, 0.215, 0.095] y = 3
xn = [...] y = 2

The problem is that my data are just lists of numbers that do not have an order. I mean that x1 can be x1 = [0.2, 0.25, 0.15, 0.22] y = 1 or x1 = [0.25, 0.22, 0.2, 0.15] y = 1 or the numbers in the list to be in any other order.

Is there anything that I can do, so I will be able to build a classifier? Thank you!

  • $\begingroup$ If the order doesn't matter, it seems like you have repeated measurements of a single feature for each sample. Can you build a classifier to classify each measurement individually, and then take a consensus of the predictions? $\endgroup$ – Nuclear Hoagie Jul 7 '20 at 16:18

The simple option is to design your features so that they represent the distribution of the values: every feature $f_i$ represents a bin and its value for a particular instance is the frequency of the corresponding range for this instance.

Example: let's consider 10 bins between 0 and 1, i.e. $f_1=[0,0.1), f_2=[0.1,0.2),..., f_{10}=[0.9,1]$:

  • $x_1=[0.2, 0.25, 0.15, 0.22]$ is represented as $[0,1,3,0,0,0,0,0,0,0]$
  • $x_2 = [0.124, 0.224, 0.215, 0.095]$ is represented as $[1,1,2,0,0,0,0,0,0,0]$
  • ...
  • $\begingroup$ Thank you for your answer! I will try it and see how it will work! But it sounds a good solution! Thank you! $\endgroup$ – user85850 Jul 8 '20 at 10:48
  • $\begingroup$ @user85850 Discretizing continuous variables is generally considered a bad idea if you can avoid it, since you're throwing away information. You'll also get different answers depending on how many bins you choose to use and where you draw their boundaries, which isn't ideal. $\endgroup$ – Nuclear Hoagie Jul 8 '20 at 16:18
  • $\begingroup$ @NuclearWang I agree, but in this case, it seems that it is a good idea. I can't classify each measurement individually, so I think the solution Erwan proposed is a good one. $\endgroup$ – user85850 Jul 10 '20 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.