Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. > confusion=function(x,y)
  2. + {
  3. + value=table(x,y)
  4. +
  5. + a=value[1,1]
  6. + b=value[1,2]
  7. + c=value[2,1]
  8. + d=value[2,2]
  9. +
  10. + SE=d/(c+d)
  11. + SP=a/(a+b)
  12. + AC=(a+d)/(a+b+c+d)
  13. +
  14. + out=c(AC,SE,SP)
  15. + names(out)=c("Accuracy","Sensitivity","Specificity")
  16. + round(out,4)
  17. + }
  18.  
  19. //en dan moet je gewoon dit typen
  20.  
  21. confusion(data$Churn,prediction>0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement