Learning Rules from Positive Examples: Algorithms and Techniques - Prof. Dan Roth, Study notes of Computer Science

Various techniques for learning rules from positive examples, including decision trees to rules, learning rules with sequential covering, and learning rules bottom-up. The document also compares rule learning to knowledge engineering and introduces inductive logic programming. Examples and explanations of algorithms such as foil.

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-6nf-1
koofers-user-6nf-1 🇺🇸

9 documents

1 / 102

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Learning Rules CS346-Spring08 1
If-Then Rules are a standard knowledge representation that has proven
useful in building expert systems
if (Outlook = overcast) then Play_Tennis = YES
if (Outlook = sunny) (Humidity = high) then Play_Tennis = No
Relatively easy for people to understand
Useful in providing insight and understanding of the regularities in the data
Learning Rules
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Learning Rules from Positive Examples: Algorithms and Techniques - Prof. Dan Roth and more Study notes Computer Science in PDF only on Docsity!

Learning Rules

CS346-Spring

  • If-Then Rules

are a standard knowledge representation that has proven

useful in building expert systems^ if (Outlook = overcast)

then Play_Tennis = YES

if (Outlook = sunny)

∧^

(Humidity = high) then Play_Tennis = No

  • Relatively easy for people to understand • Useful in providing insight and understanding of the regularities in the data

Learning Rules

Learning Rules

CS346-Spring

  • If-Then Rules

are a standard knowledge representation that has proven

useful in building expert systems^ if (Outlook = overcast)

then Play_Tennis = YES

if (Outlook = sunny)

∧^

(Humidity = high) then Play_Tennis = No

  • Relatively easy for people to understand • Useful in providing insight and understanding of the regularities in the data • Used a lot in data mining • There are a number of methods for inducing sets of rules from data • Rule learning methods can be extended to handle

relational representations

(first-order-representations; inductive logic programming)

Learning Rules

Learning Rules

CS346-Spring

4

Example: Relational Learning

Inductive Logic Programming

  • Finding a path in a directed acyclic graph • What is the definition of a path? • Definition in terms of what? • If you want to learn this definition, what will the input be?
  • Today:^ • Some Background^ • The difficulties in Learning Rules -^ Learning Sets of Rules • Rule Learning Algorithm(s) • Generalization to relational Learning

Learning Rules

CS346-Spring

-^ Set of Rules:

Knowledge Representation

2 k 2 1

1 m 2 1

C Y ... Y or.. Y

C X ... X X

→ ∧ ∧ ∧

→ ∧ ∧ ∧

-^ Disjunctive Rules:DNF:

Disjunction of all rules with

YES

as a consequent

-^ Ordered set of Rules:Decision Lists:

If (Condition-1)

then C

Else if (Condition-2)

then D

…… Else^

Learning Rules

CS346-Spring

Basic Concepts: Frequent Patterns and

Association Rules

-^ Itemset X={x

, …, x 1

}k^

-^ Find all the rules

X^ Æ

Y^ with min

confidence and support– support,

s , fraction of examples that contain both X and Y– confidence,

c,^ fraction of examples that contain X that also contain Y. Let min_support = 50%,min_conf = 50%:A^

Æ^ C (s,c) =

C^ Æ

A (s,c) =

Customerbuys diaper Customerbuys both Transaction-id Customerbuys beer

Items bought 10

A, B, C

20

A, C

30

A, D

40

B, E, F

Learning Rules

CS346-Spring

Learning Rules

•^ We will view Rule Learning in the context ofClassification. The goal is to represent a function(Boolean function; multi-value function) as a collection ofrules. •^ As the example of Data Mining shows, rules can be usefulfor other things. For example, it is possible to view themas features, to be used by other learning algorithms.

What does it mean?

Learning Rules

CS346-Spring

Decision Trees to Rules

ColorBlue Green Red

Yes Shape

No

Triangle

Circle^ No^

Yes Square^ Yes

For each path in the decision tree create a rule

Learning Rules

CS346-Spring

Decision Trees to Rules^ No

Circle Red^

→ ∧

ColorBlue Green Red

Yes Shape

No

Triangle

Circle^ No^

Yes Square^ Yes

Yes Square Red^

→ ∧

Yes

Triangle Red^

Yes Blue

No Green

Learning Rules

CS346-Spring

Decision Trees to Rules

ColorBlue Green Red

B

Shape

C

Triangle

Circle^ A^

C

Square^ B

In the general case:

A Circle Red^

→ ∧^

B

Square Red^

→ ∧

C

Triangle Red^

B Blue

C Green

Learning Rules

CS346-Spring

14

Decision Trees to Rules

ColorBlue Green Red

B

Shape

C

Triangle

Circle^ A^

C

Square^ B

  • Resulting rules may contain unnecessary antecedents that are not needed toeliminate negative examples or that result in overfitting the data (same as inDecision Trees)• Post-prune the rules using MDL, cross-validations or related methods• After Pruning, rules may conflict (fire together and assign different categoriesto a single novel test instances).

(unlike Decision Trees

In the general case:

A Circle Red^

→ ∧^

B

Square Red^

→ ∧

C

Triangle Red^

B Blue

C Green

Learning Rules

CS346-Spring

Decision Trees to Rules

ColorBlue Green Red

Yes Shape

No

Triangle

Circle^ No^

Yes Square^ Yes

Yes Square Red^

→ ∧

Yes

Triangle Red^

Yes Blue

→ Solution: • Sort rules by observed accuracy on the training data; treat the rules as an^ ordered set. E.g:^

Decision list: If, Then, else

Learning Rules

CS346-Spring

The Current Best Learning Algorithm Day^ Outlook

Temperature

Humidity

Wind

PlayTennis

1

Sunny

Hot^

High

Weak

No

2

Sunny

Hot^

High

Strong

No

3

Overcast

Hot

High

Weak

Yes

4

Rain

Mild

High

Weak

Yes

5

Rain

Cool^

Normal

Weak

Yes

6

Rain

Cool^

Normal

Strong

No

7

Overcast

Cool

Normal

Strong

Yes

8

Sunny

Mild

High

Weak

No

9

Sunny

Cool^

Normal

Weak

Yes

10

Rain

Mild

Normal

Weak

Yes

11

Sunny

Mild

Normal

Strong

Yes

12

Overcast

Mild

High

Strong

Yes

13

Overcast

Hot^

Normal

Weak

Yes

14

Rain

Mild

High

Strong

No

Learning Rules

CS346-Spring

The Current Best Learning Algorithm

  • H: Any hypothesis consistent with the first example in Examples •^ For each remaining example e in Examples^ •

If e is false positive for H (it is negative, H says it’s positive)^ •^

H : a specialization of H that is consistent with Examples

-^ Else if e is false negative for H (it is positive, H says it’s negative)^ •

H : a generalization of H that is consistent with Examples

-^ If no consistent specialization/generalization can be found^ •

Fail;

-^ return H •^ The Algorithm needs to choose generalizations and specializations^ (there may be several). If it gets into trouble it has to backtrack to an^ earlier decision or otherwise it fails.

Learning Rules

CS346-Spring

The Current Best Learning Algorithm

Learn the rule structure and the set of rules simultaneously, greedily. •^ Generalization:^ •

Remove a conjunct

(sunny and normal

to

sunny)

-^ Add a disjunct

(sunny

to^

sunny or cool)

-^ Specialization:^ •

Add a conjunctRemove a disjunct

When to add and when to remove?Credit Assignment problem

True Concept