Displaying 2 results from an estimated 2 matches for "logistic_reg".
2009 Oct 11
3
passing field name parameter to function
...ing to pass field name to a function
logistictest <- function(df,mytarget)
{
#library for AUC calculation
library(caTools)
#build logistic model
mytarget <- deparse(substitute(mytarget))
myformula <- paste(mytarget," ~ .")
myformula <- deparse(substitute(myformula))
logistic_reg <- glm(myformula , data=df, family=binomial(link="logit"))
print("model build OK")
#score up
scores <- predict(logistic_reg, type="response", df)
print("model scored OK")
#calc AUC
Y = df$mytarget
auc <- colAUC(scores,Y)
print("auc ca...
2009 Oct 10
1
field names as function parameters
...# trying to pass field name to a function
logistictest <- function(df,mytarget)
{
#library for AUC calculation
library(caTools)
#build logistic model
mytarget <- deparse(substitute(mytarget))
myformula <- paste(mytarget," ~ .")
myformula <- deparse(substitute(myformula))
logistic_reg <- glm(myformula , data=df, family=binomial(link="logit"))
print("model build OK")
#score up
scores <- predict(logistic_reg, type="response", df)
print("model scored OK")
#calc AUC
Y = df$mytarget
auc <- colAUC(scores,Y)
print("auc calculated...