1 Introduction

The manufacturing process has to enrich its capability to meet the demand that arises due to the increasing population and preferences of individuals. The intricate, dynamic, and chaotic behaviours impose constraints on the manufacturing system [1], and hence, the manufacturing of high-quality products in a fruitful way with the available resources is essential. One of the important objectives is manufacturing the product at the lowest possible cost [2].

The global landscape of manufacturing gives away a lot of challenges that require strategic planning and innovative solutions. These challenges admit the fostering of advanced manufacturing technology to enrich efficiency and competitiveness. They also admit the increasing consequences of manufacturing high-value order products to meet growing market needs and that it is essential to force advanced knowledge, information management, and artificial intelligence systems for sustainability growth [3]. Sustainable manufacturing practices and products are highly important in meeting environmental interests and assuring long-term viability. Moreover, the agility and adaptability of enterprise capabilities and supply chains are essential for implementing driving market conditions [4].

Innovation in products, services, and processes is a motivational force for keeping ahead in a competitive market while nurturing tight collaboration between industry and research that advances the implementation of modern techniques and encourages continuous improvement. Taking up a new manufacturing blueprint is highly needed for steering the difficulties of the modern industrial landscape and attaining sustainable progress in a fast-growing global economy [5].

The traditional manufacturing system finds it difficult to face the presumptions of the contemporary industry. This is due to the inherent limits of the traditional system for manufacturing complex parts. The elegant design and intricate geometry of modern products exceed the proficiency of traditional manufacturing processes in the situation [6, 7]. Additive manufacturing rises to be a game-changing scenario for this mystery. Additive manufacturing gives extraordinary adaptability and precision in manufacturing the components that were not possible or challenging through the traditional processes. This is done by stacking the material to build up the parts based on digital design [8].

This technology transforms the manufacturing of complicated components in all industries by not only controlling the limitations of traditional manufacturing but also generating new opportunities for producing customized components and on-demand production. With the development of additive manufacturing, manufacturing capabilities are stepping into a new age by noticeable creativity and competency rather than complexity acting as a hurdle [9].

Additive manufacturing manufactures 3D objects from digital blueprints by layer-by-layer deposition. Fused Deposition Modeling (FDM) is one of the most affordable and commonly available techniques among all the additive manufacturing processes. The materials that are primarily used are metals, powders, polymers, and resin to manufacture intricate components. Fused Deposition Modeling makes use of thermoplastic and thermoelastic materials [10,11,12]. To easily manufacture prototypes and complex functional components at a faster rate, FDM is a convenient and economical way. It is the best choice for small-scale industries, educational institutes, and researchers. FDM is highly useful for investigating the possibilities of additive manufacturing. The installation of this facility requires a low investment with minimal material waste, ease of use, and simple setup [13,14,15]. FDM is a valuable technique in the field of additive manufacturing, because it ensures a good level of adaptability and reliability despite its affordability. It finds a wide range of applications across sectors [16, 17].

There are numerous process parameters in the FDM process, and the complex relation between the parameters strongly influences the quality and functionality of the component. The temperature of filament extrusion, speed of deposition, layer height, and infill density play an important role in getting the final products [18, 19]. The overall quality and consistency of the printed products are also governed by ambient temperature and humidity. Calibration of bed levelling and the distance between the nozzle and the bed will have an equal influence; a thorough knowledge of the FDM process and the ability to meticulously balance these many variables to steer this complex set of parameters are needed to avail the final product [20, 21]. FDM users can fully understand the potential of this process by carefully adopting and optimizing these parameters, resulting in the manufacturing of high-quality, functional parts that meet the requirements of several industries and applications [22, 23]. Hence, an understanding of these process parameters is highly required to move towards successful manufacturing.

Traditional modelling approaches are often challenged by the intricate interconnections between the abundance of parameters connected in FDM printing and the end product’s attributes. The complex and non-linear nature of these interconnections provides a major hurdle for manufacturers trying to sleek their operations and reliably create high-quality parts. However, the development of machine learning algorithms provides a thorough way out of this conundrum. These enlightened algorithms can highly apprehend the complex interconnections between the different printing process parameters, material attributes, and the intended results by employing the power of data-driven learning.

