Combing science model with data-driven models

In tablet example, how can we introduce the causal relation (why defects are happening with the the manufacturing process) and combine it with what is the right data to be measured