# Relaxed Rule-Based Learning for Automated Predictive Maintenance: Proof of Concept
## 2 Relaxed Separate-and-Conquer Rule Learning approach
In all of our experiments, we set these parameters to \(1,1\%,0.5\%\) respectively. Figure 1: DT example

The rest of the section consists of two subsection. In each subsection we consider a particular domain and compare our RSC approach with the DT based and SeCo rule learners using this domain. ### Learning the Truth Table of the Given Collection of Rules

Any function on finite domain variables can be defined using a _truth table_. The truth table consists of all possible tuples of assignment of variables with their domain values, and each tuple is associated with the respective value of the function. In our first experiment we randomly generate a small collection of small rules, then randomly select a subset \(S\) of rows of the truth table of the collection. Next, we run a RL algorithm (RSC, SeCo, and a DT based rule learner) on \(S\) with the goal to create a collection of rules as close as possible matching the original one. The rest of the subsection is organized as follows. 1. We define a truth table for a collection of rules. 2. We specify an algorithm for generalization of a random collection of rules and of a random subset of its truth table. 3. We describe the tests that we performed and their results. **Truth table for a collection of rules and the induced function. **

A collection of rules can be associated with many truth tables. This is because, in addition to the variables of the rules, the truth table can also contain many variables that are _not_ essential for the rule. However, since the RL algorithm does not 'know' that these extra variables are not essential, these variables make the RL task more difficult. For example, consider a single rule consisting of a single AVP \((x_{1},[2,4])\). A truth table for this rule may consist of 100 variables \(x_{1},\ldots,x_{100}\). The domain of each variable can be e.g. \(\{1,\ldots,10\}\). However, the value of the respective function is determined only by the above AVP: it is 1 if the value of \(x_{1}\) is between 2 and 4, and 0 otherwise. Having in mind the above example, we give below a formal definition of a truth table for a collection of rules. As an intermediate notion we also define a function _induced_ by the collection of rules, a notion that we will use for the description of a training set. **Definition 8**: _Let \(\mathbf{C}\) be a collection of rules. Let \(X\) be the set of variables of \(\mathbf{C}\). For each \(x\in X\), let \(\mathit{val}(x)\) be the set of values of \(X\) used in the rules of \(\mathbf{C}\). Let \(X^{*}\) be a set of variables such that \(X\subseteq X^{*}\). For each \(x\in X^{*}\), the domain \(\mathit{dom}(x)\) of \(x\) is defined under the following constraint: if \(x\in X\) then \(\mathit{val}(x)\subseteq\mathit{dom}(x)\). Otherwise, \(\mathit{dom}(x)\) is an arbitrary finite set. Then a function \(f\) induced by \(\mathbf{C}\) is defined as follows. The domain of \(f\) is \(X^{*}\). Let \(X^{*}=\{x_{1},\ldots,x_{n}\}\). Let \(\mathit{val}_{1},\ldots,\mathit{val}_{n}\) be the tuple of assignments to the respective variables. If this tuple is covered by at least one rule of \(\mathbf{C}\) then the corresponding value of \(f\) is \(1\), otherwise it is \(0\)._

_Given \(X^{*}\) and their domains as above, the truth table of \(\mathbf{C}\) becomes the truth table of \(f\). That is the rows of the table correspond to the \(x_{1},\ldots,x_{n}\) and the last column is for the outcome. The rows of the table are all the tuples of assignments to \(X^{*}\) and their corresponding value of \(f\) as described above._

**Generation of a random collection of rules and a random subset of the related truth table. **

1. Choose the following parameters. 1. \(num\_attr\), the number of attributes. 2. \(max\_val\), the largest value for each attribute meaning that the attribute values will lay in the interval \([0,max\_val]\). 3. \(num\_rules\), the number of rules to be generated. 4. \(len\_rule\), the length of the generated rules 5. \(num\_rows\), the number of rows of the training set.