Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > confusion=function(x,y)
- + {
- + value=table(x,y)
- +
- + a=value[1,1]
- + b=value[1,2]
- + c=value[2,1]
- + d=value[2,2]
- +
- + SE=d/(c+d)
- + SP=a/(a+b)
- + AC=(a+d)/(a+b+c+d)
- +
- + out=c(AC,SE,SP)
- + names(out)=c("Accuracy","Sensitivity","Specificity")
- + round(out,4)
- + }
- //en dan moet je gewoon dit typen
- confusion(data$Churn,prediction>0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement