This function produces a logistic regression tree: a decision tree with logistic regressions at its leaves.

glmtree(
  x,
  y,
  K = 10,
  iterations = 200,
  test = FALSE,
  validation = FALSE,
  proportions = c(0.3),
  criterion = "bic",
  ctree_controls = partykit::ctree_control(alpha = 0.1, minbucket = 100, maxdepth = 5)
)

Arguments

x

The features to use for prediction.

y

The binary / boolean labels to predict.

K

The number of segments to start with (maximum number of segments there'll be in the end).

iterations

The number of iterations to do in the SEM protocole (default: 200).

test

Boolean : True if the algorithm should use predictors to construct a test set on which to calculate the provided criterion using the best discretization scheme (chosen thanks to the provided criterion on either the test set (if true) or the training set (otherwise)) (default: TRUE).

validation

Boolean : True if the algorithm should use predictors to construct a validation set on which to search for the best discretization scheme using the provided criterion (default: TRUE).

proportions

The list of the proportions wanted for test and validation set. Not used when both test and validation are false. Only the first is used when there is only one of either test or validation that is set to TRUE. Produces an error when the sum is greater to one. Default: list(0.2,0.2) so that the training set has 0.6 of the input observations.

criterion

The criterion ('gini','aic','bic') to use to choose the best discretization scheme among the generated ones (default: 'gini'). Nota Bene: it is best to use 'gini' only when test is set to TRUE and 'aic' or 'bic' when it is not. When using 'aic' or 'bic' with a test set, the likelihood is returned as there is no need to penalize for generalization purposes.

ctree_controls

The controls to use for `partykit::ctree`.

Value

An S4 object of class `glmtree` that contains the parameters used to search for the logistic regression tree, the best tree it found, and its performance.

Examples

data <- generateData(n = 100, scenario = "no tree") glmtree(x = data[, c("x1", "x2")], y = data$y, K = 5, iterations = 80, criterion = "aic")
#> The aic criterion for iteration 1 is 0
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 2 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 3 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 4 is -111.049693265403
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 5 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 6 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 7 is -111.049693265403
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 8 is -111.049693265403
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 9 is -111.049693265403
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 10 is -111.049693265403
#> Warning: prediction from a rank-deficient fit may be misleading
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 11 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 12 is -111.049693265403
#> Warning: prediction from a rank-deficient fit may be misleading
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 13 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 14 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 15 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 16 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 17 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 18 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 19 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 20 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 21 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 22 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: prediction from a rank-deficient fit may be misleading
#> The aic criterion for iteration 23 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: prediction from a rank-deficient fit may be misleading
#> The aic criterion for iteration 24 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: prediction from a rank-deficient fit may be misleading
#> The aic criterion for iteration 25 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: prediction from a rank-deficient fit may be misleading
#> The aic criterion for iteration 26 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: prediction from a rank-deficient fit may be misleading
#> The aic criterion for iteration 27 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: prediction from a rank-deficient fit may be misleading
#> The aic criterion for iteration 28 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 29 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 30 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 31 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 32 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 33 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 34 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 35 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 36 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 37 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 38 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 39 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 40 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 41 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 42 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 43 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 44 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 45 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 46 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 47 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 48 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 49 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 50 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 51 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 52 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 53 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 54 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 55 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 56 is -111.049693265403
#> Warning: prediction from a rank-deficient fit may be misleading
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 57 is -111.049693265403
#> Warning: prediction from a rank-deficient fit may be misleading
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 58 is -111.049693265403
#> Warning: prediction from a rank-deficient fit may be misleading
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 59 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 60 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 61 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 62 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 63 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 64 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 65 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 66 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 67 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 68 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 69 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 70 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 71 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 72 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 73 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 74 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 75 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 76 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 77 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 78 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 79 is -111.049693265403
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> Warning: glm.fit: algorithm did not converge
#> Warning: glm.fit: fitted probabilities numerically 0 or 1 occurred
#> The aic criterion for iteration 80 is -111.049693265403
#> An object of class "glmtree" #> Slot "parameters": #> $K #> [1] 5 #> #> $iterations #> [1] 80 #> #> $test #> [1] FALSE #> #> $validation #> [1] FALSE #> #> $proportions #> [1] 0.3 #> #> $criterion #> [1] "aic" #> #> $ctree_controls #> $ctree_controls$criterion #> [1] "p.value" #> #> $ctree_controls$logmincriterion #> [1] -0.1053605 #> #> $ctree_controls$minsplit #> [1] 20 #> #> $ctree_controls$minbucket #> [1] 100 #> #> $ctree_controls$minprob #> [1] 0.01 #> #> $ctree_controls$stump #> [1] FALSE #> #> $ctree_controls$nmax #> yx z #> Inf Inf #> #> $ctree_controls$lookahead #> [1] FALSE #> #> $ctree_controls$mtry #> [1] Inf #> #> $ctree_controls$maxdepth #> [1] 5 #> #> $ctree_controls$multiway #> [1] FALSE #> #> $ctree_controls$splittry #> [1] 2 #> #> $ctree_controls$maxsurrogate #> [1] 0 #> #> $ctree_controls$numsurrogate #> [1] FALSE #> #> $ctree_controls$majority #> [1] FALSE #> #> $ctree_controls$caseweights #> [1] TRUE #> #> $ctree_controls$applyfun #> function (X, FUN, ...) #> { #> FUN <- match.fun(FUN) #> if (!is.vector(X) || is.object(X)) #> X <- as.list(X) #> .Internal(lapply(X, FUN)) #> } #> <bytecode: 0x7fd3fd928e20> #> <environment: namespace:base> #> #> $ctree_controls$saveinfo #> [1] TRUE #> #> $ctree_controls$bonferroni #> [1] TRUE #> #> $ctree_controls$update #> NULL #> #> $ctree_controls$selectfun #> function (model, trafo, data, subset, weights, whichvar, ctrl) #> { #> args <- list(...) #> ctrl[names(args)] <- args #> .select(model, trafo, data, subset, weights, whichvar, ctrl, #> FUN = .ctree_test) #> } #> <bytecode: 0x7fd4032750c0> #> <environment: 0x7fd4032744f0> #> #> $ctree_controls$splitfun #> function (model, trafo, data, subset, weights, whichvar, ctrl) #> { #> args <- list(...) #> ctrl[names(args)] <- args #> .split(model, trafo, data, subset, weights, whichvar, ctrl, #> FUN = .ctree_test) #> } #> <bytecode: 0x7fd4032774e8> #> <environment: 0x7fd403276918> #> #> $ctree_controls$svselectfun #> function (model, trafo, data, subset, weights, whichvar, ctrl) #> { #> args <- list(...) #> ctrl[names(args)] <- args #> .select(model, trafo, data, subset, weights, whichvar, ctrl, #> FUN = .ctree_test) #> } #> <bytecode: 0x7fd4032750c0> #> <environment: 0x7fd403276838> #> #> $ctree_controls$svsplitfun #> function (model, trafo, data, subset, weights, whichvar, ctrl) #> { #> args <- list(...) #> ctrl[names(args)] <- args #> .split(model, trafo, data, subset, weights, whichvar, ctrl, #> FUN = .ctree_test) #> } #> <bytecode: 0x7fd4032774e8> #> <environment: 0x7fd4032766e8> #> #> $ctree_controls$teststat #> [1] "quadratic" #> #> $ctree_controls$splitstat #> [1] "quadratic" #> #> $ctree_controls$splittest #> [1] FALSE #> #> $ctree_controls$pargs #> $maxpts #> [1] 25000 #> #> $abseps #> [1] 0.001 #> #> $releps #> [1] 0 #> #> attr(,"class") #> [1] "GenzBretz" #> #> $ctree_controls$testtype #> [1] "Bonferroni" #> #> $ctree_controls$nresample #> [1] 9999 #> #> $ctree_controls$tol #> [1] 1.490116e-08 #> #> $ctree_controls$intersplit #> [1] FALSE #> #> $ctree_controls$MIA #> [1] FALSE #> #> #> #> Slot "best.tree": #> $tree #> #> Model formula: #> c_hat ~ x1 + x2 #> #> Fitted party: #> [1] root: 2 (n = 100, err = 75.0%) #> #> Number of inner nodes: 0 #> Number of terminal nodes: 1 #> #> $glms #> $glms[[1]] #> #> Call: stats::glm(formula = y ~ ., family = stats::binomial(link = "logit"), #> data = data_train_c_map) #> #> Coefficients: #> (Intercept) x1 x2 #> 2.8989 0.5862 -1.0410 #> #> Degrees of Freedom: 99 Total (i.e. Null); 97 Residual #> Null Deviance: 138.6 #> Residual Deviance: 105 AIC: 111 #> #> #> #> Slot "performance": #> $performance #> [1] -111.0497 #> #> $criterionEvolution #> $criterionEvolution[[1]] #> [1] 0 #> #> $criterionEvolution[[2]] #> [1] -111.0497 #> #> $criterionEvolution[[3]] #> [1] -111.0497 #> #> $criterionEvolution[[4]] #> [1] -111.0497 #> #> $criterionEvolution[[5]] #> [1] -111.0497 #> #> $criterionEvolution[[6]] #> [1] -111.0497 #> #> $criterionEvolution[[7]] #> [1] -111.0497 #> #> $criterionEvolution[[8]] #> [1] -111.0497 #> #> $criterionEvolution[[9]] #> [1] -111.0497 #> #> $criterionEvolution[[10]] #> [1] -111.0497 #> #> $criterionEvolution[[11]] #> [1] -111.0497 #> #> $criterionEvolution[[12]] #> [1] -111.0497 #> #> $criterionEvolution[[13]] #> [1] -111.0497 #> #> $criterionEvolution[[14]] #> [1] -111.0497 #> #> $criterionEvolution[[15]] #> [1] -111.0497 #> #> $criterionEvolution[[16]] #> [1] -111.0497 #> #> $criterionEvolution[[17]] #> [1] -111.0497 #> #> $criterionEvolution[[18]] #> [1] -111.0497 #> #> $criterionEvolution[[19]] #> [1] -111.0497 #> #> $criterionEvolution[[20]] #> [1] -111.0497 #> #> $criterionEvolution[[21]] #> [1] -111.0497 #> #> $criterionEvolution[[22]] #> [1] -111.0497 #> #> $criterionEvolution[[23]] #> [1] -111.0497 #> #> $criterionEvolution[[24]] #> [1] -111.0497 #> #> $criterionEvolution[[25]] #> [1] -111.0497 #> #> $criterionEvolution[[26]] #> [1] -111.0497 #> #> $criterionEvolution[[27]] #> [1] -111.0497 #> #> $criterionEvolution[[28]] #> [1] -111.0497 #> #> $criterionEvolution[[29]] #> [1] -111.0497 #> #> $criterionEvolution[[30]] #> [1] -111.0497 #> #> $criterionEvolution[[31]] #> [1] -111.0497 #> #> $criterionEvolution[[32]] #> [1] -111.0497 #> #> $criterionEvolution[[33]] #> [1] -111.0497 #> #> $criterionEvolution[[34]] #> [1] -111.0497 #> #> $criterionEvolution[[35]] #> [1] -111.0497 #> #> $criterionEvolution[[36]] #> [1] -111.0497 #> #> $criterionEvolution[[37]] #> [1] -111.0497 #> #> $criterionEvolution[[38]] #> [1] -111.0497 #> #> $criterionEvolution[[39]] #> [1] -111.0497 #> #> $criterionEvolution[[40]] #> [1] -111.0497 #> #> $criterionEvolution[[41]] #> [1] -111.0497 #> #> $criterionEvolution[[42]] #> [1] -111.0497 #> #> $criterionEvolution[[43]] #> [1] -111.0497 #> #> $criterionEvolution[[44]] #> [1] -111.0497 #> #> $criterionEvolution[[45]] #> [1] -111.0497 #> #> $criterionEvolution[[46]] #> [1] -111.0497 #> #> $criterionEvolution[[47]] #> [1] -111.0497 #> #> $criterionEvolution[[48]] #> [1] -111.0497 #> #> $criterionEvolution[[49]] #> [1] -111.0497 #> #> $criterionEvolution[[50]] #> [1] -111.0497 #> #> $criterionEvolution[[51]] #> [1] -111.0497 #> #> $criterionEvolution[[52]] #> [1] -111.0497 #> #> $criterionEvolution[[53]] #> [1] -111.0497 #> #> $criterionEvolution[[54]] #> [1] -111.0497 #> #> $criterionEvolution[[55]] #> [1] -111.0497 #> #> $criterionEvolution[[56]] #> [1] -111.0497 #> #> $criterionEvolution[[57]] #> [1] -111.0497 #> #> $criterionEvolution[[58]] #> [1] -111.0497 #> #> $criterionEvolution[[59]] #> [1] -111.0497 #> #> $criterionEvolution[[60]] #> [1] -111.0497 #> #> $criterionEvolution[[61]] #> [1] -111.0497 #> #> $criterionEvolution[[62]] #> [1] -111.0497 #> #> $criterionEvolution[[63]] #> [1] -111.0497 #> #> $criterionEvolution[[64]] #> [1] -111.0497 #> #> $criterionEvolution[[65]] #> [1] -111.0497 #> #> $criterionEvolution[[66]] #> [1] -111.0497 #> #> $criterionEvolution[[67]] #> [1] -111.0497 #> #> $criterionEvolution[[68]] #> [1] -111.0497 #> #> $criterionEvolution[[69]] #> [1] -111.0497 #> #> $criterionEvolution[[70]] #> [1] -111.0497 #> #> $criterionEvolution[[71]] #> [1] -111.0497 #> #> $criterionEvolution[[72]] #> [1] -111.0497 #> #> $criterionEvolution[[73]] #> [1] -111.0497 #> #> $criterionEvolution[[74]] #> [1] -111.0497 #> #> $criterionEvolution[[75]] #> [1] -111.0497 #> #> $criterionEvolution[[76]] #> [1] -111.0497 #> #> $criterionEvolution[[77]] #> [1] -111.0497 #> #> $criterionEvolution[[78]] #> [1] -111.0497 #> #> $criterionEvolution[[79]] #> [1] -111.0497 #> #> $criterionEvolution[[80]] #> [1] -111.0497 #> #> #>