CSI 5388 Topics in Machine Learning Inductive Learning

  • Slides: 39
Download presentation
CSI 5388: Topics in Machine Learning Inductive Learning: A Review 1

CSI 5388: Topics in Machine Learning Inductive Learning: A Review 1

Course Outline n n n n Overview Theory Version Spaces Decision Trees Neural Networks

Course Outline n n n n Overview Theory Version Spaces Decision Trees Neural Networks Bagging Boosting 2

Inductive Learning : Overview n n Different types of inductive learning: • Supervised Learning:

Inductive Learning : Overview n n Different types of inductive learning: • Supervised Learning: The program attempts to infer an association between attributes and their inferred class. n Concept Learning n Classification • Unsupervised Learning: The program attempts to infer an association between attributes but no class is assigned. : n Reinforced learning. n Clustering n Discovery • Online vs. Batch Learning We will focus on supervised learning in batch mode. 3

Inductive Inference Theory (1) n n n Given X the set of all examples.

Inductive Inference Theory (1) n n n Given X the set of all examples. A concept C is a subset of X. A training example T is a subset of X such that some examples of T are elements of C (the positive examples) and some examples are not elements of C (the negative examples) 4

Inductive Inference Theory (2) Learning: Learning system {<xi, yi>} f: X Y with i=1.

Inductive Inference Theory (2) Learning: Learning system {<xi, yi>} f: X Y with i=1. . n, xi T, yi Y (={0, 1}) yi= 1, if x 1 is positive ( C) yi= 0, if xi is negative ( C) Goals of learning: f must be such that for all xj X (not only T) - f(xj) =1 si xj C n - f(xj) = 0, si xj C 5

Inductive Inference Theory (3) n n Problem: La task or learning is not well

Inductive Inference Theory (3) n n Problem: La task or learning is not well formulated because there exist an infinite number of functions that satisfy the goal. It is necessary to find a way to constrain the search space of f. Definitions: • The set of all fs that satisfy the goal is called hypothesis space. • The constraints on the hypothesis space is called the inductive bias. • There are two types of inductive bias: n The hypothesis space restriction bias n The preference bias 6

Inductive Inference Theory (4) Hypothesis space restriction bias We restrain the language of the

Inductive Inference Theory (4) Hypothesis space restriction bias We restrain the language of the hypothesis space. Examples: n k-DNF: We restrict f to the set of Disjunctive Normal formulas having an arbitrary number of disjunctions but at most, k conjunctive in each conjunctions. n K-CNF: We restrict f to the set of Conjunctive Normal Form formulas having an arbitrary number of conjunctions but with at most, k disjunctive in each disjunction. n Properties of that type of bias: • Positive: Learning will by simplified (Computationally) • Negative: The language can exclude the “good” hypothesis. n 7

Inductive Inference Theory (5) n n Preference Bias: It is an order or unit

Inductive Inference Theory (5) n n Preference Bias: It is an order or unit of measure that serves as a base to a relation of preference in the hypothesis space. Examples: Occam’s razor: We prefer a simple formula for f. Principle of minimal description length (An extension of Occam’s Razor): The best hypothesis is the one that minimise the total length of the hypothesis and the description of the exceptions to this hypothesis. 8

Inductive Inference Theory (6) n n How to implement learning with these bias? Hypothesis

Inductive Inference Theory (6) n n How to implement learning with these bias? Hypothesis space restriction bias: • Given: n A set S of training examples n A set of restricted hypothesis, H • Find: An hypothesis f H that minimizes the number of incorrectly classified training examples of S. 9

Inductive Inference Theory (7) n n Preference Bias: • Given: n A set S

Inductive Inference Theory (7) n n Preference Bias: • Given: n A set S of training examples n An order of preference better(f 1, f 2) for all the hypothesis space (H) functions. • Find: the best hypothesis f H (using the “better” relation) that minimises the number of training examples S incorrectly classified. Search techniques: • Heuristic search • Hill Climbing • Simulated Annealing et Genetic Algorithm 10

Inductive Inference Theory (8) n n When can we trust our learning algorithm? ØTheoretical

