This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "altrepisode.h" | |
#include <string> | |
#include <vector> | |
std::string getRandomStrings(int seed, int len = 30) { | |
std::srand(static_cast<unsigned int>(seed)); | |
static const char alphanum[] = | |
"0123456789" | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fastROC <- function(probs, class) { | |
class_sorted <- class[order(probs, decreasing=T)] | |
TPR <- cumsum(class_sorted) / sum(class) | |
FPR <- cumsum(class_sorted == 0) / sum(class == 0) | |
return(list(tpr=TPR, fpr=FPR)) | |
} | |
# Helpful function adapted from: https://stat.ethz.ch/pipermail/r-help/2005-September/079872.html | |
fastAUC <- function(probs, class) { | |
x <- probs |
NewerOlder