Machine learning models are capable of revealing patterns and intuitions that would be challenging to identify with the conventional mathematical relations by looking over large datasets. This creates new possibilities for additive manufacturing in terms of consistency, quality, and efficiency by permitting businesses to fine-tune their FDM processes with previously unprecedented accuracy. Machine learning is a rapidly evolving area, and its combination with additive manufacturing has a huge prospective to help industries shoot the limits of 3D printing and hammer out the complexity of this ever-changing environment. Most of the research works are available in the development of various machine learning models for predicting the property. However, not many more works have been presented to understand the effect of different hyperparameter optimization techniques on improving the metrics for better prediction. Hence, an initiative is taken through this research work to develop a machine learning model considering GridSearchCV and Optuna hyperparameter optimization techniques to understand the behaviour of process parameters and predict the compression strength of additive-manufactured specimens.

2 Machine learning in manufacturing

The industrial sector is moving through a revolutionary period as n outcome of the advent of the digital age, and the implementation of machine learning algorithms is now crucial to growth and innovations.

These enlightened computational tools have become the genius of the modern shop floor, setting a euphonious interplay between process optimization, quality control, and predictive maintenance, much like a harmony of data and algorithms. The flexibility of machine learning has become a motivational force in the stalking of manufacturing greatness, from the accuracy of supervised learning models in foreseeing product attributes to the investigational ability of unsupervised models in disclosing concealed patterns [24, 25].

The manufacturing, testing, and adaptability of the machining learning process are shown in Fig. 1. These data-driven algorithms have materialized as the industry’s ambit, opening new routes to effectiveness, agility, and resilience as they thrash out the challenges of untamed international competitiveness and constantly modulate consumer demands. In this new area, the possibilities are infinite, and the products of the future will be manufactured with the accuracy and perception that only machine learning can provide. This has been made possible by the unification of human knowledge and machine intelligence [26, 27].

Fig. 1
figure 1

Flow of manufacturing, testing, and machine learning

Machine learning algorithms are mainly clustered into linear and non-linear algorithms. The foundation of linear algorithms is the assumption that there is a linear relationship between the input features and goal variables. To make smoother, simpler explication and forecasting, these algorithms search for identifying the linear function that best meets the data. Non-linear algorithms do not make the presumption of a linear relationship between the input features and the goal variable. The data can have more complicated, non-linear patterns modelled by these methods.

ML models are capable of carrying out operations, including dimensionality reduction, grouping, regression, and classification [28, 29]. In this research work, linear regression, a well-established technique from the linear models category, has been used to assist as a baseline for prediction. In addition, we employed a variety of non-linear models, such as support vector machines (SVM), XGBoost, decision trees, random forests, and AdaBoost, to capture the potentially intricate relationships between the influencing factors and the compression behaviour of additively manufactured PLA material.

2.1 Linear regression

Linear regression is a fundamental statistical method used in machine learning and data science to predict a continuous outcome variable based on one or more predictor variables. It gets its name as it assumes a linear relationship between the input variables and the single output variable. It mathematically models the unknown or dependent variable and the known or independent variable as a linear equation. Linear regression models are relatively simple and provide an easy-to-interpret mathematical formula to generate predictions. Linear regression is an established statistical technique that is easily applied to software and computing. Many fields, including biology and the behavioural, environmental, and social sciences, employ linear regression to conduct preliminary data analysis and predict future trends. Many data science methods, such as machine learning and artificial intelligence, use linear regression to solve complex problems [30].

2.2 Support vector regression (SVR)

Support Vector Regression (SVR) is a type of Support Vector Machine (SVM) that is used for regression problems. Unlike linear regression, which aims to minimize the error between predicted and actual values, SVR aims to find a function that deviates from the actual observed values by a value no greater than a specified margin. SVR uses the concept of a hyperplane and margin, but their definitions are different. In SVR, the margin is defined as the error tolerance of the model, which is also called the ε-insensitive tube. This tube allows some deviation of the data points from the hyperplane without being counted as errors. The hyperplane is the best fit possible to the data that fall within the ϵ-insensitive tube. SVR can be mathematically formulated as a convex optimization problem. The objective of the problem is to find a function f(x) that is as flat as possible while having a maximum deviation of ε from the actual targets for all the training data. The flatness of the function implies that it is less sensitive to small changes in the input data, which reduces the risk of overfitting [31].

