# Relaxed Rule-Based Learning for Automated Predictive Maintenance: Proof of Concept
## 2 Relaxed Separate-and-Conquer Rule Learning approach  
In this section, we describe the Relaxed Separate-and-Conquer (RSC) method of rule learning. We emphasize that, like Separate-and-Conquer (SeCo), this is an **approach** rather than a single algorithm. Several heuristic choices need to be made in order to turn this approach into an algorithm. We present the approach equipped with a quite straightforward heuristic based on a common sense. We also demonstrate that the RSC approach generalizes SeCo and weighted covering methods, the latter under a mild restriction. In order to present the RSC approach, we introduce first the related terminology. Our dataset is presented as a table called \(DATA\) having \(n+1\) columns. The first \(n\) columns are referred to as _attributes_\(attr_{1},\ldots,attr_{n}\). The values of \(attr_{i}\) are integer numbers between 0 and some maximum possible value \(max_{i}\). The last column is called the _outcome_ and denoted by \(out\). The \(out\) column is binary with possible values 1 (interpreted as 'alarm') and 0 ('no alarm'). Our aim is to learn the rules predicting alarms. We assume that there are no two distinct rows with the same tuple of attributes, to make sure that the dataset represents a function. **Definition 1**. : _An attribute-value pair (\(AVP\)) is a pair \((j,[a,b])\) where \(1\leq j\leq n\) and \(0\leq a\leq b\leq max_{j}\). A row \(DATA[i]\) of \(DATA\) is covered by \((j,[a,b])\) if \(a\leq DATA[i][j]\leq b\). In other words, an AVP \((j,[a,b])\) restricts the values of \(attr_{j}\) to \([a,b]\)._  
**Definition 2**. : _A rule is a set of AVPs. A row of \(DATA\) is covered by the rule if it is covered by all the AVPs. In other words, we can see a rule as a conjunction of AVPs._  
**Definition 3**. : _A collection of rules is a set of rules. A row is covered by a collection of rules if it is covered by at least one rule of the collection._  
Thus we can see that a collection of rules can be seen as a monotone (no negations) Disjunctive Normal Form (DNF) with AVPs used instead of Boolean variables. The algorithm consists of a generic function for forming a collection of rules and growing a single rule which needs an heuristic to choose the next AVP to add to the current rule (if any). The main function is called \(RSC\), which is an abbreviation of Relaxed Separate-and-Conquer. It starts with an empty collection of rules and runs a function \(FormRule\) that returns a rule. If this rule is not empty then it is added to a collection. If the rule returned by \(FormRule\) is empty then the algorithm stops and the collection formed so far is returned. The pseudocode of \(RSC\) and \(FormRule\) functions is given in Algorithm 1. ```
Input: \(\mathcal{R}\), \(


```
functionRSC( )  Collection \(\leftarrow\)\(\emptyset\) loop \(Rule\gets FormRule(Collection)\) if\(Rule=\emptyset\)then returnCollection endif  Collection \(\leftarrow\)\(Collection\cup\{Rule\}\) endloop endfunctionfunctionFormRule(\(Collection\)) \(Rule\leftarrow\emptyset\) loop \(AVP\gets ChooseNext(Collection,Rule)\) if\(AVP=nil\)then return\(Rule\) endif \(Rule\gets Rule\cup\{AVP\}\) endloop endfunction
```
**Algorithm 1** Relaxed Separate-and-Conquer (RSC) Rule Learning approach. **Definition 4**. : _An AVP \((j,[a,b])\) is a half-interval if either \(a=0\) or \(b=max_{j}\)._

In other words, \((j,[a,b])\) is a half interval if either \(a\) is the initial value of \(attr_{j}\) or \(b\) is the final value of this attribute. For attribute \(j\) there are \(2*max_{j}\) half-intervals and \(O(max_{j}^{2})\) AVPs in general. Therefore, going through half-intervals only significantly saves the runtime. Note that the expressive power is not affected because any AVP can be seen as a rule including two half-intervals. The pseudocode of \(ChooseNext\) heuristic is provided in Algorithm 2. \(ChooseNext\) uses two auxiliary functions: \(IsChosen\) and \(IsReplaced\).