hw # 4- Graphical models

# hw # 4- Graphical models - ORIE 4740 HW 4 b <...

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

ORIE 4740 – HW # 4 b <- nb.train(incomeTrain) c <- nb.predict(D = incomeTest, nb = b, threshold = 0.5) c predClass trueClass <=50K >50K <=50K 2003 272 >50K 356 369 \$error.rate [1] 0.2093333 So, the overall error rate before adding the edge is 20.9%. The false positive rate is 272/(2003+2003) = 12.0%. The false negative rate is 356/(356+369) = 49.1%. e <- nb.predict(D = incomeTest1, nb = d, threshold = 0.5) e # predClass #trueClass <=50K >50K # <=50K 22665 2055 # >50K 3979 3862 #\$error.rate #[1] 0.1853137 After adding the edge, the overall rate is 18.6%. The false positive rate = 2055/(22265+2055) = 8.3% and the false negative rate = 50.7%. The false positive rate has decreased ~4% and the false negative rate has increased by ~1%.

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

View Full Document
2) > x = c(1,384/(189+384),272/(272+2003),211/(2064+211),0) > y = c(1,485/(485+240),369/(369+356),322/(322+403),0) > plot(x,y,type = "l") > x = c(1,4734/(4734+19986),3470/(3470+21250),2658/(2658+22062),1556/(23164+1556),0) > y = c(1,5619/(5619+2222),4852/(4852+2989),4155/(4155+3686),3432/(3432+4409),0)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

hw # 4- Graphical models - ORIE 4740 HW 4 b <...

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

View Full Document
Ask a homework question - tutors are online