2.3 Decision tree (DT)

A decision tree is a non-parametric supervised learning algorithm which is utilized for both classification and regression tasks. It has a hierarchical tree structure, which consists of a root node, branches, internal nodes, and leaf nodes. Decision tree learning employs a divide-and-conquer strategy by conducting a greedy search to identify the optimal split points within a tree. This process of splitting is then repeated in a top–down, recursive manner until all or the majority of records have been classified under specific class labels. Pruning techniques in decision trees are essential to enhance the model’s generalization capability and prevent overfitting, which occurs when the tree captures noise in the training data rather than the underlying patterns. Pruning can be categorized into two main types: pre-pruning and post-pruning. Pre-pruning, also known as early stopping, involves halting the tree growth at an early stage by setting conditions, such as a maximum tree depth, a minimum number of samples required to split a node, or a minimum number of samples required to be at a leaf node. By imposing these constraints, pre-pruning reduces the complexity of the model and thus mitigates overfitting. Post-pruning, on the other hand, allows the tree to grow to its full depth and then removes nodes that contribute little to the predictive power of the model. This is done by evaluating the impact of removing certain branches on the model’s performance, typically using metrics like cost complexity pruning. Post-pruning techniques include reduced error pruning, which removes nodes if their absence does not reduce model accuracy on a validation set, and cost complexity pruning, which prunes the tree by considering a trade-off between the complexity of the tree and its fit to the data. Both pre-pruning and post-pruning aim to create a balance between model complexity and predictive accuracy, ensuring the decision tree remains interpretable while effectively generalizing to unseen data [32].

2.4 XGBoost

XGBoost (eXtreme Gradient Boosting) is an advanced implementation of the gradient-boosting machine learning algorithm designed for speed and performance. Developed by Tianqi Chen, XGBoost provides an efficient and scalable framework for tree boosting, which is particularly powerful for structured/tabular data [33]. The algorithm uses an ensemble of decision trees to improve predictive accuracy through iterative boosting, where each new tree corrects errors made by the previous ones. Key features of XGBoost include parallelization for faster computation, handling of missing values, and regularization techniques to prevent overfitting. Its ability to manage large datasets and support custom optimization objectives and evaluation criteria makes XGBoost a preferred choice for many data scientists and machine learning practitioners [34].

2.5 AdaBoost

AdaBoost, short for Adaptive Boosting, is an ensemble learning algorithm that combines multiple weak classifiers to form a strong classifier. Developed by Yoav Freund and Robert Schapire in 1996, AdaBoost works by sequentially training weak learners, typically decision trees with a single split (decision stumps), on the weighted versions of the dataset [35]. After each iteration, the algorithm adjusts the weights of incorrectly classified instances, increasing their importance in the next round. This process helps subsequent classifiers focus on the harder-to-classify instances. AdaBoost’s ability to improve the performance of weak learners while maintaining simplicity and interpretability has made it a widely used technique in machine learning. However, it is sensitive to noisy data and outliers, which can significantly affect its performance.

2.6 CatBoost

CatBoost (Categorical Boosting) is a gradient-boosting algorithm specifically designed to handle categorical features effectively. Developed by Yandex, CatBoost aims to provide high performance and ease of use, particularly for datasets with a significant number of categorical variables [36]. Unlike traditional gradient-boosting algorithms, which require extensive preprocessing of categorical data, CatBoost automatically processes categorical features during training, thereby reducing the need for manual feature engineering. This is achieved through techniques like target-based statistics and efficient handling of categorical splits. CatBoost also includes features like ordered boosting, which mitigates overfitting and is known for its robustness and speed [37]. Its ability to handle categorical data without extensive preprocessing makes it particularly valuable for tasks involving tabular data with mixed types of features.

3 Materials and methods

PLA is utilized in a wide range of 3D printing applications, including medical equipment, food packaging, injection moulding, and general prototyping. Its biodegradability and biocompatibility make it ideal for applications such as implanted devices.