Inductive Inference Theory (8) n n When can we trust our learning algorithm? ØTheoretical answer • Experimental answer Theoretical answer : PAC-Learning (Valiant 84) PAC-Learning provides the limit on the necessary number of example (given a certain bias) that will let us believe with a certain confidence that the results returned by the learning algorithm is approximately correct (similar to the t-test). This number of example is called sample complexity of the bias. If the number of training examples exceeds the sample complexity, we are confident of our results. 11

Inductive Inference Theory (9): PAC-Learning n n Given Pr(X) The probability distribution with which

Inductive Inference Theory (9): PAC-Learning n n Given Pr(X) The probability distribution with which the examples are selected from X Given f, an hypothesis from the hypothesis space. Given D the set of all examples for which f and C differ. The error associated with f and the concept C is: • Error(f) = x D Pr(x) • f is approximately correct with an exactitude of iff: Error(f) • f is probably approximately correct (PAC) with probability and exactitude if Pr(Error(f) > ) < 12

Inductive Inference Theory (10): PAC-Learning Theorem: A program that returns any hypothesis consistent with

Inductive Inference Theory (10): PAC-Learning Theorem: A program that returns any hypothesis consistent with the training examples is PAC if n, the number of training examples is greater than ln( /|H|)/ln(1 - ) where |H| represents the number of hypothesis in H. Examples: For 100 hypothesis, you need 70 examples to reduce the error under 0. 1 with a probability of 0. 9 For 1000 hypothesis, 90 are required For 10, 000 hypothesis, 110 are required. ln( /|H|)/ln(1 - ) grows slowly. That’s good! 13

Inductive Inference Theory (11) n n n When can we trust our learning algorithm?

Inductive Inference Theory (11) n n n When can we trust our learning algorithm? - Theoretical answer ØExperimental answer : error estimation Suppose you have access to 1000 examples for a concept f. Divide the data in 2 sets: One training set One test set Train the algorithm on the training set only. Test the resulting hypothesis to have an estimation of that hypothesis on the test set. 14

A Taxonomy of Machine Learning Techniques: Highlight on Important Approaches Supervised Linear Unsupervised Nonlinear

A Taxonomy of Machine Learning Techniques: Highlight on Important Approaches Supervised Linear Unsupervised Nonlinear Logistic Perceptron Regression Single K-Means Decision Rule Trees Learning Naïve Bayes Self-Organizing Maps Combined Bagging Easy to Interpret EM Boosting Hard to Interpret k-Nearest Multi-Layer Neighbours Perceptron Random Forests SVM 15

Version Spaces: Definitions n n n Given C 1 and C 2, two concepts

Version Spaces: Definitions n n n Given C 1 and C 2, two concepts represented by sets of examples. If C 1 C 2, then C 1 is a specialisation of C 2 and C 2 is a generalisation of C 1 is also considered more specific than C 2 Example: The set off all blue triangles is more specific than the set of all the triangles. C 1 is an immediate specialisation of C 2 if there is no concept that are a specialisation of C 2 and a generalisation of C 1. A version space define a graph where the nodes are concepts and the arcs specify that a concept is an immediate specialisation of another one. (See in class example) 16 n

Version Spaces: Overview (1) n n n A Version Space has two limits: The

Version Spaces: Overview (1) n n n A Version Space has two limits: The general limit and the specific limit. The limits are modified after each addition of a training example. The starting general limit is simply (? , ? ); The specific limit has all the leaves of the Version Space tree. When adding a positive example all the examples of the specific limit are generalized until it is compatible with the example. When a negative example is added, the general limit examples are specialised until they are no longer compatible with the example. 17

Version Spaces: Overview (2) n If the specific limits and the general limits are

Version Spaces: Overview (2) n If the specific limits and the general limits are maintained with the previous rules, then a concept is guaranteed to include all the positive examples and exclude all the negative examples if they fall between the limits. Gene ral Limit more specific More general If f is here, it includes all examples + And exclude all examples - Specific Limit 18 (See in class example)

