p-Type transparent conducting materials (p-TCMs) are important components of optoelectronic devices including solar cells, photodetectors, displays, and flexible sensors. Cu-Zn-S thin films prepared by chemical bath deposition (CBD) can have both high transparency in the visible range (>80%) as well as excellent hole conductivity (>1000 S cm-1). However, the interplay between the deposition parameters in the CBD process (metal and sulfur precursor concentrations, temperature, pH, complexing agents, etc.) creates a multidimensional parameter space such that optimization for a specific application is challenging and time-consuming. Here we show that strategic design of experiment combined with machine learning (ML) allows for the efficient optimization of p-TCM performance. The approach is guided by a figure of merit (FOM) calculated from the film conductivity and optical transmission in the desired spectral range. A specific example is shown using two steps of optimization using a selected subset of four experimental CBD factors. The ML model is based on support vector regression employing a radial basis function as the kernel function. 10-fold cross-validation was performed to mitigate overfitting. After the first round of optimization, predicted areas in the parameter space with maximal FOMs were selected for a second round of optimization. Films with optimal FOMs were incorporated into heterojunction solar cells and transparent photodiodes. The optimization approach shown here will be generally applicable to any materials synthesis process with multiple parameters.