slds-lmu / ame

average marginal effects for machine learning
Other
1 stars 1 forks source link

allow changable positive class #3

Open giuseppec opened 7 years ago

giuseppec commented 7 years ago
data("SwissLabor", package = "AER")
swiss_probit <- glm(participation ~ . + I(age^2),
  data = SwissLabor, family = binomial(link = "probit"))
summary(swiss_probit)
fav <- mean(dnorm(predict(swiss_probit, type = "link")))
fav * coef(swiss_probit)

ame.no = computeAME(swiss_probit, data = SwissLabor, cl = "no",
  features = c("oldkids"))

ame.yes = computeAME(swiss_probit, data = SwissLabor, cl = "yes",
  features = c("oldkids"))
ame.no
ame.yes # sign should be different here

check if that works also for mlr and caret