Take this question with many grains of salt, because it's mostly a theoretical curiosity.
I've built a multinomial classifier using GLMnet. The problem is that some of of my input variables have an uneven distribution set values, and the dataset is quite small (around 210 observations). So when I'm building a sparse matrix with these factored variables, the (stochastically partitioned) holdout set will inevitably have fewer columns than the training set, as some factors are not represented. My solution for now has been to make the holdout set quite large (40-50% of all the data), but this seems suboptimal.
I thought one solution to this would be to duplicate every element of the dataset, which would eliminate the problem of non-representation without affecting the relative weights of data points.
However, this didn't seem to work. I still had issues with categorical values not being represented! I will eventually have access to more data for this problem, but I was just wondering a) why this didn't seem to "fool" the sparse matrices, and b) whether this is a permissible thing to do in general.