learning classifier systems -...

31
Learning Classifier Systems Victor Montiel Argaiz MsC in Artificial Intelligence U.N.E.D. Madrid, Spain [email protected] May 31st, 2012

Upload: others

Post on 18-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Learning Classifier Systems

Victor Montiel Argaiz

MsC in Artificial IntelligenceU.N.E.D.

Madrid, Spain

[email protected]

May 31st, 2012

Page 2: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Contents

1 Introduction to LCS

2 Discovery and learning within LCS

3 Learning Methods

4 Examples of LCSThe simplified MCSZeroth Level CS, ZCSeXtended CS, XCS

5 Applications and Conclusions

Page 3: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Introduction to LCS

Page 4: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Introduction to Learning Classifier Systems

• Learning Classifier Systems (LCS) are machine learningmethods which use evolutionary computation techniques tocreate a set of rules or classifiers aimed to perform the bestaction given an input from the environment.

• As other machine learning methods, LCS are adaptive systems,i.e., they have the capacity to change and learn from previousexperiences according to a reward or credit assigment scheme.

Page 5: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

LCS within AI techniquesLCS make use of Evolutionary Computing techniques to generatenew random knowledge, and Reinforced Learning to choose,amongst the generated knowledge, the best fitted to theenvironment. Because of this mixture of techniques they are alsoreferred as Genetic-based Machine Learning systems [1].

Page 6: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Componentes of a LCS, I

There exist many different implementations of LCS, all havingsome common components making possible the discovery of newknowledge and learning of the useful one:

• Environment Interface: Detectors to receive inputs from theenvironment and effectors to perform actions

• Population of rules or classifiers, containing the currentknowledge, codified according to a certain genotypedepending on the problem to be solved (decision trees, binaryvalues, real values, intervals...).

• Discovery component, to create new rules and improve theexisting ones. Implemented through Genetic Algorithms

Page 7: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Components of a LCS, II

• Message List component, to introduce, as a way of feedback,the internal state of the system as another input, being ableto behave as a memory mechanism.

• Performance component, which selects the best rules anddecides the action to perform. It is made up of the Matchingset, the Action set and eventually a prediction component.

• Reinforcement component, which, given the reward obtainedfor an action, updates the fitness of each rule according tosome credit assigment algorithm such as bucket brigade orQ-Learning-alike methods.

Page 8: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Components of a LCS, III

Environment

Detectors Effectors

Population (Set Rule)

GeneticAlgorithm

ExternalState

ActionsMessageList

Action SetMatch Set

CreditAssignment

Conditions Actions

Action Selection

FitnessUpdate

Reward

Page 9: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Discovery and learning within LCS

Discovery and learning are the two main modules behind LCS. Thefirst one creates new random knowledge through rules, the secondone retains the best rules.

Page 10: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Discovery of new rules

Rule discovery is implemented usually with Genetic Algorithms:

• N classifiers randomly initialized are codified in a genotypeusing a condition:action format (population of rules)

• Each classifier has a fitness evaluation according to the resultsobtained when applying that rule to a given input condition

• Best rules are selected to mate according to their fitnessvalue, creating new individuals via crossover and mutation(creation of new knowledge)

• Best rules amongst parents and offsprings are selected tosurvive for the next generation, removing those lessperforming classifiers to keep population size constant.

Common transformation operators (crossover and mutation) areused depending on the genotype representation (binary or realnumbers usually). Steady-State selection process are usuallyimplemented.

Page 11: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Michigan and Pittsburgh Styles

• Michigan-style LCS have a population of classifiers where theGA operates at the level of individual rules, and the solution ismade up of the entire population, all classifiers cooperate toprovide a collective solution

• Pittsburgh-style LCS have a population of variable lengthrule-set, GA operates at the level of an entire rule-set and eachrule-set is a potential solution. Rule-sets compete amongstthem, they do not cooperate to provide a collective solution

Michigan-style LCS are by far more common because of theirsimplicity, lesser computational requirements and flexibility to beapplied to a wider range of problems. They are more fitted forincremental learning. Pittsburgh-style systems usally employoff-line learning to generate the rule-set

Page 12: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Learning Methods

Page 13: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Learning I

Learnig is the increasing of performance of the LCS through theacquisition of new and useful knowledge based on experience ofpast actions.Depending on the learning environment, learning can be:

• Offline or batch: All training examples are presented at onceto the system, creating a definitive rule-set at the end of thelearning process to be used later. Learning and application ofthe system do not coexist in time

• Online or incremental: Examples are provided one at a time,and rule-set is continously changing with each new input fromthe environment. Learning and application of the systemcoexist in time, improving the performance while it is beingused

Page 14: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Learning II

Depending on the feedback supplied to the system, learning canbe:

• Supervised: For each training example, the solution (correctaction) is provided. More usual in offline learning.

• Reinforcement: The correct answer is not known for thesystem, but a numerical feedback is provided measuring thecorrectness of the condition:action rule. This feedbackprovides the hint to know if the rule is bad or good.

Typically, LCS use online and unsupervised reinforced learning, butthis is not the unique configuration.

Page 15: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Learning Methods, Implicit Bucket Brigade

It is one of the first credit assigment scheme used widely by LCScommunity, specially in the most simple implementations.After an action has been performed at time t, we proceed toupdate the fitness value sr of each rule r according to the followingsteps:

1 Rules which are not in the match set Mt are unchanged:∀r /∈ Mt , s

′r = sr

2 Rules within Mt but not in the action set At have their fitnessvalues reduced by a mupltiplication factor τ ∈ [0, 1),∀r ∈ Mt , r /∈ At , s

′r = sr · τ

3 Rules within At have their fitness values reduced by a fractionβ ∈ [0, 1), ∀r ∈ At , s

′r = (1− β)sr

Page 16: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Learning Methods, Implicit Bucket Brigade

4 This proportion β of fitness substracted will be distributed tothe members of previous action set At−1, reduced by a

one-period discount factor γ, ∀r ∈ At−1, s′′r = s ′r +

γ∑

r∈At βsr|At−1|

5 Finally, the new reward Pt is distributed to the members ofthe current action set, reduced by a factor of β,∀r ∈ At , s

′′′r = s ′′r + β Pt

|At |

Intuitively, we can think of the fitness update as an economictransaction. Rules will pay a fraction β of their fitness sr for beingselected. After receiving the reward P, it will be allocated withinall rules in At , that is, they will be paid back for its work. If theyget more reward than what they paid to be selected, they end upwith positive balance, effectively increasing their fitness value, as asign they are good rules.

Page 17: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Learning Methods, Q-Learning-alike

Inspiried in the Q-Learning, is one of the most important learningmethods within the Reinforcement Learning arena. Each rule isrepresented by a five tuple 〈c : a : p : ε : F 〉, where c , a, p are thecondition, action and predicted payoff, ε the prediction error and Fa fitness for the GA.Let A the set of actions in rules r within the match set Mt , upon anew action the update of parameters is as follows:

1 For each action in A, calculate a weighted predicted payoffbased on the prediction and fitness of each rule r ∈ Ra which

has a as an action. ∀a ∈ A, pa =∑r∈Ra

prFr∑

r∈Ra

Fr

2 Selected the action based on this predicted action reward pa

3 Once we have the reward R, we update the action set rules

Page 18: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Learning Methods, Q-Learning-alike

4 Fitness values are updated using prediction errors εr and

accuracy of the rule κr = elnα· εr−ε0

ε0 , with a learning rate of β,F ′r = Fr + β(κ′r − Fr ), where κ′r is a normalized accuracy forall rules of the set κ′r = κr∑

r∈Ra

κr

5 A Payoff P = γmax{pa\a ∈ A}+ R is calculated based onreward R and maximum prediction for all actions in Mt

6 P is used to update prediction errors:ε′r = εr + β(|P − pr | − εr )

7 P is also used to update the actual prediction for the rulep′r = pr + β(P − pr )

Page 19: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Examples of LCS

After a review of components and learning methods, somepractical implementations of LCS...

Page 20: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

An example, Minimal Classifier System(MCS)

Consider the multiplexor example on [2] using a simplified versionof LCS, the MCS [3].

• Inputs are defined with 2-bits address types (a) and 4-bitsinput types (i):aa iiii

• The output (o) is a 1-bit type equal to the input pointed bythe address bits

• Genotype of classifiers: input:action ⇒ [ reward ], codifiedin binary as aa iiii : o ⇒ [ reward ]. The character # isa wildcard matching any value.

Page 21: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

MCS at Work, I

Environment

Detectors Effectors

Match Set

Population(Set Rule)

Action Set

Prediction

GeneticAlgorithm

CreditAssignment

Reward

101011

101011 : 1 [100]1#1111 : 0 [000]010001 : 0 [100]110101 : 0 [000]#11010 : 0 [100]#0101# : 0 [050]10#011 : 0 [000]#11111 : 1 [100]0#1001 : 1 [050]##1011: 1 [100]

101011 : 1 [100]#0101# : 0 [050]10#011 : 0 [000]##1011 : 1 [100]

Action 1: [200]Action 0: [050]

101011 : 1 [100]##1011 : 1 [100]

Action 1 Selected

Action 1

Right! Reward = [100]

1

2

3

4

5

6

7

9

8

Page 22: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

MCS at Work, II

Steps on the execution:

1 A new input 10 1011 is provided by the environment

2 Look up on the population of classifiers for those rulesmatching the input

3 The match set with those rules matching the input conditionis created. In brakets we have the current fitness value foreach rule

4 Each classifier might have a different action to perform 1 or 0.Predict, using fitness values for each rule, which action wouldreturn a higher reward

5 Action 1, with the highest reward, is selected

Page 23: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

MCS at Work, III

6 Action 1 is effectively performed on the environment

7 Environment returns some kind of reward P

8 Credit Assigment unit update fitness value of the rules withinthe action and matching set according to the reward receivedand the learning scheme.

9 Genetic Algorithm run a generation, mating parents, creatingnew offsprings, mutating individuals and selecting the bestclassifiers for next round

Page 24: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

MCS at Work, IV

• MCS is just a simplified LCS, which processes iteratively justone input at a time. In general LCS have message list beingable to process several messages, both from environment andfeedback from other components of the system at previoustime steps

• If match set is empty for a given input, GA randomly creates anew rule covering that input (covering), and removes anotherone, based on its fitness value, to keep population constant

• Offsprings (new rules) usually inherit fitness from their parents

Page 25: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Zeroth Level CS, ZCSMCS machines were created as a simplified model, but never usedin practice. ZCS was one of the first system used.

• ZCS do not implement themessage list. Inputs aredirectly matched against thepopulation of rules

• The credit assigmentschema is usally the implicitbucket brigade

• There is no prediction ofeach action

Environment

Detectors Effectors

Population (Set Rule)

GeneticAlgorithm

ExternalState

Actions

Action SetMatch Set

CreditAssignment

Action Selection

FitnessUpdate

Reward

PreviousAction Set

Page 26: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

eXtended CS, XCSXCS are still a simplificatoin of the general LCS, and try to solvethe drawbacks of the simplicity of ZCS.

• They still do not haveinternal message list (nomemory)

• It uses predicted reward tochoose the action

• Q-learning-alike learningmethods are usuallyemployed

Environment

Detectors Effectors

Population (Set Rule)

GeneticAlgorithm

ExternalState

Actions

Action SetMatch Set

CreditAssignment

ActionSelection

FitnessUpdate

RewardPrevious

Action Set

PredictionArray

Page 27: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Applications and Conclusions

Page 28: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Applications

LCS have been used on the following domains to solve a widevariety of problems:

• Function Approximation: Approximation of complex functionsby a set of functions defined on overlapping domains(piecewise definition)

• Classification Problems: Pattern recognition, image analysis,medical diagnosis, data mining

• Reinforcement Learning Problems: Robot control andnavigation, Design optimization (VLSI microchip layering),stock market trading, optimization (traffic-light control).

Page 29: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Drawbacks

Although LCS have been successfully applied to many problems,they have also some drawbacks:

• They do not perform well on sequential decision problems (anin general non-Markovian problems), where several actions fora given input are invoked before getting a reward

• They have a large number of components: GA, CreditScheme, Message Lists, each one having a set of configurationparameters. A fine tuning of all components working togethercan be a tough task

• There is no such thing as a standard LCS, instead manydifferent designs exist (MCS, ZCS, XCS...). The lack of rigourand homogeneity on the designs implyies a low acceptancewithin the machine learning field

Page 30: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Summary

• LCS merge stand-alone techniques, such as Genetic Algorithmand Reinforcement Learning to give another approach to thelearning tools.

• The interactions between these stand-alone modules, and itsindividual configuration give infinite possible combinations forthis learning tool, each adapted to a particular problem

• The complexity of the initial theoretic LCS schema has beensolved by creating the simplified models ZCS and XCS, whichhave been used in practice

Page 31: Learning Classifier Systems - victormontielargaiz.netvictormontielargaiz.net/Projects/EvolutionaryComputing/Learning... · Learning Classi er Systems (LCS) are machine learning methods

Bibliography

Jan Drugowitsch.Design and Analysis of Learning Classifier Systems: AProbabilistic Approach (Studies in ComputationalIntelligence).Springer Publishing Company, Incorporated, 1 edition, 2008.

A. E. Eiben and J. E. Smith.Introduction to evolutionary computation.Natural computing series. Springer-Verlag, 2003.

Ryan J. Urbanowicz and Jason H. Moore.Learning classifier systems: a complete introduction, review,and roadmap.J. Artif. Evol. App., 2009:1:1–1:25, January 2009.