Decision Tree: Introduction n n The simplest form of learning is the memorization of

Decision Tree: Introduction n n The simplest form of learning is the memorization of all the training examples. Problem: Memorization is not useful for new examples We need to find ways to generalize beyond the training examples. Possible Solution: Instead of memorizing each attributes of each examples, we can memorize only those that distinguish between positive and negative examples. That is what the decision tree does. Notice: The same set of example can be represented by different trees. Occam’s Razor tells you to take the smallest tree. 19

Supervised Learning: Example Patient 1 2 3 4 5 6 Attributes Class Temperature Cough

Supervised Learning: Example Patient 1 2 3 4 5 6 Attributes Class Temperature Cough Sore Throat Sinus Pain 37 39 38. 4 36. 8 38. 5 39. 2 yes no no no yes no no yes no flu flu Goal: Learn how to predict whether a new patient with a given set of symptoms does or does not have the flu. 20

Decision Trees: An example Temperature Medium Cough Yes Flu No No Flu Low No

Decision Trees: An example Temperature Medium Cough Yes Flu No No Flu Low No Flu High Sore Throat Yes Flu No No Flu A Decision Tree for the Flu Concept 21

Decision tree: Construction n Step 1: We choose an attribute A (= node 0)

Decision tree: Construction n Step 1: We choose an attribute A (= node 0) and split the example by the value of this attribute. Each of these groups correspond to a child of node 0. Step 2: For each descendant of node 0, if the examples of this descendant are homogenous (have the same class), we stop. Step 3: If the examples of this descendent are not homogenous, then we call the procedure recursively on that descendent. 22

Construction of Decision Trees I D 11 D 12 D 1 D 2 D

Construction of Decision Trees I D 11 D 12 D 1 D 2 D 4 D 6 D 14 D 10 D 5 Assume: Temperature D 3 D 8 D 7 What is the most informative attribute? D 9 D 13 23

Construction of Decision Trees II Medium Temperature High Low D 1 D 9 D

Construction of Decision Trees II Medium Temperature High Low D 1 D 9 D 10 D 8 D 2 D 3 D 11 D 7 D 14 D 12 D 4 D 5 D 13 What are the most informative attributes? D 6 Assume: Cough and Sore Throat 24

Construction of Decision Trees III n n The informativeness of an attribute is an

Construction of Decision Trees III n n The informativeness of an attribute is an information-theoretic measure that corresponds to the attribute that produces the purest children nodes. This is done by minimizing the measure of entropy in the trees that the attribute split generates. The entropy and information are linked in the following way: The more there is entropy in a set S, the more information is necessary in order to guess correctly an element of this set. Info[x, y] = Entropy[x, y] = - x/(x+y) log x/(x+y) - y/(x+y) log y/(x+y) 25

Construction of Decision Trees IV Info[2, 6]=. 811 Info[3, 3]= 1 Temperature Medium Low

Construction of Decision Trees IV Info[2, 6]=. 811 Info[3, 3]= 1 Temperature Medium Low High Avg Tree Info = 8/14 +. 811 + 6/14 * 1 =. 892 Prior Info[9, 5] =. 940 Gain =. 940 -. 892 =. 048 Sore Throat Info[2, 3] =. 971 bits Info[4, 0]= 0 bits Info[3, 2]=. 971 bits Avg Tree Info = 5/14 *. 971 + 4/14 * 0 + 5/14 *. 971 =. 693 Prior Info[9, 5] =. 940 Gain =. 940 -. 693 =. 247 No Yes 26

Decision Tree: Other questions. n n n We have to find a way to

Decision Tree: Other questions. n n n We have to find a way to deal with attributes with continuous values or discrete values with a very large set. We have to find a way to deal with missing values. We have to find a way to deal with noise (errors) in the example’s class and in the attribute values. 27

Neural Network: Introduction (I) n n n What is a neural network? It is

Neural Network: Introduction (I) n n n What is a neural network? It is a formalism inspired by biological systems and that is composed of units that perform simple mathematical operations in parallel. Examples of simple mathematical operation units: • Addition unit • Multiplication unit • Threshold (Continous (example: the Sigmoïd) or not) 28

