naiveBayes2_4perPage

# NaiveBayes2_4perPage - Outline 1 Announcements Review Naive Bayes Prediction Summary Example Alternative Prediction Method More Examples More Naive

This preview shows pages 1–4. Sign up to view the full content.

More Naive Bayes Data Mining Prof. Dawn Woodard School of ORIE Cornell University 1 Outline 1 Announcements 2 Review 3 Naive Bayes Prediction 4 Summary / Example 5 Alternative Prediction Method 6 More Examples 2 Questions? 4 Debugging Functions What’s the easiest way to debug a function? 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Debugging Functions What’s the easiest way to debug a function? “print” statements! Add them to the function, then run the function on your data print out objects created in the function, e.g. print( myObj ) print out the class of these objects, e.g. print( is.data.frame( myObj ) ) 6 Debugging Functions olivePred <- function( dat ) { nData <- dim( dat )[1] predRegion <- rep( 0, nData ) for( i in (1:nData) ) { ... predRegion [i]<-. .. } return( predRegion ) } 7 Debugging Functions olivePred <- function( dat ) { nData <- dim( dat )[1] print( nData ) predRegion <- rep( 0, nData ) for( i in (1:nData) ) { ... predRegion } return( predRegion ) } 8 Debugging Functions olivePred <- function( dat ) { nData <- dim( dat )[1] predRegion <- rep( 0, nData ) print( length( predRegion ) ) for( i in (1:nData) ) { ... predRegion } return( predRegion ) } 9
Debugging Functions olivePred <- function( dat ) { nData <- dim( dat )[1] predRegion <- rep( 0, nData ) for( i in (1:nData) ) { ... predRegion [i]<-. .. print( predRegion[i]) } return( predRegion ) } 10 Debugging Functions olivePred <- function( dat ) { nData <- dim( dat )[1] predRegion <- rep( 0, nData ) for( i in (1:nData) ) { ... predRegion } print( is.vector( predRegion ) ) return( predRegion ) } 11 Bayes’ Theorem (Ross, 2006) If a student guesses on a multiple-choice question with 4 choices, they have probability 1/4 of being correct. Say that students have a probability p of knowing the correct answer to a particular multiple-choice question (4 choices), and otherwise they guess. If a student gets the question correct, what is the probability that they guessed?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/23/2009 for the course ORIE 4740 at Cornell University (Engineering School).

### Page1 / 11

NaiveBayes2_4perPage - Outline 1 Announcements Review Naive Bayes Prediction Summary Example Alternative Prediction Method More Examples More Naive

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online