PLA has been sourced from WOL 3D. It has been used for several small- and large-scale applications based on its specific strength. The prediction of the compression strength of PLA will further enhance its usage in different fields. Some of the special applications of PLA where its compressive behaviour plays a vital role are brackets, load bearings members, partitions, non-load-bearing walls, and interior wall panels. It is also used in a scale to hold the medicine in plants during healing.

The most popular type of additive manufacturing (AM) is material extrusion, and the most popular method of this type of AM is desktop-scale thermally driven fused deposition modelling [38]. A variety of process parameters are crucial in explicating the quality and attributes of additively manufactured components using fused deposition modelling (FDM).

In this research work, PLA has been chosen as the candidate material. ASTM D695 has been used to fabricate samples with the dimensions of 15 × 10 × 5 mm [39, 40]. The samples were fabricated using the PRATHAM 3.0 (India), a multi-purpose 3D printer. It comes with a silicon pre-heated build plate, which lowers the model warpage during manufacture. The machine can produce complex geometries fast and components up to 300 mm × 300 mm × 300 mm in size. The Fabrication of Samples in the FDM Printer is shown in Fig. 2. UltiMaker Cura 5.8 slicing engine has been used for slicing.

Fig. 2
figure 2

Fabrication of samples in FDM printer

3.1 Process parameters

These parameters include machine settings as well as printing parameters. Nozzle temperature, bed temperature, and diameter of the nozzle are coming under the machine settings category. Layer thickness, raster angle, infill %, build orientation, and printing speed are coming under the printing parameters category. Material composition, extrusion speed, and temperature are material (filament) features that will have a noteworthy influence on the printing outcomes. Part quality, mechanical characteristics, dimensional accuracy, surface finish, productivity, and energy efficiency will be critically impacted by these complex relations. To have high quality and efficiency in FDM 3D printing processes, this complex seat of process parameters has to be optimized successfully.

Among the large process parameters, infill, infill pattern, raster orientation, and layer thickness have an extensive impact on 3D printing results. Figure 3 illustrates the selected process parameters, and Table 1 shows the variations of levels in the process parameters.

Fig. 3
figure 3

Selected process parameters

Table 1 Process parameters and their variations

Further, these parameters will have a noteworthy impact on the final product’s strength, durability, weight, material usage, print time, cost, finish, and printability. Understanding and adjusting these process parameters require attention to manufacturing high-quality, efficient, and cost-effective components. This research work highlights the complicated relations between these parameters and their effects on the compressive strength of the printed parts and notes the significance of rigorous process parameter management and optimization.

3.2 Evaluation of compressive strength

The printed samples have been subjected to compressive tests. The test was conducted in the Tinus Olsen Universal Testing Machine that can test the materials with a 50 kN load cell connected with a data acquisition system to get real-time data and store it. The strain rate has been maintained at 0.5 mm/min. The testing of additive-manufactured PLA and the overall methodology followed in the research are shown in Figs. 4 and 5, respectively.

Fig. 4
figure 4

Testing of additive-manufactured PLA

Fig. 5
figure 5

Methodology of research work

4 Results and discussion

In this research work, additive manufacturing of PLA compressive specimens was printed using the FDM technique. Infill, Infill pattern, layer height and Raster Orientation have been varied during the printing of the specimens. Linear Regression, Support Vector Regression, Adaboost, XGBoost, CatBoost, and Decision tree machine learning models have been employed to understand the relationship between the process parameters and predicting the ultimate compressive stress. Python code has been developed to predict the performance metrics without hyperparameter optimization. GridSearchCV and Optuna optimization techniques were used to predict performance metrics individually. The measured compressive strength of different process parameter combinations is shown in Table 2.

Table 2 Compressive strength of different process parameter combinations

4.1 Effect of input parameters on compressive strength