Multi-Layer Perceptrons: An Opaque Approach Examples: Output units weights Hidden Units Heteroassociation Input Units

Multi-Layer Perceptrons: An Opaque Approach Examples: Output units weights Hidden Units Heteroassociation Input Units Autoassociation 29

Representation in a Multi-Layer Perceptron • hj=g( w i ji. xi) • yk=g( wj

Representation in a Multi-Layer Perceptron • hj=g( w i ji. xi) • yk=g( wj kj. hj) Typically, y 1=1 for positive example and y 1=0 for negative example where g(x)= 1/(1+e -x) g (sigmoid): h 1 0 k h 3 j wkj’s 1 1/2 y 1 h 2 wji’s i 0 x 1 x 2 x 3 x 4 x 5 x 6 30

Neural Network: Learning (I) n n n The units are connected in order to

Neural Network: Learning (I) n n n The units are connected in order to create a network capable of computing complicated functions. Since the network has a sigmoid output, it implements a function f(x 1, x 2, x 3, x 4) where the output is in the range [0, 1] We are interested in neural network capable of learning that function. 31

Learning in a Multi-Layer Perceptron I ¨ Learning consists of searching through the space

Learning in a Multi-Layer Perceptron I ¨ Learning consists of searching through the space of all possible matrices of weight values for a combination of weights that satisfies a database of positive and negative examples (multi-class as well as regression problems are possible). ¨ It is an optimization problem which tries to minimize the sum of square error: E= 1/2 N n=1 K k=1 [yk-fk(x )] where N is the total number of training examples and K, the total number of output units (useful for multiclass problems) and fk is the function implemented by the neural net 32

Learning in a Multi-Layer Perceptron II n n n The optimization problem is solved

Learning in a Multi-Layer Perceptron II n n n The optimization problem is solved by searching the space of possible solutions by gradient. This consists of taking small steps in the direction that minimize the gradient (or derivative) of the error of the function we are trying to learn. When the gradient is zero we have reached a local minimum that we hope is also the global minimum. 33

Neural Network: Learning (II) n n Notice that a Neural Network with a set

Neural Network: Learning (II) n n Notice that a Neural Network with a set of adjustable weights represent a restricted hypothesis space corresponding to a family of functions. The size of this space can be increased or decreased by changing the number of hidden units in the network. Learning is done by a hill-climbing approach called backpropagation and is based on the paradigm of search by gradient. 34

Neural Network: Learning (III) n n The idea of search by gradient is to

Neural Network: Learning (III) n n The idea of search by gradient is to take small steps in the direction that minimize the gradient (or derivative) of the error of the function we are trying to learn. When the gradient is zero we have reached a local minimum that we hope is also the global minimum. 35

Description of Two classifier combination Schemes: - Bagging - Boosting 36

Description of Two classifier combination Schemes: - Bagging - Boosting 36

Combining Multiple Models n n n The idea is the following: In order to

Combining Multiple Models n n n The idea is the following: In order to make the outcome of automated classification more reliable, it may be a good idea to combine the decisions of several single classifiers through some sort of voting scheme Bagging and Boosting are the two most used combination schemes and they usually yield much improved results over the results of single classifiers One disadvantage of these multiple model combinations is that, as in the case of neural Networks, the learned model is hard, if not impossible, to interpret. 37

Bagging: Bootstrap Aggregating Bagging Algorithm Idea: perturb the composition of the data sets from

Bagging: Bootstrap Aggregating Bagging Algorithm Idea: perturb the composition of the data sets from which the classifier is trained. Learn a classifier from each different data set. Let these classifiers vote. This procedure reduces the portion of the performance error caused by variance in the 38 training set.

Boosting Algorithm Decrease the weight of the right answers Increase the weight of errors

Boosting Algorithm Decrease the weight of the right answers Increase the weight of errors Idea: To build models that complement each other. A first classifier is built. Its errors are given a higher weight than its right answers so that the next classifier being built focuses on these errors, etc… 39