Considering the following script, why does the isotonic regression calibration with this package return a full zero vector after calibration? Any idea (i asked the author of the package but he didn't answered sadly)?
library("CORElearn")
#Dataset for naive bayesian gaussian classification
(mydata_gauss<-structure(list(Individu = structure(c(2L, 2L, 2L, 2L, 1L, 1L,
1L, 1L), .Label = c("femme", "homme"), class = "factor"), Hauteur = c(182.88,
180.44, 170.07, 180.44, 152.4, 167.64, 165.2, 175.26), Masse = c(81.64,
86.18, 77.11, 74.84, 45.35, 68.03, 58.96, 68.03), Taille_Pied = c(30.48,
27.94, 30.48, 25.4, 15.24, 20.32, 17.78, 22.86)), class = "data.frame", row.names = c(NA,
-8L)))
model_gauss <- CoreModel(Individu ~., mydata_gauss, model="bayes")
#Dataset for naive bayesian binomial classification
(mydata_binomial<-structure(list(Couleur = structure(c(2L, 2L, 2L, 1L, 1L, 1L,
1L, 1L, 2L, 2L, 2L), .Label = c("Jaune", "Rouge"), class = "factor"),
Type = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L,
2L), .Label = c("Sports", "SUV"), class = "factor"), Origine = structure(c(1L,
1L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 1L), .Label = c("Domestique",
"Importé"), class = "factor"), Volé = structure(c(2L, 1L,
2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 2L), .Label = c("Non", "Oui"
), class = "factor")), row.names = c(NA, -11L), class = "data.frame"))
model_binomial <- CoreModel(Volé ~., mydata_binomial, model="bayes")
#we display both models
print(model_gauss)
print(model_binomial)
#we do prediction of the both models to see if they are compliant with manual calculations
(pred_gauss <- predict(model_gauss, mydata_gauss, type="both"))
(pred_binomial <- predict(model_binomial, mydata_binomial, type="both"))
#confusion matrix
modelEval(model_gauss, mydata_gauss$Individu, pred_gauss$class, pred_gauss$prob)$predictionMatrix
modelEval(model_binomial, mydata_binomial$Volé, pred_binomial$class, pred_binomial$prob)$predictionMatrix
(calibration_gauss <- calibrate(mydata_gauss$Individu, pred_gauss$prob[,2], class1="homme"
,method="isoReg",assumeProbabilities=TRUE))
(calibration_binomial <- calibrate(mydata_binomial$Volé, pred_binomial$prob[,2], class1="Oui",
,method="isoReg",assumeProbabilities=TRUE))
(calibratedProbs_gauss <- applyCalibration(pred_gauss$prob[,class1], calibration_gauss))
(calibratedProbs_binomial <- applyCalibration(pred_binomial$prob[,class1], calibration_binomial))
Thanks in advance for your precious help