inst/doc/Definition.R

### R code from vignette source 'Definition.Rnw'

###################################################
### code chunk number 1: curve
###################################################
y <- c(-1, -1, 1, 1, 1)
w <- c(1, 1, 1, 4, 5)
y.hat <- c(1, 2, 3, 1, 1)
library(WeightedROC)
tp.fp <- WeightedROC(y.hat, y, w)
library(ggplot2)
ggplot()+
  geom_path(aes(FPR, TPR), data=tp.fp)+
  coord_equal()


###################################################
### code chunk number 2: auc
###################################################
WeightedAUC(tp.fp)

Try the WeightedROC package in your browser

Any scripts or data that you put into this service are public.

WeightedROC documentation built on Feb. 1, 2020, 9:07 a.m.