CAPÍTULO 1: Principales antecedentes teóricos relacionados con la ocupación del tiempo libre en el proceso de recreación comunitaria
1.5 Las actividades físicas como función recreativa
With all the definitions in place, we can now describe FUZZYBEXA’s two top layers. FUZZYBEXA’s top layer routine, CoverConcepts, implements the fuzzy set covering approach to rule induction, and is
Table 4.2: FUZZYBEXA’s fuzzy set covering layer.
PROCEDURE CoverConcepts(T , concepts) 1 ruleset = ∅
2 FOR EACH conceptCi∈ concepts DO
3 P = {i ∈ T |µconcept(i) ≥ αc}
4 N = T − P
5 REPEAT
6 bestconj = FindBestConjunction(P, N ) 7 IFbestconj 6= NULL THEN
8 Add the rule “IFbestconj@αaTHENconcept = Ci@αc” toruleset
9 P = P − XP(bestconj)
10 END IF
11 UNTIL (P = ∅) OR (bestconj = NULL) 12 END FOR
13 RETURNruleset END PROCEDURE
shown in Table 4.2. It receives a training set T of fuzzy instances and a list of concepts for which to induce classification rules. For each conceptCithe training set is split into a set of positive instancesP
and a set of negative instancesN . To obtain P , we make use of either Eq (4.22) or Eq (4.25). The set N is formed by subtractingP from T , N = T − P . Next, FUZZYBEXAinvokes its middle layer routine to obtain the conjunction that best describes the current concept. It then adds the rule with this conjunction as antecedent and the current concept as consequent to its rule set. All the positive instances covered by this rule are then removed from the set of positive instances, while the set N remains unchanged. FUZZYBEXA iteratively induces more rules until either all the positive instances are covered, or no “useful” conjunction could be found, indicated by a NULL value forbestconj. It then continues with the next concept until classification rules for all the concepts are induced. Since|P | is reduced during each iteration, the algorithm is guaranteed to terminate.
FUZZYBEXA’s middle layer is called FindBestConjunction, and is shown in Table 4.3. It implements a set of search heuristics to guide the search. The routine maintains a set of conjunctions, called special-
izations, that are iteratively specialized by invoking the bottom layer routine. This set is initialized by
the mgc, which is formed as in Eq (4.20). FindBestConjunction also keeps track of the best conjunc- tion found during the search by storing this conjunction in the variablebestconj, which is initialized to
NULL.
The set of specializations obtained from specializing the conjunctions in specializations replaces spe-
cializations. Each specialization is then evaluated according to an evaluation function. FUZZYBEXAcan use any evaluation function that assigns better scores to conjunctions that cover the positive set better than the negative set, where the exact definition of better is defined by the evaluation function itself. One example of such an evaluation function is the Laplace estimate. The evaluation function plays a pivotal role during rule induction. It is thus very important to use a suitable evaluation function for the problem to solve. The effect of the evaluation function will be the subject of Chapter 6. If a conjunction is found
Table 4.3: FUZZYBEXA’s FindBestConjunction procedure.
PROCEDURE FindBestConjunction(P, N ) 1 bestconj =NULL;
2 specializations = {mgc } 3 WHILEspecializations 6= ∅ DO
4 specializations =generateSpecializations(P, N, specializations); 5 FOR each conjunctionc ∈ specializations DO
6 IFc is better than bestconj according to the evaluation THEN
7 bestconj = c;
8 ELSEIFc and bestconj have the same evaluation 9 AND|XP(c)| > |XP(bestconj)| THEN
10 bestconj = c;
11 ELSEIFc and bestconj have the same evaluation 12 ANDc is less complex than bestconj THEN
13 bestconj = c;
14 ENDIF
15 ENDIF
16 ENDFOR
17 Remove fromspecializations all the conjunctions that cover no negative instances
18 Remove fromspecializations all the conjunctions whose optimistic evaluation is worse thanbestconj’s evaluation
19 Retain inspecializations only the beamwidth best conjunctions 20 END WHILE
21 IF the evaluation function value forbestconj is the same or worse than that of the mgc THEN
22 RETURN NULL; 23 ELSE
24 RETURNbestconj; END PROCEDURE
with a better evaluation it replaces the current best conjunction. Lines 8 to 18 implement further search heuristics discussed in the next sections.
After searching the current set of specializations for an improvement on the current best conjunction, a set of stop-growth criteria is used to prune the search. FUZZYBEXA prunes conjunctions that are consistent (conjunctions that cover no negative instances) from the search process since these cannot be improved by further specialization. Then only the remaining beamwidth best conjunctions are retained in specializations for further specialization. FUZZYBEXA performs a type of best-first search if its beam width is set to one. Best first search is a hill-climbing strategy that expands the current state and evaluates its children. The best child is selected and the parent and siblings are ignored. The search halts when it reaches a state that is better than any of its children [Luger and Stubblefield, 1998, p. 127]. FUZZYBEXAsearches top-down, and keeps track of the best conjunction found during the whole search. Therefore the first (and most general) “best conjunction” found will be returned, not the last. By setting the beam width parameter to a value greater than one, FUZZYBEXA performs a local beam search of
the hypothesis space. That is, in each layer of the lattice of conjunctions, up to a beamwidth number of conjunctions may be specialized further. If the best conjunction found during a search performs no better than the mgc, the result “no useful conjunction found” (i.e. NULL) is returned, otherwise, bestconj is returned. The middle layer also employs other search heuristics to improve efficiency and performance. These are discussed next.
4.5.1 Choosing Bigger Positive Extensions
Lines 8 to 10 in Table 4.3 are used to compensate for some evaluation functions that may assign the same evaluation to two conjunctions, but one conjunction covers more positive instances. Consider for example the Laplace evaluation,
L(c) = |XP(c)| + 1
|XP(c)| + |XN(c)| + #concepts
(4.26) Assume|XP(c1)| = |XN(c1)| = 10, and |XP(c2)| = |XN(c2)| = 100. Then evaluations of c1 and c2 areL(c1) = 11/22 = 0.5 and L(c2) = 101/202 = 0.5. In this case we prefer c2 over c1, asc2 is
more general (i.e. cover more instances) and also has the potential to become better thanc1by further
specialization. Note, this test is not neccesary ifc1 ≺ c2, sincec2would have been evaluated first, and
thus kept as best conjunction—L(c1) was not better than L(c2). However, it may be that c1 andc2 are
found in the same layer of the lattice and thatc2is evaluated afterc1—in this case we wishc2to replace c1, even though they obtained equal evaluations.
4.5.2 Preferring Less Complex Conjunctions
If two conjunctions are equivalent according to the evaluation function, and the size of their positive extensions are the same, we prefer the least complex conjunction. Complexity can be measured either in terms of the number of conjuncts in a conjunction, or in terms of the number of linguistic terms in the description set of the conjunction. We chose to used the first approach, since this approach favours rules with more conditions on one linguistic variable to rules using more linguistic variables. The reasoning is that if one linguistic variable can be used instead of two, this identifies the variable as significant and justifies its use in the rule. The cost of measuring one variable is also less than measuring two variables, assuming equal cost for all variables. The complexity test is implemented by Lines 11 to 13 in Table 4.3. If a conjunction obtains the same evluation as the best conjunction, we retain the best conjunction only if it is less complex, otherwise it is replaced.
4.5.3 Optimistic Evaluation
Line 17 cause all conjunctions with empty negative extensions to be removed from the search. Once the negative extension of a conjunction becomes empty, no further amount of specialization will cause the conjunction to improve, as it already covers the maximum number of positive instances (assuming a general-to-specific search). However, it may happen that a conjunction can still be improved, i.e. its
negative extension is not empty, but no amount of specialization will make it better than the current best conjunction. We test for this condition by evaluating the conjunction optimistically. This means, we assume that the conjunction can be specialized such that its positive extension remains intact, but its negative extension becomes empty. If such an optimistic evaluation is still worse than the normal evaluation of the current best conjunction, we remove the conjunction from the search process. Consider for example the conjunction c1 with |XP(c1)| = 10 and |XN(c1)| = 10, then L(c1) = 0.5. The
optimistic evaluation of this conjunction isLoptimistic(c1) = 10+110+2 = 91.166. If the best conjunction had
an evaluation greater than91.166, we remove the conjunction from the search, since no specialization can receive a better evaluation and thus replace the best conjunction. The test is implemented by Line 18 in Table 4.3.