The box plots (Fig. 6) reveal that most of the data points and the median for compressive strength are situated higher at 0.1 mm layer height as conflicting with 0.2 mm and 0.3 mm layer heights. This indicates that when the material is printed with 0.1 mm layer height, it has a higher compressive strength. The reason for notifying the higher compressive strength is that a stronger bonding could have been formed between the layers, which might have fused and yielded the higher compressive strength. This will result in good load-bearing capacity when subject to compressive loading. When the layer thickness (0.2 and 0.3 mm) is increased, the bonding between the layers may not be as good as the one printed with the lower thickness (0.1 mm), which could be the reason for the decreased compressive strength. Overall, the infill density height has a positive correlation with compressive, and the Raster orientation does not have any effect on Compressive strength. Among the Line, cubic and TriHexagonal infill Patterns, the compressive strength is higher for TriHexagonal followed by cubic and lines.

Fig. 6
figure 6

Effect of input parameters—Box plots

Figure 7 presents the pair plots of the effect of input parameters on compressive strength. Infill density, layer height, infill pattern, and raster orientation are all important aspects in determining the ultimate stress or strength of 3D printed items. They play a crucial role in determining the compressive strength of printed components. Infill density has the greatest apparent outcome, with higher infill ensuing in greater strength amongst all other parameter combinations. The influences of layer height, infill pattern, and raster orientation are more complicated and interrelated. Increasing layer height can somewhat reduce strength for some infill patterns, such as linear lines, most likely due to weaker bonding between thicker layers.

Fig. 7
figure 7

Effect of input parameters—pair plots

Nevertheless, more sophisticated infill patterns, such as TriHexagonal, show less fluctuation in strength across layer height. The infill pattern is a significant effect, with TriHexagonal typically surpassing linear infill in terms of ultimate stress. Raster orientation also has an effect, with 0 and 90 degree orientations yielding stronger linear infill than 45 degrees. However, the TriHexagonal pattern is less affected by the raster angle. Overall, optimizing the combination of these 3D printing settings is critical for increasing the strength and performance of the finished part.

4.2 Hyperparameter optimization of GridSearchCV and Optuna

Table 3 shows the best hyperparameter optimization parameters for GridSearchCV and Optuna. The best parameter for both the optimization of the decision tree algorithm indicates that the model is performing well when the maximum depth is limited to 4 levels. When we go deeper, it will lead to overfitting, while shallow depth will lead to underfitting.

Table 3 Best parameters (GridSearchCV and Optuna)

In support vector regression (SVR), C is the parameter that controls the regularization strength. Here, the value of C is 10 for GridSearchCV optimization, which seems to be higher, indicating that the model should prioritize fitting the training data closely. Epsilon indicates the width of the epsilon tube, and the lower value indicates the narrow width of the tube and reflects the cause indicated by the C parameter. Optuna discovered somewhat different values for C and epsilon than GridSearchCV did, suggesting that even tiny changes to these hyperparameters could have an impact on the model's performance.

The learning rate controls the contribution of each model to the final combination. More aggressive boosting is the outcome of a higher learning rate, whereas more conservative boosting is the result of a lower learning rate. The number of weak learners (base models) to be trained successively is determined by the number of estimators (n_estimators). An excess of estimators may cause overfitting, whilst an insufficient number could cause underfitting. Optuna discovered various values for the learning rate and the number of estimators, indicating that it looked into a different hyperparameter space and discovered a different setup that reduced the objective function.

XGBoost has settings for learning rate and number of estimators, just like AdaBoost. To prevent overfitting, the learning rate is moderated, and the maximum depth of the trees is set to 3. This indicates a relatively shallow tree structure. In contrast to GridSearchCV, Optuna.

identified a different set of hyperparameters, suggesting that it may have searched a larger area and found a setup that more successfully minimized the objective function.

The parameters of CatBoost are learning rate, depth, and number of iterations. Like max_depth in other models, depth regulates the trees’ depth. During the optimization process, the step size is governed by the learning rate. In comparison to GridSearchCV, Optuna discovered distinct values for depth, l2_leaf_reg, border_count, learning rate, and iterations, indicating a more thorough examination of the hyperparameter space.

Figure 8 shows MSE and R2 values of Training for each model with and without Optimization. When compared to running multiple models without optimization, optimization approaches like GridSearchCV and Optuna have demonstrated considerable gains in the performance metrics (MSE and R2 Score).

Fig. 8
figure 8

