Controlling and optimizing a large number of correlated and convoluted process parameters during processing, and subsequent data analysis is time consuming if executed in an empirical fashion, and may not arrive at the optimum conditions. In this work, we investigated the influence of the small thickness variations and swelling degrees on the final morphology of the BCP patterns and how to optimize these SVA parameters for fabrication of devices. A full factorial experimental design was used to probe the SVA parameter space, and a figure of merit was formulated to evaluate the quality of the resultant BCP nanopatterns, accounting for multiple length scales and the requirements of bit patterned media. Machine learning was then utilized to fit the SVA parameter space and identify the optimal annealing conditions with respect to the figure of merit. This approach is generalizable to optimize, analyze, and arrive at predictions of defect densities for different combinations of materials and processes for device fabrication. This combination of techniques may be applied to any combination of materials and processes to optimize, analyse, predict, and minimize the defect densities in any given pattern.