Beruflich Dokumente
Kultur Dokumente
a. G invariant
1. None of the members cover any of the negative examples.
2. None of the members are generalizations or equal to other members i.e redundant
3. Each of the members is a generalization of every member of S
4. None of the members exclude any of the positive examples
b. S invariant
1. None of the members exclude any of the positive examples
2. None of the members are specializations or equal to other members i.e redundant
3. Each of the members is a specialization of every member of G
4. None of the members cover any of the negative example
III VS Algorithm
Procedure [Success,Convergence,S,G]=VersionSpaceAlgorithm(E)
Success = False, Convergence=False
VS = [G,S],G=[U],S=[]
For each example e in E
If example is positive
[G,S] = ProcessPositiveExample(G,S,e)
Else
[G,S] = ProcessNegativeExample(G,S,e)
End If
End For
If S != [] and G != []
Success = True
If S=G
Convergence = True
End If
End If
End Procedure
Procedure [S,G]=ProcessPositiveExample(G,S,e)
%G Invariant 4
G = RemoveAllNonCoveringHypotheses(G,e)
%S Invariant 1
S = GetAllMinimalGeneralizations(S,e)
%S Invariant 2
S = RemoveRedundantGeneralHypothesis(S)
%S Invariant 3
S = RemoveAllNonSpecializingGHypotheses(S,G)
End Procedure
Procedure [S,G]=ProcessNegativeExample(G,S,e)
%S Invariant 4
S = RemoveAllCoveringHypotheses(S,e)**
%G Invariant 1
G = GetAllMinimalSpecializations(G,e)
%G Invariant 2
G = RemoveRedundantSpecificHypothesis(G)
%G Invariant 3
G = RemoveAllNonGeneralizingSHypotheses(G,S)
End Procedure
** If this is called S may become empty and cause the algorithm to terminate with failure,
especially in case of conjunctive concepts.
Initialization
G = {[?,?,?,?]}
S = {[empty]}
Example 1. [large,friendly,a_lot,spotted_brown_white] +
S = [[empty],[large,friendly,a_lot,spotted_brown_white]
S = [large,friendly,a_lot,spotted_brown_white]
G = {[?,?,?,?]}
Example 2. [small,aggressive,little,black] -
G = { [?,?,?,?],[large,?,?,?],[?,friendly,?,?],[?,?,a_lot,?],[?,?,?,brown]*, [?,?,?,multiple_colors]
G = { [large,?,?,?],[?,friendly,?,?],[?,?,a_lot,?], [?,?,?,multiple_colors]
GI3 is not satisfied unless [?,?,?,brown] is removed, as it does not generalize S
GI2 is satisfied, No redundant hypotheses, None of the members are generalizations of other
members
SI4 is satisfied None of the members of S cover the negative example
S = [large,friendly,a_lot,spotted_brown_white]
G={ [large,?,?,?],
[?,?,a_lot,?], [small,?,a_lot,?],[large,?,a_lot,?], [?,aggressive,a_lot,?],[?,?,a_lot,spotted],
[?,?,a_lot,single_color]
[?,?,?,multiple_colors],[?,?,?,spotted],[large,?,?,mixed_red_black],
[small,?,?,mixed_red_black],[?,aggressive,?,mixed_red_black] ,[?,?,little,mixed_red_black]
}
Example 5. [small,friendly,a_lot,spotted_brown_black] +
S = {[large,?,a_lot,spotted] [?,?,a_lot,spotted] }
G={ [large,?,?,?],[?,?,?,spotted]}
GI4 is not satisfied unless [large,?,?,?],is removed, as it does not include all positive examples
G={[?,?,?,spotted]}
S = {[?,?,a_lot,spotted] }
Termination VS
G={[?,?,?,spotted]}
S = {[?,?,a_lot,spotted] }