# Non linearly separable data to linearly separable data in the same dimension or lower dimension

In continuation to this question, Non linear to linearly seperable I am trying to understand if we do not want to transform to a higher dimension is it possible to still find a feature map that maps non linearly separable data into linearly separable data. If yes whats the intuition. For example in the image below I am trying to check if there is any 1D transformation I can use to find linearly separable data. Also can we find transformation in lower dimension. Any reference material to read would be helpful as well.

• Good question; note that it's not enough just to have some map, we need one that's continuous(ly differentiable). Commented Nov 14, 2022 at 14:41
• by assumption there is a mapping from a given data point to its class, and using the mapping, the problem is linearly separable. ie if my feature already solves the class mapping. Commented Dec 5, 2022 at 1:03

Every case is different, and it's not generally possible for every data set, but there's a very simple transformation that makes your data linearly separable:

x = 1:20
y = c(0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1)
f = function(x) (x - 1) %% 4

plot(x, y, main = 'Not linearly separable')


plot(f(x), y, main = 'Linearly seperable')


x %% 4 here is the modulo or remainder operator: the remainder when x is divided by 4.

Yes, it is sometimes possible. In the example you give, a point $$t$$ is class X precisely when $$\sin(\pi t)>0$$.