A suitable pH environment is one of the most important conditions for the survival of bacteria. The determination results of the optimal pH value for bacteria can help researchers prepare appropriate culture media and provide a favorable growth environment for bacteria. The traditional experimental determination methods are extremely labor-intensive, material-consuming and time-consuming. Moreover, the culture media for most bacteria are unknown, that is, they cannot be cultivated. Therefore, a new approach needs to be explored. Machine learning has been a preferred alternative to experimental methods in recent years. Based on the increasingly expanding high-throughput sequencing data and existing experimental measurement data, using machine learning technology to construct appropriate prediction models can serve as a supplementary method for determining the optimal pH value for bacterial growth. This not only resolves the limitations of experiments but also promotes the utilization of massive data resources. It also provides a good reference for predicting and alleviating the severe imbalance between sequencing rates and experimentally measured rates in the environmental preferences of other bacteria.