## 3 MSP Algorithms and Master Data in Production Planning System
### MSP Algorithm  
The M5P algorithm has the following features and benefits. It has advantages in handling categorical features (categorical variables). The algorithm includes a way to handle categorical variables internally, so they can be directly included in the predictive model without the need to preprocess the data. This simplifies the model development process and saves time. It also allows the user to automatically determine appropriate bifurcation points to account for different levels of categorical variables to achieve optimal predictive performance. The M5P algorithm typically has a faster execution speed than other complex regression algorithms. It is useful for small-sized datasets or in situations with time constraints. Applying the M5P algorithm also allows the relationship between data and rules to be described and analyzed, to predict the numerical characteristics of the target variable [30]. One of the main advantages of model trees is that these can efficiently handle a large number of datasets with many attributes and dimensions. These are also known to be robust when addressing missing data [31]. These two features are the main reasons that this algorithm was selected for this study. The capability to rapidly process large amounts of data with missing and volatile information, and achieve predictability is important in daily production planning. As shown in Figure 5, there are three major steps in developing an M5P tree: tree construction, tree pruning, and tree smoothing. The M5 tree construction process attempts. 1. Tree Construction: The M5P algorithm constructs a regression tree by recursively partitioning the training dataset based on the attribute values. The splitting process aims to find the attribute that provides the best split, often based on criteria such as information gain or variance reduction. The algorithm continues splitting until a stopping criterion is met, such as reaching a minimum number of instances per leaf or a maximum tree depth. The constructing process attempts to maximize a measure called the standard deviation reduction (SDR) [32]. Equation (1) of SDR is shown as follows, where \(H\) is the instances dataset that stretch the node, \(H_{i}\) is the set that is received from a divided node according to a given attribute, and \(sd\) is the standard deviation of \(\bar{H}\)[33]. \[ \begin{split} SDR=sd(H)-\sum_{i}\frac{|H_{i}|}{|H|}\times sd(H_{i} ),\\ sd(H)=\sqrt{\sum_{1}^{N}\frac{(H_{i}-\bar{H})^{2}}{N-1}},\\ \bar{H}=\sum_{i}^{N}\frac{H_{i}}{N},\end{split} \] (1)
2. Model Pruning: Pruning is an optional step that aims to simplify the tree and reduce overfitting. Pruning techniques, such as subtree replacement or subtree raising, can be applied to remove unnecessary branches or nodes from the tree without significantly affecting the performance. Pruning helps to generalize the model and improve its predictive capabilities on unseen data. 3. Tree Smoothing: The M5P algorithm trains a linear regression model on the leaf nodes during the process of constructing the model tree. The predicted value at each leaf node is calculated based on the conditions at that leaf node. However, the model tree may be too complex or tend to overfit the data. To address these issues, tree smoothing is used. Tree smoothing is a way to increase the smoothness of predictions, and it involves combining the predictions of a leaf node with the predictions of its parent node, with some adjustments. This reduces the volatility of the predictions and allowsthe complexity of the model tree to be controlled. By regression, the final value is smoothed by combining the current value with the predicted value from the linear regression as the following Equation (2).