Shunt surgery is the main treatment modality for hydrocephalus, the leading cause of brain surgery in children. The efficacy of shunt surgery, particularly in infant hydrocephalus, continues to present serious challenges in achieving improved outcomes. The crucial role of correct adjustments of valve performance levels in shunt outcomes has been underscored. However, there are discrepancies in the performance levels of valves from different companies. This study aims to address this concern by optimizing both the number and range of valve performance levels for infant hydrocephalus, aiming for improved shunt surgery outcomes. We conducted a single-center cohort study encompassing infant hydrocephalus cases that underwent initial shunt surgery without subsequent failure or unimproved outcomes. An unsupervised hierarchical machine learning method was utilized for clustering and reporting the valve drainage pressure values for all patients within each identified cluster. The optimal number of clusters corresponds to the number of valve performance levels, with the valve drainage pressure ranges within each cluster indicating the pressure range for each performance level. Comparisons based on the Silhouette coefficient between 3-7 clusters revealed that this coefficient for the 4-cluster (4-performance level) was at least 28.3% higher than that of other cluster formations in terms of intra-cluster similarity. The Davies-Bouldin index for the 4-performance level was at least 37.2% lower than that of other configurations in terms of inter-cluster dissimilarity. Cluster stability, indicated by a Jaccard index of 71% for the 4-performance level valve, validated the robustness, reliability, and repeatability of our findings. Our suggested optimized drainage pressure ranges for each performance level (1.5–5.0, 5.0–9.0, 9.0–15.0, and 15.0–18.0 cm H2O) may potentially assist neurosurgeons in improving clinical outcomes for patients with shunted infantile hydrocephalus.