MSE and R2 values of training for each model with and without optimization

Linear Regression was not subjected to optimization approaches. The performance of linear regression is consistent with both the test and train datasets. It is understood from the Figure that a lower MSE and a marginally higher R2 score suggest that Optuna optimization outperforms GridSearchCV optimization for Decision Tree performance on the test dataset.

With continuously high MSE and low R2 scores across all optimization techniques, SVR performs poorly when compared to other models. Moreover, optimization techniques do not significantly enhance SVR’s performance, suggesting that SVR may not be the best option for this dataset. Compared to GridSearchCV, AdaBoost performs better when using optimization techniques, especially with Optuna, where it obtains lower MSE and higher R2 scores. This suggests that AdaBoost’s performance can be improved by tweaking the hyperparameter. Among all the models, CatBoost performs the best, gaining the lowest MSE and the greatest R2 scores using both Optuna and GridSearchCV optimization techniques.

This indicates that CatBoost performs excellently for this dataset, and optimization techniques, particularly with Optuna, meaningly progress its performance. The reason for CatBoost’s higher performance is its resistance to overfitting, ability to accomplish the missing information, and backing up regularization strategies.

Furthermore, these model-boosting algorithms iteratively enhance performance by concentrating on hard-to-predict cases. For all optimization situations, CatBoost performs marginally better than XGBoost in terms of MSE and R2 score, making it the optimal model choice for this dataset. Because CatBoost has better predictive performance and model fit than the other options, it would be the recommended model selection for this problem based on the results that have been supplied.

Figure 9 shows the comparison of MSE with respect to the test and train data to understand the performance. It is seen that the MSE of test data for all the model’s test data without optimization seems to be higher, which indicates that all the model behaviours are worse on the unseen data. However, the value of MSE is consistent for all the train data models, which indicates that there is no considerable overfitting or underfitting. The MSE value of Optuna-optimized models is lower when compared with the non-optimized counterparts on dates that the performance has been increased.

Fig. 9
figure 9

MSE comparison for training and unseen data

Since the MSE value of train data is lower when compared with non-optimized values, it states that the train data have flitted well when optimizing with Optuna. The GridSearchCV optimization has yielded lower MSEs like Optuna for the test data compared to non-optimized models. The values of training data MSE are comparable between the Optuna and GridSearchCV. The train data have been fitted to similar models.

Figure 10 shows the R2 values of train and test data without optimization and with optimization. When we compare the R2 values of all the models without optimization, the optimized model is high.

Fig. 10
figure 10

R2 comparison for training and unseen data

This indicates that the model experiences a portion of the variance of test data without optimization. However, the value of R2 of the train data is consistent with the test data, confirming that there is either no underfitting or overfitting. The R2 values of the Optuna-optimized models with a counterpart of non-optimized significantly higher indicates the Optuna-optimized models improved the performance of the models significantly on unseen data. The R2 values for the train data are also slightly greater than the non-optimized models. This states that the Optuna optimization better fits the train data than the non-optimized models. The R2 values of the GridSearchCV optimized models with a counterpart of non-optimized were significantly higher, similar to Optuna on unseen data that compared the results without optimization. However, the performance of the GridSearchCV is slightly worse than the Optuna optimization.

The residual plot (Fig. 11.) shows the distribution of the predicted values for different models. It is visible from the plot that the values for the linear regression model are scattered around the actual values. The predicted values are sometimes closer to the actual values. This denotes that the model has made efforts to understand the relation between the process variables, but it is ineffective. The decision tree model also has a similar trend, but the predicted values are much closer than the linear regression model. This shows that both models need to be improved to attain even better results. The SVR is a poor-performing model. The plot shows that values are distributed at both extremes. This proves that the model has made no effort to understand the relationship between the process variables. Hence, the SVR model will not be suitable for the prescribed task with a given set of values. The ensemble models (AdaBoost, XGBoost, and CatBoost) have really performed well with the given set of values, as seen from the plot. The AdaBoost and XGBoost models have predicted the values closer to actual values but are scattered. Hence, these models need to be improved further to obtain better results. In the case of the CatBoost model, the predicted values are too close to actual values, which is good. However, in a few cases, the predicted and actual values are the same, which means that the values are overfitting. Hence, optimization techniques are needed to solve this.

