d1.stat.quantile <- function(d,l=0.2){
cut(d,breaks=quantile(d, probs=seq(0,1, by=l), na.rm=TRUE),
include.lowest=TRUE,labels=1:(1/l))
}
d1.stat.MSE <- function(predicted,actual)
{
return(mean((predicted-actual)^2,na.rm=T))
}
d1.stat.huber <- function(predict,actual)
{
return(sum(abs(predicted-actual),na.rm=T))
}
d1.stat.cor <- function(predicted,actual,weight)
{
ans = wtd.cor(predicted,actual,weight)
return(list(cor=ans[1],pVal=ans[2]))
}
d1.stat.hit <- function(predicted,actual) {
isComplete = complete.cases(predicted) && complete.cases(actual)
predicted = predicted[isComplete]
actual = actual[isComplete]
return(sum(predicted*actual>0)/length(predicted))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.