# Steelmaking Predictive Analytics Based on Random Forest and Semantic Reasoning
## 3 Methods
### Machine Learning Models  
Decision trees (DT) are capable of inferring rules from historical data to classify datapoints as belonging to one of a predefined set of categories. They require relatively minimal data pre-processing steps and generate a definite set of simple rules that assign a unique category to each instance. During the training process, the DT progressively splits the dataset according to the value of a certain feature until a classification is reached for each resulting subset of the dataset. Thus, a DT can be viewed as a set of discrete rules. Each rule is composed of a logical conjunction of elementary formulae, accompanied by a class attribution. Any unseen instance satisfies precisely one of those rules, so that the classification performed by a DT is both human and machine interpretable. They are also advantageous as they have similar constructs to semantic web-based rules. However, DTs suffer from high variance and can quickly overfit the training set. Meanwhile, a Random Forest (RF) [24] was introduced as a classifier to overcome these shortcomings. A RF classifier is formed by several DTs, each built using a randomly sampled subset of the training set, containing de-correlated predictors. The predicted category for each instance is determined by combining the output from the trees, which reduces the variance and hence improves the accuracy of the model. An algorithm known as a voting strategy is then used to calculate the final classification from the DTs. There are two main approaches: (1) using a majority voting strategy where the final classification is the modal value of all the DT predictions, or (2) using a soft voting strategy where the final classification is derived by calculating the average value of all the DT predictions. We chose RFs over other ensemble methods due to their advantageous and easily comparable rule-like structure, which aligns well with the structure of semantic rules. This is particularly noticeable when contrasted with other machine learning models such as the Bayesian model. Random Forests have been extensively studied, and they demonstrated high accuracy across various complexities of classification and regression tasks [25]. Additionally, RFs provide a versatile set of techniques including bagging, node splitting, and various feature selection methods, further contributing to their suitability for our application [26]. The structure of a random forest is displayed in Figure 3, presenting a concise snippet in plain text that highlights the straightforward rule-like structure. Each line within the representation contains precisely one condition involving one specific feature. If the condition is met, the traversal continues to the next line, recursively. In case the condition is  
Figure 2: The mapping between SQL data and ontology using Ontop. not satisfied, the traversal instead travels down the pipe into a new line, typically involving the same feature with a reversed condition. This iterative process is repeated until a leaf node is reached, where weightings and classification information are stored. In this specific example, each leaf node is characterized by three potential weighted classifications enclosed in square brackets. The weighted values represent the quantity of training samples that satisfied all the conditions along that path up to the respective leaf node for each class. In a Breiman RF, the final classification is determined by selecting the maximum value among the three values, simulating a hard voting strategy. In contrast, a soft voting strategy would involve calculating the average of the three values to derive the final classification. This distinction in voting strategies adds to the flexibility and adaptability of the RF model. To illustrate the determination of a class, we consider the first leaf node in Figure 3. Such node is represented by the following information: weights : [0,7,1] class 1.0. This indicates that a total of 8 records from the training set satisfy that exact set of inequalities associated with this node.