cost function in cv.glm of boot library in R

后端 未结 4 1139
忘掉有多难
忘掉有多难 2021-02-06 10:27

I am trying to use the crossvalidation cv.glm function from the boot library in R to determine the number of misclassifications when a glm logistic regression is applied.

4条回答
  •  忘掉有多难
    2021-02-06 10:54

    The cost function defined in the example for cv.glm clearly assumes that the predictions are probabilities, which would require the type="response" argument in the predict function. The documentation from library(boot) should state this explicitly. I would otherwise be forced to assume that the default type="link" is used inside the cv.glm function, in which case the cost function would not work as intended.

提交回复
热议问题