In the present work, ten data mining algorithms have been used to generate models capable of predicting the surface roughness of parts printed on polylactic acid (PLA) by using fused deposition modeling (FDM). The models have been trained using experimental data measured on 27 horizontal (XY) and 27 vertical (XZ) specimens, printed using different values for the parameters studied (layer height, extrusion temperature, print speed, print acceleration and flow). The models generated by multilayer perceptron (MLP) and logistic model trees (LMT) have obtained the best results in a cross-validation. Although it does not obtain such optimal results, the J48 algorithm (C4.5) allows the generation of models in the form of a decision tree. These trees permit to determine which print parameters have an influence on the surface roughness. For XY specimens, the surface roughness measured in the direction parallel to the extrusion path (Ra,0,XY ) depends on the flow, the print temperature and the layer height; in the direction perpendicular to the extrusion path, the surface roughness (Ra,90,XY) depends only on the flow. For XZ specimens, the surface roughness measured in the direction parallel to the extrusion path (Ra,0,XZ) depends only on the print speed; in the direction perpendicular to the extrusion path (Ra,90,XZ), it depends on the layer height and the extrusion temperature. According to the study carried out, the most suitable set up provides values of Ra,0,XY, Ra,90,XY, Ra,0,XZ and Ra,90,XZ equal to 0.46, 1.18, 0.45 and 11.54, respectively. A practical application of this work is the manufacture of PLA frame glasses using FDM.