# Rattle: Data Mining by Example # # Copyright (c) 2011 Graham.Williams@togaware.com source("datasets.R") weatherGLM <- new.env(parent=weatherDS) evalq({ # We build the model using just the numeric variables since otherwise # there are a lot of indicator variables created based on each of the # categoric variables. build.time <- system.time(model <- glm(formula=form, data=data[train, c(numerics, target)], family=binomial(link="logit"))) pr <- predict(model, type="response", data[test, numerics]) cl <- ifelse(pr > 0.5, "Yes", "No") doRiskChart(pr, data, test, target, risk, main="Risk Chart glm weather [test] RISK_MM") }, weatherGLM) weatherGLM$build.time