Machine learning models for predicting good machine settings given bad machine settings I’ve a dataset about a machine that produces a product. Salient features about the dataset:

•   For each data point, some of the features are machine settings (calibration factor, grind time, pressure, water temperature) used to make the product, while few others are stochastic and external in nature, such as water hardness.

•   Output says whether the product produced was of good or bad quality. 

Goal:

•   When I’ve a new data point which says that the product was of bad quality, I want to feed in the corresponding features(machine settings + stochastic external features) to an ML model and predict machine settings which will lead to good quality product. Idea is to have an ML based smart controller which would adjust the machine settings to reduce faulty products being produced.

Which ML models would suit this purpose?
Can you explain the problem more precisely? What are inputs (besides control settings), is output same if the inputs are fixed? Are there any stochastic variables(external factors prone to probabilistic behaviour), what is the desired outcome?( Minimizing faulty outcome by choosing a setting or something similar)