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.


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.
