Скачать презентацию Empirical Methods for AI and CS CS 1573 Скачать презентацию Empirical Methods for AI and CS CS 1573

8d03a04858085c00a89e6827dc0c893f.ppt

  • Количество слайдов: 49

Empirical Methods for AI (and CS) CS 1573: AI Application Development (after a tutorial Empirical Methods for AI (and CS) CS 1573: AI Application Development (after a tutorial by Paul Cohen, Ian P. Gent, and Toby Walsh)

Overview z Introduction y What are empirical methods? y Why use them? z Case Overview z Introduction y What are empirical methods? y Why use them? z Case Study z Experiment design z Data analysis 2

Empirical Methods for CS Part I : Introduction Empirical Methods for CS Part I : Introduction

What does “empirical” mean? z Relying on observations, data, experiments z Empirical work should What does “empirical” mean? z Relying on observations, data, experiments z Empirical work should complement theoretical work y Theories often have holes y Theories are suggested by observations y Theories are tested by observations y Conversely, theories direct our empirical attention z In addition (in this course at least) empirical means “wanting to understand behavior of complex systems” 4

Why We Need Empirical Methods Cohen, 1990 Survey of 150 AAAI Papers z Roughly Why We Need Empirical Methods Cohen, 1990 Survey of 150 AAAI Papers z Roughly 60% of the papers gave no evidence that the work they described had been tried on more than a single example problem. z Roughly 80% of the papers made no attempt to explain performance, to tell us why it was good or bad and under which conditions it might be better or worse. z Only 16% of the papers offered anything that might be interpreted as a question or a hypothesis. z Theory papers generally had no applications or empirical work to support them, empirical papers were demonstrations, not experiments, and had no underlying theoretical support. z The essential synergy between theory and empirical work was missing 5

Empirical CS/AI (Theory, not Theorems) z Computer programs are formal objects y so let’s Empirical CS/AI (Theory, not Theorems) z Computer programs are formal objects y so let’s reason about them entirely formally? z Two reasons why we can’t or won’t: y theorems are hard y some questions are empirical in nature e. g. are finite state automata adequate to represent the sort of knowledge met in practice? e. g. even though our problem is intractable in general, are the instances met in practice easy to solve? 6

Empirical CS/AI z Treat computer programs as natural objects y like fundamental particles, chemicals, Empirical CS/AI z Treat computer programs as natural objects y like fundamental particles, chemicals, living organisms z Build (approximate) theories about them y construct hypotheses e. g. greedy search is important to chess y test with empirical experiments e. g. compare search with planning y refine hypotheses and modelling assumptions e. g. greediness not important, but search is! 7

Empirical CS/AI z Many advantage over other sciences z Cost y no need for Empirical CS/AI z Many advantage over other sciences z Cost y no need for expensive super-colliders z Control y unlike the real world, we often have complete command of the experiment z Reproducibility y in theory, computers are entirely deterministic z Ethics y no ethics panels needed before you run experiments 8

Types of hypothesis z My search program is better than yours not very helpful Types of hypothesis z My search program is better than yours not very helpful beauty competition? z Search cost grows exponentially with number of variables for this kind of problem better as we can extrapolate to data not yet seen? z Constraint systems are better at handling over-constrained systems, but OR systems are better at handling underconstrained systems even better as we can extrapolate to new situations? 9

A typical conference conversation What are you up to these days? I’m running an A typical conference conversation What are you up to these days? I’m running an experiment to compare the Davis-Putnam algorithm with GSAT? Why? I want to know which is faster Why? Lots of people use each of these algorithms How will these people use your result? . . . 10

Keep in mind the BIG picture What are you up to these days? I’m Keep in mind the BIG picture What are you up to these days? I’m running an experiment to compare the Davis-Putnam algorithm with GSAT? Why? I have this hypothesis that neither will dominate What use is this? A portfolio containing both algorithms will be more robust than either algorithm on its own 11

Keep in mind the BIG picture. . . Why are you doing this? Because Keep in mind the BIG picture. . . Why are you doing this? Because many real problems are intractable in theory but need to be solved in practice. How does your experiment help? It helps us understand the difference between average and worst case results So why is this interesting? Intractability is one of the BIG open questions in CS! 12

Why is empirical CS/AI in vogue? z Inadequacies of theoretical analysis y problems often Why is empirical CS/AI in vogue? z Inadequacies of theoretical analysis y problems often aren’t as hard in practice as theory predicts in the worst-case y average-case analysis is very hard (and often based on questionable assumptions) z Some “spectacular” successes y phase transition behaviour y local search methods y theory lagging behind algorithm design 13

Why is empirical CS/AI in vogue? z Compute power ever increasing y even “intractable” Why is empirical CS/AI in vogue? z Compute power ever increasing y even “intractable” problems coming into range y easy to perform large (and sometimes meaningful) experiments z Empirical CS/AI perceived to be “easier” than theoretical CS/AI y often a false perception as experiments easier to mess up than proofs 14

Empirical Methods for CS Part II: A Case Study Empirical Methods for CS Part II: A Case Study

Case Study z Scheduling processors on ring network y jobs spawned as binary trees Case Study z Scheduling processors on ring network y jobs spawned as binary trees z KOSO y keep one, send one to my left or right arbitrarily z KOSO* y keep one, send one to my least heavily loaded neighbour 16

Theory z On complete binary trees, KOSO is asymptotically optimal z So KOSO* can’t Theory z On complete binary trees, KOSO is asymptotically optimal z So KOSO* can’t be any better? z But assumptions unrealistic y tree not complete y asymptotically not necessarily the same as in practice! 17

Lesson: Evaluation begins with claims Lesson: Demonstration is good, understanding better z Hypothesis (or Lesson: Evaluation begins with claims Lesson: Demonstration is good, understanding better z Hypothesis (or claim): KOSO takes longer than KOSO* because KOSO* balances loads better y The “because phrase” indicates a hypothesis about why it works. This is a better hypothesis than the beauty contest demonstration that KOSO* beats KOSO z Experiment design y Independent variables: KOSO v KOSO*, no. of processors, no. of jobs, probability(job will spawn), y Dependent variable: time to complete jobs 18

Criticism: This experiment design includes no direct measure of the hypothesized effect z Hypothesis: Criticism: This experiment design includes no direct measure of the hypothesized effect z Hypothesis: KOSO takes longer than KOSO* because KOSO* balances loads better z But experiment design includes no direct measure of load balancing: y Independent variables: KOSO v KOSO*, no. of processors, no. of jobs, probability(job will spawn), y Dependent variable: time to complete jobs 19

Lesson: The task of empirical work is to explain variability Empirical work assumes the Lesson: The task of empirical work is to explain variability Empirical work assumes the variability in a dependent variable (e. g. , run time) is the sum of causal factors and random noise. Statistical methods assign parts of this variability to the factors and the noise. Algorithm (KOSO/KOSO*) Number of processors run-time Number of jobs “random noise” (e. g. , outliers) Number of processors and number of jobs explain 74% of the variance in run time. Algorithm explains almost none. 20

Lesson: Keep the big picture in mind Why are you studying this? Load balancing Lesson: Keep the big picture in mind Why are you studying this? Load balancing is important to get good performance out of parallel computers Why is this important? Parallel computing promises to tackle many of our computational bottlenecks How do we know this? It’s in the first paragraph of the paper! 21

Empirical Methods for CS Part III : Experiment design Empirical Methods for CS Part III : Experiment design

Experimental Life Cycle z z z Exploration Hypothesis construction Experiment Data analysis Drawing of Experimental Life Cycle z z z Exploration Hypothesis construction Experiment Data analysis Drawing of conclusions 23

Types of experiment designs z Manipulation experiment z Observation experiment z Factorial experiment 24 Types of experiment designs z Manipulation experiment z Observation experiment z Factorial experiment 24

Manipulation experiment z Independent variable, x y x=identity of parser, size of dictionary, … Manipulation experiment z Independent variable, x y x=identity of parser, size of dictionary, … z Dependent variable, y y y=accuracy, speed, … z Hypothesis y x influences y z Manipulation experiment y change x, record y 25

Observation experiment z Predictor, x y x=volatility of stock prices, … z Response variable, Observation experiment z Predictor, x y x=volatility of stock prices, … z Response variable, y y y=fund performance, … z Hypothesis y x influences y z Observation experiment y classify according to x, compute y 26

Factorial experiment z Several independent variables, xi y there may be no simple causal Factorial experiment z Several independent variables, xi y there may be no simple causal links y data may come that way e. g. programs have different languages, algorithms, . . . z Factorial experiment y every possible combination of xi considered y expensive as its name suggests! 27

Some problem issues z Control z Ceiling and Floor effects z Sampling Biases 28 Some problem issues z Control z Ceiling and Floor effects z Sampling Biases 28

Control z A control is an experiment in which the hypothesised variation does not Control z A control is an experiment in which the hypothesised variation does not occur y so the hypothesized effect should not occur either z BUT remember y placebos cure a large percentage of patients! 29

Control: MYCIN case study z MYCIN was a medial expert system y recommended therapy Control: MYCIN case study z MYCIN was a medial expert system y recommended therapy for blood/meningitis infections z How to evaluate its recommendations? z Shortliffe used y 10 sample problems, 8 therapy recommenders x 5 faculty, 1 resident, 1 postdoc, 1 student y 8 impartial judges gave 1 point per problem y max score was 80 y Mycin 65, faculty 40 -60, postdoc 60, resident 45, student 30 30

Control: MYCIN case study z What were controls? z Control for judge’s bias for/against Control: MYCIN case study z What were controls? z Control for judge’s bias for/against computers y judges did not know who recommended each therapy z Control for easy problems y medical student did badly, so problems not easy z Control for our standard being low y e. g. random choice should do worse z Control for factor of interest y e. g. hypothesis in MYCIN that “knowledge is power” y have groups with different levels of knowledge 31

Ceiling and Floor Effects z Well designed experiments (with good controls) can still go Ceiling and Floor Effects z Well designed experiments (with good controls) can still go wrong z What if all our algorithms do particularly well y Or they all do badly? z We’ve got little evidence to choose between them 32

Ceiling and Floor Effects z Ceiling effects arise when test problems are insufficiently challenging Ceiling and Floor Effects z Ceiling effects arise when test problems are insufficiently challenging y floor effects the opposite, when problems too challenging z A problem in AI because we often repeatedly use the same benchmark sets y most benchmarks will lose their challenge eventually? y but how do we detect this effect? 33

Ceiling Effects: machine learning z 14 datasets from UCI corpus of benchmarks y used Ceiling Effects: machine learning z 14 datasets from UCI corpus of benchmarks y used as mainstay of ML community z Problem is learning classification rules y each item is vector of features and a classification y measure classification accuracy of method (max 100%) z Compare C 4 with 1 R*, two competing algorithms 34

Ceiling Effects: machine learning Data. Set: C 4 1 R* Max y y BC Ceiling Effects: machine learning Data. Set: C 4 1 R* Max y y BC 72 72. 5 CH 99. 2 69. 2 99. 2 GL 63. 2 56. 4 63. 2 G 2 74. 3 77 77 HD 73. 6 78 78 HE 81. 2 85. 1 …. . . … Mean 85. 9 83. 8 87. 4 C 4 achieves only about 2% better than 1 R* Best of the C 4/1 R* achieves 87. 4% accuracy We have only weak evidence that C 4 better Both methods performing near ceiling of possible so comparison hard! 35

Ceiling Effects: machine learning z z In fact 1 R* only uses one feature Ceiling Effects: machine learning z z In fact 1 R* only uses one feature (the best one) C 4 uses on average 6. 6 features 5. 6 features buy only about 2% improvement Conclusion? y Either real world learning problems are easy (use 1 R*) y Or we need more challenging datasets y We need to be aware of ceiling effects in results 36

Sampling bias z Data collection is biased against certain data y e. g. teacher Sampling bias z Data collection is biased against certain data y e. g. teacher who says “Girls don’t answer maths question” y observation might suggest: x girls don’t answer many questions x but that the teacher doesn’t ask them many questions z Experienced AI researchers don’t do that, right? 37

Sampling bias: Phoenix case study z AI system to fight (simulated) forest fires z Sampling bias: Phoenix case study z AI system to fight (simulated) forest fires z Experiments suggest that wind speed uncorrelated with time to put out fire y obviously incorrect as high winds spread forest fires 38

Sampling bias: Phoenix case study z Wind Speed vs containment time (max 150 hours): Sampling bias: Phoenix case study z Wind Speed vs containment time (max 150 hours): 3: 120 55 79 10 140 26 15 110 54 10 103 6: 78 61 58 81 71 57 21 32 9: 62 48 21 55 101 z What’s the problem? 12 70 39

Sampling bias: Phoenix case study z The cut-off of 150 hours introduces sampling bias Sampling bias: Phoenix case study z The cut-off of 150 hours introduces sampling bias y many high-wind fires get cut off, not many low wind z On remaining data, there is no correlation between wind speed and time (r = -0. 53) z In fact, data shows that: y a lot of high wind fires take > 150 hours to contain y those that don’t are similar to low wind fires z You wouldn’t do this, right? y you might if you had automated data analysis. 40

Empirical Methods for CS Part IV: Data analysis Empirical Methods for CS Part IV: Data analysis

Kinds of data analysis z Exploratory (EDA) – looking for patterns in data z Kinds of data analysis z Exploratory (EDA) – looking for patterns in data z Statistical inferences from sample data y Testing hypotheses y Estimating parameters z Building mathematical models of datasets z Machine learning, data mining… z We will introduce hypothesis testing and computer-intensive methods 42

The logic of hypothesis testing z Example: toss a coin ten times, observe eight The logic of hypothesis testing z Example: toss a coin ten times, observe eight heads. Is the coin fair (i. e. , what is it’s long run behavior? ) and what is your residual uncertainty? z You say, “If the coin were fair, then eight or more heads is pretty unlikely, so I think the coin isn’t fair. ” z Like proof by contradiction: Assert the opposite (the coin is fair) show that the sample result (≥ 8 heads) has low probability p, reject the assertion, with residual uncertainty related to p. z Estimate p with a sampling distribution. 43

The logic of hypothesis testing z Establish a null hypothesis: H 0: p =. The logic of hypothesis testing z Establish a null hypothesis: H 0: p =. 5, the coin is fair z Establish a statistic: r, the number of heads in N tosses z Figure out the sampling distribution of r given H 0 0 1 2 3 4 5 6 7 8 9 10 z The sampling distribution will tell you the probability p of a result at least as extreme as your sample result, r = 8 z If this probability is very low, reject H 0 the null hypothesis z Residual uncertainty is p 44

A common statistical test: The Z test for different means z A sample N A common statistical test: The Z test for different means z A sample N = 25 computer science students has mean IQ m=135. Are they “smarter than average”? z Population mean is 100 with standard deviation 15 z The null hypothesis, H 0, is that the CS students are “average”, i. e. , the mean IQ of the population of CS students is 100. z What is the probability p of drawing the sample if H 0 were true? If p small, then H 0 probably false. z Find the sampling distribution of the mean of a sample of size 25, from population with mean 100 45

Reject the null hypothesis? z Commonly we reject the H 0 when the probability Reject the null hypothesis? z Commonly we reject the H 0 when the probability of obtaining a sample statistic (e. g. , mean = 135) given the null hypothesis is low, say <. 05. z A test statistic value, e. g. Z = 11. 67, recodes the sample statistic (mean = 135) to make it easy to find the probability of sample statistic given H 0. z We find the probabilities by looking them up in tables, or statistics packages provide them. y For example, Pr(Z ≥ 1. 67) =. 05; Pr(Z ≥ 1. 96) =. 01. z Pr(Z ≥ 11) is approximately zero, reject H 0. 46

Summary of hypothesis testing z H 0 negates what you want to demonstrate; find Summary of hypothesis testing z H 0 negates what you want to demonstrate; find probability p of sample statistic under H 0 by comparing test statistic to sampling distribution; if probability is low, reject H 0 with residual uncertainty proportional to p. z Example: Want to demonstrate that CS graduate students are smarter than average. H 0 is that they are average. t = 2. 89, p ≤. 022 z Have we proved CS students are smarter? NO! z We have only shown that mean = 135 is unlikely if they aren’t. We never prove what we want to demonstrate, we only reject H 0, with residual uncertainty. z And failing to reject H 0 does not prove H 0, either! 47

Computer-intensive Methods z Basic idea: Construct sampling distributions by simulating on a computer the Computer-intensive Methods z Basic idea: Construct sampling distributions by simulating on a computer the process of drawing samples. z Three main methods: y Monte carlo simulation when one knows population parameters; y Bootstrap when one doesn’t; y Randomization, also assumes nothing about the population. z Enormous advantage: Works for any statistic and makes no strong assumptions (e. g. , normality) 48

Summary z Empirical CS and AI are exacting sciences y There are many ways Summary z Empirical CS and AI are exacting sciences y There are many ways to do experiments wrong z We are experts in doing experiments badly z As you perform experiments, you’ll make many mistakes z Learn from those mistakes, and ours! 49