Docsity

Lecture Slides on Decision Tree - Artificial Intelligence Programming | CS 662, Study notes of Computer Science

Partial preview of the text

Download Lecture Slides on Decision Tree - Artificial Intelligence Programming | CS 662 and more Study notes Computer Science in PDF only on Docsity!

Artificial Intelligence

Programming^ Decision Trees

Chris Brooks Department of Computer ScienceUniversity of San Francisco

Rule Learning Previously, we’ve assumed that background knowledgewas given to us by experts.^ Focused on how to use that knowledge. Today, we’ll talk about how to acquire that knowledgefrom observation. Focus on learning propositional rules^ sunny

∧^ warm

→^ P layT ennis cool^ ∧

(rain

∨^ strongW ind

)^ → ¬

P layT ennis^ Department of Computer Science — University of San Francisco – p.1/

Learning What does it mean for an agent to learn? Agent acquires new knowledge Agent changes its behavior Agent improves its performance measure on a giventask

Department of Computer Science — University of San Francisco – p.3/

Learning Agents Recall that at the beginning of the semester we talkedabout

learning agents Performance standard Agent

Environment

Sensors Performanceelement changesknowledge Critic feedback Learningelementlearninggoals Problemgenerator

Actuators

Department of Computer Science — University of San Francisco – p.4/

Deduction vs. Induction Up to now, we’ve looked at cases where our agent isgiven general knowledge and uses this to solve aparticular problem.^ Exactly two people like Homer, Suck always cleans aroom, etc.^ This general-to-specific reasoning is known as^ deduction

Advantage: deduction is sound, assuming yourknowledge is correct.

Department of Computer Science — University of San Francisco – p.6/

Deduction vs. Induction Sometimes, you may not have general information abouta problem. Instead, you might have

data about particular instances

of a problem. The problem then is to figure out a general rule fromspecific data. This is called

induction

  • most learning is an inductive

process.^ Problem: induction is not sound.

Department of Computer Science — University of San Francisco – p.7/

Types of Learning Tasks There are essentially three categories of learning tasks,each of which provides different feedback. They vary in the amount of information that is availableto our learning algorithm. Supervised learning.^ In this case, an external source (often called ateacher) provides the agent with

labeled examples

Agent sees specific actions/cases, along with theirclassification. D2 was Sunny, mild, high humidity and weak wind. Weplayed tennis.

Department of Computer Science — University of San Francisco – p.9/

Types of Learning Tasks Unsupervised Learning^ In this case, there is no teacher to provide examples.^ The agent typically tries to find a “concept” or patternin data.^ Statistical methods such as clustering fall into thiscategory^ Our agent might be told that day1, day 4 and day 7are similar and need to determine whatcharacteristics make these days alike.

Department of Computer Science — University of San Francisco – p.10/

Supervised Learning Supervised learning is one of the most common formsof learning. Agent is presented with a set of labeled data and mustuse this data to determine more general rules. Examples:^ List of patients and characteristics: what factors arecorrelated with cancer?^ What factors make someone a credit risk?^ What are the best questions for classifying animals?^ Whose face is in this picture? This is the form of learning we will spend most of ourtime on.

Department of Computer Science — University of San Francisco – p.12/

Classification the particular learning problem we are focusing on issometimes known as

classification

For a given input, determine which class it belongs to. Programs that can perform this task are referred to as classifiers

Department of Computer Science — University of San Francisco – p.13/

Induction We would like

H^ to

generalize

This means that

H^ will correctly classify unseen

examples. If the hypothesis can correctly classify all of the trainingexamples, we call it a

consistent

hypothesis.

Goal: find a consistent hypothesis that also performswell on unseen examples. We can think of learning as search through a space ofhypotheses.

Department of Computer Science — University of San Francisco – p.15/

Inductive Bias Notice that induction is not sound. In picking a hypothesis, we make an educated guessabout how to classify unseen data. The way in which we make this guess is called a

bias.

All learning algorithms have a bias; identifying it canhelp you understand the sorts of errors it will make. Examples:^ Occam’s razor^ Most specific hypothesis.^ Most general hypothesis.^ Linear function

Department of Computer Science — University of San Francisco – p.16/

Online vs Offline An^ offline

learing algorithm is able to separate learning from execution.^ Learning and performance are separate^ Batch learning is easier, computational complexity isless of a factor. An^ online

learning algorithm allows an agent to mix learning and execution.^ Agent takes actions, receives feedback, and updatesits performance component.^ Incremental learning makes more sense, fastalgorithms a requirement. We will worry about both training time (time needed toconstruct a hypothesis) and classification time (timeneeded to classify a new instance).

Department of Computer Science — University of San Francisco – p.18/

Learning Decision Trees Decision trees are data structures that provide an agentwith a means of classifying examples. At each node in the tree, an attribute is tested.

Feathers? Yes^

No

Does it Fly?^

Does it Eat Meat?

No Yes Yes Does it havelong legs?^

Albatross Yes Ostrich No No Penguin

Does it haveBlack Stripes?Yes No Tiger

Does it havea long neck? Cheetah

Yes^

No Giraffe^

Zebra Department of Computer Science — University of San Francisco – p.19/