The dimensions of material extrusion 3D printing filaments play a pivotal role in determining processing resolution and efficiency and are influenced by processing parameters. This study focuses on four key process parameters, namely, nozzle diameter, nondimensional nozzle height, extrusion pressure, and printing speed. The design of experiment was carried out to determine the impact of various factors and interaction effects on filament width and height through variance analysis. Five machine learning models (support vector regression, backpropagation neural network, decision tree, random forest, and K-nearest neighbor) were built to predict the geometric dimension of filaments. The models exhibited good predictive performance. The coefficients of determination of the backpropagation neural network model for predicting line width and line height were 0.9025 and 0.9604, respectively. The effect of various process parameters on the geometric morphology based on the established prediction model was also studied. The order of influence on line width and height, ranked from highest to lowest, was as follows: nozzle diameter, printing speed, extrusion pressure, and nondimensional nozzle height. Different nondimensional nozzle height settings may cause the extruded material to be stretched or squeezed. The material being in a stretched state leads to a thin filament, and the regularity of processing parameters on the geometric size is not strong. Meanwhile, the nozzle diameter exhibits a significant impact on dimensions when the material is in a squeezing state. Thus, this study can be used to predict the size of printing filament structures, guide the selection of printing parameters, and determine the size of 3D printing layers.