# Linearly separable data set

I need to use large scale of linearly separable data set in my work. Is there any data set which satisfy these features?

• Since it looks that you do not care too much about the meaning of your data, why did you not generate those kind of datasets? You simply have to choose a hyperplane of p-1 dimension for p variables and after generating data you put a label for one side of the hyperplane and another on the other side. – rapaio Nov 21 '16 at 7:06
• Thanks for your suggestion. However, I want to compare my idea with other existing idea. Therefore, I want to use some existing data set instead of using random generation. – pardis Nov 21 '16 at 7:32
• @pardis I can't see why this would make simulated data inappropriate? By simulating you have greater control on your data. Many datasets used in handbooks as example were created just like this. – Tim Nov 21 '16 at 19:25

One dataset with linearly separable examples is the Iris dataset, but only two of the classes are linearly separable.

Most real-world datasets are not linearly separable. If you truly need separable data, you should consider generating it yourself, e.g., by drawing points from two normal distributions with different means and relatively small variances.

If you need truly separable data (using R)...

gen_lin_sep_data <- function(n) {
x <- sample(0:1, n, replace = TRUE)
return(data.frame(x=x,y=x))
}

• and in case there are issues with exact duplication of data points you can do: return( data.frame(x=jitter(x), y=jitter(x) ) – Beyer Nov 21 '16 at 18:56

This may be an unacceptable kludge, but you can always make a data set linearly separable by mapping it into a bigger dimensional space. This is the idea of support vector machines. In particular, polynomials of sufficiently large degree will work. So if one has features $x_1, \ldots x_n$ , then the feature set generated by $\left\{ \prod x_1^{a_1} \cdot x_2^{a_2} \ldots \cdot x_n^{a_n}| \sum a_i = N \right\}$ will work if N is sufficiently large. If there are M data points then $N = M+1$ will work,albeit be way, way, way, too large. Because even in one variable we can find a polynomial of degree M vanishing at N points. So if we have polynomials $F_1, \ldots F_k$ which separate the first $L<N$ points , then we can find a polynomial, of degree N which vanishes at $x_1 \ldots x_L$ but not at $x_{L+1}$ . Call that $F_{k+1}$, then one of $+/- F_{k+1}$ will separate the first $L+1$ points.