<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
  This file uses MATHML. Internet Explorer does not support MATHML.
  You can use Mozilla to view this file. -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<title>Learn-One-Rule Algorithm</title>
<meta name="AUTHOR" content="Jose M Vidal"></meta>
<meta name="GENERATOR" content="xslides.el, written by J.M. Vidal"></meta>
<link rel="next" href="learn-one-ruleexample.5.xml" title="Learn-One-Rule Example"/>
<link rel="previous" href="learn-one-rule.xml"  title="Learn-One-Rule"/>
<link rel="author" href="../../index.html" title="Jose M Vidal"/>
<link rel="parent" href="index.xml" title="Index"/>
<link rel="top" href="../index.html" title="Presentation List"/>

<link rel="stylesheet" type="text/css" href="../xslides-medwhite.css" title="White" media="all" />
 	    <link rel="alternate stylesheet" type="text/css" href="../xslides-medblue.css" title="Blue" media="all" />
 	    <link rel="alternate stylesheet" type="text/css" href="../xslides-usc.css" title="USCTheme" media="all" />
<script language="javascript" type="text/javascript" src="../scripts/stylehelper.js"></script>
</head>
<body>
<div class="navbar">
<p>
<a onclick="javascript:this.href=getURL('learn-one-rule.xml');return true;" rel="prev" href="learn-one-rule.xml" accesskey="P" title="Learn-One-Rule">&larr;</a>
<a rel="index" href="index.xml" onclick="javascript:this.href=getURL('index.xml');return true;" accesskey="I" title="Index Page">^</a>
<a rel="next" href="learn-one-ruleexample.5.xml" onclick="javascript:this.href=getURL('learn-one-ruleexample.5.xml');return true;" accesskey="N" title="Learn-One-Rule Example">&rarr;</a>
</p>
</div>
<h1 class="slide">Learn-One-Rule Algorithm</h1>
<div class="slidebody">
<code>
<span class="function-name">Learn-One-Rule</span>(target_attribute, attributes, examples, k)<br/>
<span class="comment">;Returns a single rule that covers some of the Examples</span><br/>
&nbsp;&nbsp;best-hypothesis = the most general hypothesis<br/>
&nbsp;&nbsp;candidate-hypotheses = {best-hypothesis}<br/>
&nbsp;&nbsp;<span class="keyword">while</span> candidate-hypothesis
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">;Generate the next more specific candidate-hypotheses</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;all-constraints = all "att.=val." contraints<br/>
&nbsp;&nbsp;&nbsp;&nbsp;new-candidate-hypotheses = all specializations of candidate-hypotheses by adding all-constraints<br/>
&nbsp;&nbsp;&nbsp;&nbsp;remove from new-candidate-hypotheses any that are duplicates, inconsistent, or not maximally specific<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">;Update best-hypothesis</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;best-hypothesis = <math xmlns="http://www.w3.org/1998/Math/MathML">
<msub><mo lspace="0em" rspace="thinmathspace">argmax</mo> <mrow><mi>h</mi>
<mo>&Element;</mo><mtext>new-candidate-hypotheses</mtext></mrow></msub>

</math> <span class="function-name">Performance</span>(h,examples,target_attribute)<br/>
&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">;Update candidate-hypotheses</span><br/>
&nbsp;&nbsp;&nbsp;&nbsp;candidate-hypotheses = the k best from new-candidate-hypotheses according to Performance.<br/>
&nbsp;&nbsp;prediction = most frequent value of target_attribute from examples that match best-hypothesis<br/>
&nbsp;&nbsp;<span class="keyword">return</span> IF best-hypothesis THEN prediction<br/>
<br/>
<br/>
<span class="function-name">Performance</span>(h, examples, target_attribute)<br/>
&nbsp;&nbsp;h-examples = the set of examples that match h<br/>
&nbsp;&nbsp;<span class="keyword">return</span> - Entropy(h-examples) wrt target_attribute<br/>
</code>
    </div><hr class="bottom"/>
<table class="footer" cellspacing="0" cellpadding="0" border="0" width="97%" summary="footer">
<tr valign="bottom">
<td><p class="author"><a href="../../index.html">Jos&eacute; M. Vidal</a>
<a class="remote" href=" http://validator.w3.org/check?uri=http://jmvidal.cse.sc.edu/talks/learningrules/learn-one-rulealgorithm.xml">.</a></p>
</td>
<td align="right"><p class="index">5 of 47</p></td>
</tr>
</table>
</body>
</html>