# 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)

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

![](https://2314428465-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Le0cHhI0S0DK8pwlrmD%2F-Le0cKOp1vaxoORIi4ak%2F-Le0cnnW3HjLTFU0tVfT%2F380import.png?generation=1556953139846790\&alt=media)
