> For the complete documentation index, see [llms.txt](https://baozoulin.gitbook.io/neural-networks-and-deep-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://baozoulin.gitbook.io/neural-networks-and-deep-learning/di-san-men-ke-jie-gou-hua-ji-qi-xue-xi-xiang-mu-structuring-machine-learning-projects/di-san-men-ke-structuring-machine-learning-projects/ml-strategy/26-ding-wei-shu-ju-bu-pi-pei-ff08-addressing-data-mismatch.md).

# 2.6 定位数据不匹配（Addressing data mismatch）

解决train set与dev/test set样本分布不一致的两条建议：

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/019a324b983247e11da7ad373426b756.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/019a324b983247e11da7ad373426b756.png)

为了让训练数据更接近开发集，可以人工合成数据（**artificial data synthesis**）。例如说话人识别问题，实际应用场合（dev/test set）是包含背景噪声的，而训练样本train set很可能没有背景噪声。为了让train set与dev/test set分布一致，可以在train set上人工添加背景噪声，合成类似实际场景的声音。这样会让模型训练的效果更准确。但是不能给每段语音都增加同一段背景噪声，会出现对背景噪音过拟合，这就是人工数据合成需要注意的地方

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/e8e1e932abb7a0bb44cab6403657321d.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/e8e1e932abb7a0bb44cab6403657321d.png)

研发无人驾驶汽车，用计算机合成图像

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/cfd503f877d21d96821a81293ab0fdeb.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/cfd503f877d21d96821a81293ab0fdeb.png)

如果只合成这些车中很小的子集，学习算法可能会对合成的这一个小子集过拟合

![](/files/-Le0cnnW3HjLTFU0tVfT)
