# Would it be possible to generate data from real data in medical research?

We are trying to develop some predictive models in medical research. We have combination of clinical and RNA-seq data just for 40 patients. The problem is classification. After feature selection, we have generated data from the real data and then added the synthetic data to real data for analysis. The result got better. We also checked the density of synthetic data compare to the real data (see attach). It seems good. Are we in correct way? Is generating data in this case a correct way? If yes, should we generate data after feature selection or before that?

• "After feature selection, we have generated data from the real data and then added the synthetic data to real data for analysis." I have no idea what that means. Commented Jul 25 at 18:20

No, this is not good practice.

"Oversampling" the data you have makes your model believe it has more real data than it actually has, and makes it underestimate the probability of actual data outside the space it has seen.

If you have seen 40 white swans and now see a single black swan, you will be moderately surprised. If you have seen 40,000 white swans and now see a single black swan, you will have been much more certain that only white swans exist and that black swans are impossible. So don't just copy pictures of those 40 white swans a thousand times each and present them to your model, pretending these are actual independent data.

Data augmentation can go badly wrong, and should be done with great care. If you only have little data, then your conclusions will be tentative, and there is simply no way around this.

• I agree. If anything, I would put it even more strongly. "Don't do this." Commented Jul 24 at 11:43
• Can you give any examples of 'good' data augmentation? It seems to me that data augmentation, at some level, assumes you already know the correct prediction for what you are trying to predict. In other words, if you know how to generate data that looks like reality, you must have already predicted it. Commented Jul 25 at 16:40
• @JimmyJames: that is exactly my impression. And no, I would not be able to point to "good" examples of data augmentation. That part about "done with great care" was, to be honest, a bit of CYA on my part. There is so much data augmentation going on out there that some of it might have a point. Commented Jul 25 at 18:37
• @StephanKolassa Thanks. Sort of tangential but your argument reminded me of the dog example in this article: techcrunch.com/2024/07/24/… Commented Jul 25 at 19:42
• Wrt the "pretending actual independent data": we typically have repeated measurements per patient (e.g. taken from slightly different positions), so we anyways need to take care of effective sample size. And we've learned our lessons (at least the better groups in the field have) about what constitutes independent training and test sets in such situations as well... Commented Jul 25 at 22:29