Shale gas production prediction and horizontal well parameter optimization are significant for shale gas development. However, conventional reservoir numerical simulation requires extensive resources in terms of labor, time, and computations, and so the optimization problem still remains a challenge. Therefore, we propose, for the first time, a new gas production prediction methodology based on Gaussian Process Regression (GPR) and Convolution Neural Network (CNN) to complement the numerical simulation model and achieve rapid optimization. Specifically, through sensitivity analysis, porosity, permeability, fracture half-length, and horizontal well length were selected as influencing factors. Second, the n-factorial experimental design was applied to design the initial experiment and the dataset was constructed by combining the simulation results with the case parameters. Subsequently, the gas production model was built by GPR, CNN, and SVM based on the dataset. Finally, the optimal model was combined with the optimization algorithm to maximize the Net Present Value (NPV) and obtain the optimal fracture half-length and horizontal well length. Experimental results demonstrated the GPR model had prominent modeling capabilities compared with CNN and Support Vector Machine (SVM) and achieved the satisfactory prediction performance. The fracture half-length and well length optimized by the GPR model and reservoir numerical simulation model converged to almost the same values. Compared with the field reference case, the optimized NPV increased by US$ 7.43 million. Additionally, the time required to optimize the GPR model was 1/720 of that of numerical simulation. This work enriches the knowledge of shale gas development technology and lays the foundation for realizing the scale-benefit development for shale gas, so as to realize the integration of geological engineering.