Fig. 11
figure 11

Residual plot without optimization

Figure 12 shows that improvements in several models were made with Optuna optimization shows. The improvisation is visible from the plot, and the predicted values are closer to actual values than the previous case. Improvisation is seen even in the decision tree model, but the predicted values are not closer to the actual values. In the case of the SVR model, the Optuna optimization does not affect the results. The predicted values are scattered in a common pattern ranging from maximum to minimum. This proves that the SVR model is not suitable for the current task. The use of Optuna optimizer has also made no change in the results. Meanwhile, the ensemble models, AdaBoost, XGBoost, and CatBoost, have significantly improved their results. CatBoost is the best-performing model, as can be seen from the plot. The predicted values are closer to actual values, which indicates that the model has learned the relationship between process variables and output. As a result, the Optuna optimizer has improved the CatBoost model considerably compared to AdaBoost and XGBoost. The plot shows that the CatBoost model has predicted values that are much closer to the actual values. Thus, it can be confirmed that CatBoost with Optuna optimizer is the best-performing model.

Fig. 12
figure 12

Residual plot without Optuna optimization

The residual plot (Fig. 13) with GridSearchCV shows an improvement in the performance of the model. However, when comparing GridsearchCV performance on the model, it is not up to that of Optuna optimizer. The GridsearchCV has improved the performance of ensemble models, particularly the performance of the CatBoost model. Other ensemble models, AdaBoost and XGBoost, have shown improvements but not like CatBoost. From the plot, it is clear that the predicted values of the CatBoost model are closer to the actual values. This confirms that the model with GridsearchCV optimizer has learnt the relationship between the process variables without memorizing the training data. Thus, the CatBoost model remains the best-performing model even with GridsearchCV. The SVR model seems to be the worst-performing model [41–42], even with GridSearchCV, as the model has failed to show improvements.

Fig. 13
figure 13

Residual plot without GridSearchCV optimization

5 Conclusion

The increasing population, need for customization, and sustainability make Additive manufacturing a leading technology front in the field of Manufacturing. The complex relationship between the process parameters defines the quality of additive-manufactured parts which will be expensive if we go for experimentation to predict the relationship between the process parameters. Hence, machine learning models have been used to learn the data from the physical experiments and evaluate the metrics to predict the compressive strength of additive-manufactured PLA material.

  • Infill density, Infill pattern, Raster orientation, and Layer Height have varied at three levels, and samples have been printed. The highest compressive strength of 71.77 MPa was measured for 0.1 layer height, 100% infill density, 90-degree raster angle, and infill line pattern.

  • Infill density has the greatest apparent outcome, with higher infill ensuing in greater strength amongst all other parameter combinations. The influences of layer height, infill pattern, and raster orientation are more complicated and interrelated.

  • Increasing layer height can somewhat reduce strength for some infill patterns, such as linear lines, most likely due to weaker bonding between thicker layers.

  • The infill density height has a positive correlation with compressive, and the Raster orientation does not have any effect on Compressive strength.

  • Among the Line, cubic, and TriHexagonal infill Patterns, the compressive strength is higher for TriHexagonal followed by cubic and lines.

  • CatBoost constantly beat the other models such as Linear Regression, Decision Tree, SVR, and AdaBoost XGBoost by having the lowest Mean Squared Error and R2 score. At the same time, Optuna as well as GridSearchCV optimization techniques are used.

  • Considering all, the model’s performance can be highly influenced by the optimization technique designated, mostly for specific algorithms like Decision Tree and AdaBoost. On the other side, some models, such as SVR, have not gained much from optimization, while others, like XGBoost, are reasonably less impacted by it.

  • To guarantee data quality and consistency, it is first necessary to invest in reliable data collection and preparation methods. This includes creating plans for handling outliers and missing data and investigating data augmentation approaches to broaden the range of data.

  • When developing and selecting ML models, researchers should take into account the intricacy of the issue at hand as well as the available data. They should also prioritise interpretable models whenever feasible and use regularisation approaches to avoid overfitting.