El paquete caret (Clasification And Regression Training) es un paquete integral con una amplia variedad de algoritmos para el aprendizaje automático.
#file.choose()
#install.packages("caret") #Algoritmos de aprendizaje
library(caret)
#install.packages("datasets") #Usar la base de datos "Iris"
library(datasets)
#install.packages("ggplot2") #Gráficas con mejor diseño
library(ggplot2)
#install.packages("lattice") #Crear gráficos
library(lattice)
#install.packages("DataExplorer") #Crear gráficos
library(DataExplorer)
library(mlbench)
library(tidyverse)
data("BreastCancer")
df <- data.frame(BreastCancer)
df <- df %>% select(-Id)
#View(df)
#Análisis exploratorio
summary(df)
## Cl.thickness Cell.size Cell.shape Marg.adhesion Epith.c.size
## 1 :145 1 :384 1 :353 1 :407 2 :386
## 5 :130 10 : 67 2 : 59 2 : 58 3 : 72
## 3 :108 3 : 52 10 : 58 3 : 58 4 : 48
## 4 : 80 2 : 45 3 : 56 10 : 55 1 : 47
## 10 : 69 4 : 40 4 : 44 4 : 33 6 : 41
## 2 : 50 5 : 30 5 : 34 8 : 25 5 : 39
## (Other):117 (Other): 81 (Other): 95 (Other): 63 (Other): 66
## Bare.nuclei Bl.cromatin Normal.nucleoli Mitoses Class
## 1 :402 2 :166 1 :443 1 :579 benign :458
## 10 :132 3 :165 10 : 61 2 : 35 malignant:241
## 2 : 30 1 :152 3 : 44 3 : 33
## 5 : 30 7 : 73 2 : 36 10 : 14
## 3 : 28 4 : 40 8 : 24 4 : 12
## (Other): 61 5 : 34 6 : 22 7 : 9
## NA's : 16 (Other): 69 (Other): 69 (Other): 17
str(df)
## 'data.frame': 699 obs. of 10 variables:
## $ Cl.thickness : Ord.factor w/ 10 levels "1"<"2"<"3"<"4"<..: 5 5 3 6 4 8 1 2 2 4 ...
## $ Cell.size : Ord.factor w/ 10 levels "1"<"2"<"3"<"4"<..: 1 4 1 8 1 10 1 1 1 2 ...
## $ Cell.shape : Ord.factor w/ 10 levels "1"<"2"<"3"<"4"<..: 1 4 1 8 1 10 1 2 1 1 ...
## $ Marg.adhesion : Ord.factor w/ 10 levels "1"<"2"<"3"<"4"<..: 1 5 1 1 3 8 1 1 1 1 ...
## $ Epith.c.size : Ord.factor w/ 10 levels "1"<"2"<"3"<"4"<..: 2 7 2 3 2 7 2 2 2 2 ...
## $ Bare.nuclei : Factor w/ 10 levels "1","2","3","4",..: 1 10 2 4 1 10 10 1 1 1 ...
## $ Bl.cromatin : Factor w/ 10 levels "1","2","3","4",..: 3 3 3 3 3 9 3 3 1 2 ...
## $ Normal.nucleoli: Factor w/ 10 levels "1","2","3","4",..: 1 2 1 7 1 7 1 1 1 1 ...
## $ Mitoses : Factor w/ 9 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 5 1 ...
## $ Class : Factor w/ 2 levels "benign","malignant": 1 1 1 1 1 2 1 1 1 1 ...
boxplot(df)
plot_missing(df)
#plot_histogram(df)
plot_correlation(df)
#create_report(df)
df <- na.omit(df)
Nota: La variable que queremos predecir debe tener formato de FACTOR
set.seed(123)
renglones_entrenamiento <- createDataPartition(df$Class, p=.8, list=FALSE)
entrenamiento <- df[-renglones_entrenamiento, ]
prueba <- df[renglones_entrenamiento, ]
entrenamiento$Class <- as.factor(entrenamiento$Class)
prueba$Class <- as.factor(prueba$Class)
Los métodos más utilizados para modelar aprendizaje automático son: * SVM. Support Vector Machine o Máquina de Vectores de Soporte. Hay varios subtipos: Lineal (svmLineal), Rdial (svmRadial), Polinómico (svmPoly), etc. * Árbol de Decisión. rpart * Redes Neuronales. nnet * Random Forest o Bosques Aleatorios. rf * Random Forest o Bosques Aleatorios. rf
#install.packages("kernlab")
library(caret)
modelo1 <- train(Class ~ ., data=entrenamiento,
method = "svmLinear",
preProcess = c("scale", "center"),
trControl = trainControl(method="cv", number=10),
tuneGrid = data.frame(C=1) #Cuando es svmLinear
)
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
resultado_entrenamiento1 <- predict(modelo1, entrenamiento)
resultado_prueba1 <- predict(modelo1, prueba)
#Matriz de Consufión
mcre1 <- confusionMatrix(resultado_entrenamiento1,entrenamiento$Class) #Matriz de confusion de resultado de entrenamiento
mcre1
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 88 0
## malignant 0 47
##
## Accuracy : 1
## 95% CI : (0.973, 1)
## No Information Rate : 0.6519
## P-Value [Acc > NIR] : < 2.2e-16
##
## Kappa : 1
##
## Mcnemar's Test P-Value : NA
##
## Sensitivity : 1.0000
## Specificity : 1.0000
## Pos Pred Value : 1.0000
## Neg Pred Value : 1.0000
## Prevalence : 0.6519
## Detection Rate : 0.6519
## Detection Prevalence : 0.6519
## Balanced Accuracy : 1.0000
##
## 'Positive' Class : benign
##
mcrp1 <- confusionMatrix(resultado_prueba1, prueba$Class) #Matriz de confusion de resultado de prueba
mcrp1
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 346 13
## malignant 10 179
##
## Accuracy : 0.958
## 95% CI : (0.9377, 0.9732)
## No Information Rate : 0.6496
## P-Value [Acc > NIR] : <2e-16
##
## Kappa : 0.9075
##
## Mcnemar's Test P-Value : 0.6767
##
## Sensitivity : 0.9719
## Specificity : 0.9323
## Pos Pred Value : 0.9638
## Neg Pred Value : 0.9471
## Prevalence : 0.6496
## Detection Rate : 0.6314
## Detection Prevalence : 0.6551
## Balanced Accuracy : 0.9521
##
## 'Positive' Class : benign
##
modelo2 <- train(Class ~ ., data=entrenamiento,
method = "svmRadial",
preProcess = c("scale", "center"),
trControl = trainControl(method="cv", number=10),
tuneGrid = data.frame(sigma=1,C=1) #Cambiar
)
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
resultado_entrenamiento2 <- predict(modelo2, entrenamiento)
resultado_prueba2 <- predict(modelo2, prueba)
#Matriz de Consufión
mcre2 <- confusionMatrix(resultado_entrenamiento2,entrenamiento$Class) #Matriz de confusion de resultado de entrenamiento
mcre2
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 88 0
## malignant 0 47
##
## Accuracy : 1
## 95% CI : (0.973, 1)
## No Information Rate : 0.6519
## P-Value [Acc > NIR] : < 2.2e-16
##
## Kappa : 1
##
## Mcnemar's Test P-Value : NA
##
## Sensitivity : 1.0000
## Specificity : 1.0000
## Pos Pred Value : 1.0000
## Neg Pred Value : 1.0000
## Prevalence : 0.6519
## Detection Rate : 0.6519
## Detection Prevalence : 0.6519
## Balanced Accuracy : 1.0000
##
## 'Positive' Class : benign
##
mcrp2 <- confusionMatrix(resultado_prueba2, prueba$Class) #Matriz de confusion de resultado de prueba
mcrp2
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 356 192
## malignant 0 0
##
## Accuracy : 0.6496
## 95% CI : (0.6081, 0.6896)
## No Information Rate : 0.6496
## P-Value [Acc > NIR] : 0.5196
##
## Kappa : 0
##
## Mcnemar's Test P-Value : <2e-16
##
## Sensitivity : 1.0000
## Specificity : 0.0000
## Pos Pred Value : 0.6496
## Neg Pred Value : NaN
## Prevalence : 0.6496
## Detection Rate : 0.6496
## Detection Prevalence : 1.0000
## Balanced Accuracy : 0.5000
##
## 'Positive' Class : benign
##
modelo3 <- train(Class ~ ., data = entrenamiento,
method = "svmPoly",
preProcess = c("scale", "center"),
trControl = trainControl(method = "cv", number = 10),
tuneGrid = data.frame(degree = 1, scale = 1, C = 1)) # Adjust values as needed
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses5, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in .local(x, ...): Variable(s) `' constant. Cannot scale data.
resultado_entrenamiento3 <- predict(modelo3, entrenamiento)
resultado_prueba3 <- predict(modelo3, prueba)
#Matriz de Consufión
mcre3 <- confusionMatrix(resultado_entrenamiento3,entrenamiento$Class) #Matriz de confusion de resultado de entrenamiento
mcre3
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 88 0
## malignant 0 47
##
## Accuracy : 1
## 95% CI : (0.973, 1)
## No Information Rate : 0.6519
## P-Value [Acc > NIR] : < 2.2e-16
##
## Kappa : 1
##
## Mcnemar's Test P-Value : NA
##
## Sensitivity : 1.0000
## Specificity : 1.0000
## Pos Pred Value : 1.0000
## Neg Pred Value : 1.0000
## Prevalence : 0.6519
## Detection Rate : 0.6519
## Detection Prevalence : 0.6519
## Balanced Accuracy : 1.0000
##
## 'Positive' Class : benign
##
mcrp3 <- confusionMatrix(resultado_prueba3, prueba$Class) #Matriz de confusion de resultado de prueba
mcrp3
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 346 13
## malignant 10 179
##
## Accuracy : 0.958
## 95% CI : (0.9377, 0.9732)
## No Information Rate : 0.6496
## P-Value [Acc > NIR] : <2e-16
##
## Kappa : 0.9075
##
## Mcnemar's Test P-Value : 0.6767
##
## Sensitivity : 0.9719
## Specificity : 0.9323
## Pos Pred Value : 0.9638
## Neg Pred Value : 0.9471
## Prevalence : 0.6496
## Detection Rate : 0.6314
## Detection Prevalence : 0.6551
## Balanced Accuracy : 0.9521
##
## 'Positive' Class : benign
##
modelo4 <- train(Class ~ ., data=entrenamiento,
method = "rpart",
preProcess = c("scale", "center"),
trControl = trainControl(method="cv", number=10),
tuneLength = 10 #Cambiar
)
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
resultado_entrenamiento4 <- predict(modelo4, entrenamiento)
resultado_prueba4 <- predict(modelo4, prueba)
#Matriz de Consufión
mcre4 <- confusionMatrix(resultado_entrenamiento4,entrenamiento$Class) #Matriz de confusion de resultado de entrenamiento
mcre4
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 86 6
## malignant 2 41
##
## Accuracy : 0.9407
## 95% CI : (0.8866, 0.9741)
## No Information Rate : 0.6519
## P-Value [Acc > NIR] : 1.347e-15
##
## Kappa : 0.8668
##
## Mcnemar's Test P-Value : 0.2888
##
## Sensitivity : 0.9773
## Specificity : 0.8723
## Pos Pred Value : 0.9348
## Neg Pred Value : 0.9535
## Prevalence : 0.6519
## Detection Rate : 0.6370
## Detection Prevalence : 0.6815
## Balanced Accuracy : 0.9248
##
## 'Positive' Class : benign
##
mcrp4 <- confusionMatrix(resultado_prueba4, prueba$Class) #Matriz de confusion de resultado de prueba
mcrp4
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 347 31
## malignant 9 161
##
## Accuracy : 0.927
## 95% CI : (0.9019, 0.9473)
## No Information Rate : 0.6496
## P-Value [Acc > NIR] : < 2.2e-16
##
## Kappa : 0.8353
##
## Mcnemar's Test P-Value : 0.0008989
##
## Sensitivity : 0.9747
## Specificity : 0.8385
## Pos Pred Value : 0.9180
## Neg Pred Value : 0.9471
## Prevalence : 0.6496
## Detection Rate : 0.6332
## Detection Prevalence : 0.6898
## Balanced Accuracy : 0.9066
##
## 'Positive' Class : benign
##
modelo5 <- train(Class ~ ., data=entrenamiento,
method = "nnet",
preProcess = c("scale", "center"),
trControl = trainControl(method="cv", number=10)
)
## Warning in preProcess.default(method = c("scale", "center"), x =
## structure(c(-0.055048188256318, : These variables have zero variances:
## Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## # weights: 83
## initial value 74.556563
## iter 10 value 13.604556
## iter 20 value 13.592591
## iter 30 value 11.022652
## iter 40 value 11.021928
## final value 11.021910
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## # weights: 247
## initial value 84.092166
## iter 10 value 14.175167
## iter 20 value 8.148974
## iter 30 value 4.763820
## iter 40 value 4.749747
## iter 50 value 4.749491
## final value 4.749481
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## # weights: 411
## initial value 93.939341
## iter 10 value 13.802829
## iter 20 value 2.004212
## iter 30 value 1.509982
## iter 40 value 1.407032
## iter 50 value 0.267967
## iter 60 value 0.035845
## iter 70 value 0.021422
## iter 80 value 0.004086
## iter 90 value 0.001719
## iter 100 value 0.001605
## final value 0.001605
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## # weights: 83
## initial value 103.578534
## iter 10 value 21.671572
## iter 20 value 10.636351
## iter 30 value 10.112557
## iter 40 value 10.107159
## final value 10.107134
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## # weights: 247
## initial value 84.788372
## iter 10 value 25.357033
## iter 20 value 6.533431
## iter 30 value 5.415313
## iter 40 value 5.353170
## iter 50 value 5.342231
## iter 60 value 5.339957
## iter 70 value 5.339414
## iter 80 value 5.339235
## iter 90 value 5.339170
## final value 5.339161
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## # weights: 411
## initial value 86.286927
## iter 10 value 6.655475
## iter 20 value 4.407253
## iter 30 value 4.326996
## iter 40 value 4.325436
## final value 4.325436
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## # weights: 83
## initial value 99.424309
## iter 10 value 18.131230
## iter 20 value 15.972076
## iter 30 value 15.961252
## iter 40 value 11.064423
## iter 50 value 8.170670
## iter 60 value 8.167909
## iter 70 value 0.430572
## iter 80 value 0.069528
## iter 90 value 0.061169
## iter 100 value 0.056820
## final value 0.056820
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## # weights: 247
## initial value 108.324739
## iter 10 value 24.688868
## iter 20 value 8.462536
## iter 30 value 4.461838
## iter 40 value 2.753490
## iter 50 value 2.076137
## iter 60 value 2.011787
## iter 70 value 0.142743
## iter 80 value 0.091036
## iter 90 value 0.075988
## iter 100 value 0.067904
## final value 0.067904
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## # weights: 411
## initial value 121.036369
## iter 10 value 0.186363
## iter 20 value 0.106247
## iter 30 value 0.074670
## iter 40 value 0.067601
## iter 50 value 0.060116
## iter 60 value 0.052483
## iter 70 value 0.048390
## iter 80 value 0.042532
## iter 90 value 0.038946
## iter 100 value 0.031947
## final value 0.031947
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 88.915252
## iter 10 value 16.176759
## iter 20 value 0.022469
## final value 0.000090
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 70.594708
## final value 8.135926
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 78.302526
## iter 10 value 0.458691
## iter 20 value 0.043318
## iter 30 value 0.002411
## iter 40 value 0.000214
## final value 0.000083
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 82.781959
## iter 10 value 22.542995
## iter 20 value 14.905617
## iter 30 value 10.106471
## iter 40 value 10.102207
## final value 10.102206
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 99.164787
## iter 10 value 9.828203
## iter 20 value 5.347100
## iter 30 value 5.315059
## iter 40 value 5.313924
## iter 50 value 5.313905
## final value 5.313904
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 95.061549
## iter 10 value 9.622697
## iter 20 value 4.327455
## iter 30 value 4.295029
## iter 40 value 4.292344
## iter 50 value 4.292265
## final value 4.292265
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 87.960384
## iter 10 value 0.079519
## iter 20 value 0.074786
## iter 30 value 0.068294
## iter 40 value 0.065043
## iter 50 value 0.062735
## iter 60 value 0.061642
## iter 70 value 0.058560
## iter 80 value 0.057696
## iter 90 value 0.056992
## iter 100 value 0.056678
## final value 0.056678
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 83.325052
## iter 10 value 0.428821
## iter 20 value 0.091309
## iter 30 value 0.086417
## iter 40 value 0.078290
## iter 50 value 0.074184
## iter 60 value 0.069716
## iter 70 value 0.066243
## iter 80 value 0.061268
## iter 90 value 0.059141
## iter 100 value 0.055344
## final value 0.055344
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 84.428297
## iter 10 value 14.602655
## iter 20 value 4.886415
## iter 30 value 4.821482
## iter 40 value 4.787909
## iter 50 value 0.511674
## iter 60 value 0.095895
## iter 70 value 0.076887
## iter 80 value 0.047410
## iter 90 value 0.043408
## iter 100 value 0.040317
## final value 0.040317
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## # weights: 83
## initial value 75.023120
## iter 10 value 8.126545
## iter 20 value 0.032748
## iter 30 value 0.000338
## final value 0.000095
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## # weights: 247
## initial value 85.198386
## iter 10 value 15.448146
## iter 20 value 0.020983
## iter 30 value 0.003228
## iter 40 value 0.001236
## final value 0.000097
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## # weights: 411
## initial value 96.521258
## iter 10 value 6.746261
## iter 20 value 0.068883
## iter 30 value 0.000676
## final value 0.000041
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## # weights: 83
## initial value 89.364695
## iter 10 value 26.935017
## iter 20 value 12.058451
## iter 30 value 10.134778
## iter 40 value 10.092725
## final value 10.092657
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## # weights: 247
## initial value 117.660848
## iter 10 value 12.016355
## iter 20 value 5.911153
## iter 30 value 5.492425
## iter 40 value 5.483564
## final value 5.483551
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## # weights: 411
## initial value 93.853209
## iter 10 value 6.346432
## iter 20 value 4.424135
## iter 30 value 4.406026
## iter 40 value 4.405557
## final value 4.405546
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## # weights: 83
## initial value 82.576498
## iter 10 value 7.289674
## iter 20 value 4.794485
## iter 30 value 4.790121
## iter 40 value 4.787034
## iter 50 value 4.785704
## iter 60 value 4.785119
## iter 70 value 4.784857
## iter 80 value 4.783923
## iter 90 value 0.082632
## iter 100 value 0.056851
## final value 0.056851
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## # weights: 247
## initial value 71.677644
## iter 10 value 2.488526
## iter 20 value 2.105332
## iter 30 value 1.573908
## iter 40 value 1.539433
## iter 50 value 0.241704
## iter 60 value 0.089813
## iter 70 value 0.086188
## iter 80 value 0.071074
## iter 90 value 0.059270
## iter 100 value 0.051431
## final value 0.051431
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses6,
## Mitoses7
## # weights: 411
## initial value 149.605022
## iter 10 value 0.444839
## iter 20 value 0.195477
## iter 30 value 0.067929
## iter 40 value 0.052476
## iter 50 value 0.044094
## iter 60 value 0.037553
## iter 70 value 0.032090
## iter 80 value 0.027921
## iter 90 value 0.026342
## iter 100 value 0.024544
## final value 0.024544
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## # weights: 83
## initial value 99.634357
## iter 10 value 0.358449
## iter 20 value 0.040475
## iter 30 value 0.001423
## final value 0.000091
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## # weights: 247
## initial value 88.547522
## iter 10 value 0.179348
## iter 20 value 0.008128
## final value 0.000098
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## # weights: 411
## initial value 88.339385
## iter 10 value 1.248014
## iter 20 value 0.004323
## iter 30 value 0.000821
## iter 40 value 0.000360
## iter 50 value 0.000113
## iter 50 value 0.000056
## iter 50 value 0.000056
## final value 0.000056
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## # weights: 83
## initial value 80.833813
## iter 10 value 13.107085
## iter 20 value 10.219554
## iter 30 value 10.100906
## iter 40 value 10.100740
## iter 40 value 10.100740
## iter 40 value 10.100740
## final value 10.100740
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## # weights: 247
## initial value 83.871019
## iter 10 value 35.420639
## iter 20 value 16.291470
## iter 30 value 10.341697
## iter 40 value 7.822438
## iter 50 value 7.529469
## iter 60 value 7.515349
## iter 70 value 7.513623
## iter 80 value 7.512741
## iter 90 value 7.510252
## iter 100 value 7.505129
## final value 7.505129
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## # weights: 411
## initial value 95.265070
## iter 10 value 6.842444
## iter 20 value 4.347544
## iter 30 value 4.320377
## iter 40 value 4.318956
## final value 4.318952
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## # weights: 83
## initial value 84.427040
## iter 10 value 22.230673
## iter 20 value 22.063129
## iter 30 value 22.047015
## iter 40 value 22.038565
## iter 50 value 20.155350
## iter 60 value 19.944050
## iter 70 value 18.132255
## iter 80 value 15.972637
## iter 90 value 15.963156
## iter 100 value 8.334774
## final value 8.334774
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## # weights: 247
## initial value 79.466354
## iter 10 value 11.001224
## iter 20 value 8.495085
## iter 30 value 8.210333
## iter 40 value 8.160702
## iter 50 value 2.067495
## iter 60 value 0.150466
## iter 70 value 0.111353
## iter 80 value 0.101588
## iter 90 value 0.082953
## iter 100 value 0.076867
## final value 0.076867
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## # weights: 411
## initial value 80.871010
## iter 10 value 3.295260
## iter 20 value 2.703390
## iter 30 value 2.028572
## iter 40 value 0.346626
## iter 50 value 0.126171
## iter 60 value 0.117624
## iter 70 value 0.087654
## iter 80 value 0.081323
## iter 90 value 0.063109
## iter 100 value 0.054239
## final value 0.054239
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 99.025211
## iter 10 value 4.809669
## iter 20 value 4.777829
## iter 30 value 4.773244
## iter 40 value 4.772826
## iter 50 value 4.772772
## iter 60 value 4.772741
## final value 4.772739
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 79.025818
## iter 10 value 17.934202
## iter 20 value 17.753676
## iter 30 value 13.317376
## iter 40 value 13.212743
## iter 50 value 12.743741
## iter 60 value 4.792352
## iter 70 value 4.765476
## iter 80 value 3.819086
## iter 90 value 3.819047
## iter 100 value 3.819045
## final value 3.819045
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 87.374444
## iter 10 value 0.151308
## iter 20 value 0.008651
## iter 30 value 0.000166
## iter 30 value 0.000092
## iter 30 value 0.000092
## final value 0.000092
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 86.773904
## iter 10 value 14.159342
## iter 20 value 11.026509
## iter 30 value 10.616589
## iter 40 value 10.613356
## final value 10.613329
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 89.253691
## iter 10 value 15.595306
## iter 20 value 5.926808
## iter 30 value 5.542267
## iter 40 value 5.503107
## iter 50 value 5.499264
## iter 60 value 5.499195
## final value 5.499194
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 93.741434
## iter 10 value 7.117839
## iter 20 value 4.811985
## iter 30 value 4.643247
## iter 40 value 4.633003
## iter 50 value 4.632838
## final value 4.632831
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 84.398454
## iter 10 value 7.153191
## iter 20 value 3.924413
## iter 30 value 0.133254
## iter 40 value 0.062928
## iter 50 value 0.058864
## iter 60 value 0.056879
## iter 70 value 0.056635
## iter 80 value 0.056191
## iter 90 value 0.056051
## iter 100 value 0.055946
## final value 0.055946
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 83.790622
## iter 10 value 7.447761
## iter 20 value 4.212299
## iter 30 value 1.538613
## iter 40 value 1.502912
## iter 50 value 1.488952
## iter 60 value 0.765699
## iter 70 value 0.111734
## iter 80 value 0.094161
## iter 90 value 0.085748
## iter 100 value 0.072514
## final value 0.072514
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 75.271323
## iter 10 value 0.124742
## iter 20 value 0.096831
## iter 30 value 0.062974
## iter 40 value 0.050697
## iter 50 value 0.044981
## iter 60 value 0.035169
## iter 70 value 0.032269
## iter 80 value 0.029640
## iter 90 value 0.026676
## iter 100 value 0.024170
## final value 0.024170
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 89.420591
## iter 10 value 5.510601
## iter 20 value 4.777149
## iter 30 value 4.752890
## iter 40 value 4.750752
## iter 50 value 4.749858
## iter 60 value 4.749662
## iter 70 value 4.749571
## iter 80 value 4.749496
## final value 4.749494
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 91.089194
## iter 10 value 10.590777
## iter 20 value 5.264904
## iter 30 value 0.559093
## iter 40 value 0.011248
## iter 50 value 0.000679
## final value 0.000091
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 77.486363
## iter 10 value 3.007672
## iter 20 value 0.043207
## iter 30 value 0.000549
## final value 0.000098
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 101.002515
## iter 10 value 15.108441
## iter 20 value 10.829522
## iter 30 value 10.655853
## iter 40 value 10.645451
## iter 50 value 10.644770
## iter 60 value 10.644751
## final value 10.644751
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 123.746719
## iter 10 value 22.826081
## iter 20 value 6.822582
## iter 30 value 5.464881
## iter 40 value 5.411394
## iter 50 value 5.411155
## final value 5.411138
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 87.535714
## iter 10 value 9.059006
## iter 20 value 4.800586
## iter 30 value 4.525886
## iter 40 value 4.509962
## iter 50 value 4.509936
## final value 4.509934
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 83.266244
## iter 10 value 4.915534
## iter 20 value 0.087969
## iter 30 value 0.059147
## iter 40 value 0.057721
## iter 50 value 0.056343
## iter 60 value 0.055569
## iter 70 value 0.055316
## iter 80 value 0.055109
## iter 90 value 0.054996
## iter 100 value 0.054896
## final value 0.054896
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 90.050942
## iter 10 value 3.967596
## iter 20 value 0.133511
## iter 30 value 0.128595
## iter 40 value 0.096133
## iter 50 value 0.074446
## iter 60 value 0.064164
## iter 70 value 0.055065
## iter 80 value 0.048282
## iter 90 value 0.041855
## iter 100 value 0.036347
## final value 0.036347
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 95.881209
## iter 10 value 5.214778
## iter 20 value 1.597400
## iter 30 value 0.378258
## iter 40 value 0.185579
## iter 50 value 0.167508
## iter 60 value 0.139514
## iter 70 value 0.117551
## iter 80 value 0.101544
## iter 90 value 0.094384
## iter 100 value 0.082829
## final value 0.082829
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 78.645540
## iter 10 value 18.944560
## iter 20 value 18.217741
## iter 30 value 18.217033
## iter 30 value 18.217033
## iter 30 value 18.217033
## final value 18.217033
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 88.779024
## iter 10 value 4.319826
## iter 20 value 0.003459
## iter 30 value 0.000717
## final value 0.000051
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 77.640725
## iter 10 value 9.891617
## iter 20 value 4.693309
## iter 30 value 1.211581
## iter 40 value 0.005191
## iter 50 value 0.000611
## iter 60 value 0.000288
## iter 70 value 0.000259
## iter 80 value 0.000230
## final value 0.000050
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 81.078437
## iter 10 value 15.484028
## iter 20 value 10.198100
## iter 30 value 10.152352
## iter 40 value 10.151644
## final value 10.151641
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 92.635873
## iter 10 value 26.979595
## iter 20 value 7.650078
## iter 30 value 5.615967
## iter 40 value 5.375609
## iter 50 value 5.351347
## iter 60 value 5.350352
## iter 70 value 5.350244
## iter 80 value 5.350238
## final value 5.350238
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 100.998227
## iter 10 value 12.192258
## iter 20 value 5.388434
## iter 30 value 4.462917
## iter 40 value 4.430710
## iter 50 value 4.430087
## final value 4.430085
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 93.127457
## iter 10 value 16.033000
## iter 20 value 11.129489
## iter 30 value 8.261892
## iter 40 value 8.217702
## iter 50 value 8.215042
## iter 60 value 0.171239
## iter 70 value 0.063698
## iter 80 value 0.060130
## iter 90 value 0.057077
## iter 100 value 0.056203
## final value 0.056203
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 77.411629
## iter 10 value 9.411410
## iter 20 value 8.457549
## iter 30 value 8.304275
## iter 40 value 8.238031
## iter 50 value 8.223375
## iter 60 value 2.195595
## iter 70 value 1.477831
## iter 80 value 0.107007
## iter 90 value 0.069876
## iter 100 value 0.060784
## final value 0.060784
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 118.065670
## iter 10 value 3.372659
## iter 20 value 0.198632
## iter 30 value 0.166894
## iter 40 value 0.147057
## iter 50 value 0.122810
## iter 60 value 0.108507
## iter 70 value 0.067207
## iter 80 value 0.051992
## iter 90 value 0.044622
## iter 100 value 0.038493
## final value 0.038493
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 88.505724
## iter 10 value 19.470815
## iter 20 value 17.404777
## iter 30 value 17.395375
## iter 40 value 17.393461
## iter 50 value 17.393328
## iter 60 value 14.874626
## iter 70 value 13.452787
## iter 80 value 13.451967
## iter 90 value 13.450047
## iter 100 value 8.169665
## final value 8.169665
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 92.100501
## iter 10 value 2.131148
## iter 20 value 0.186156
## iter 30 value 0.006364
## final value 0.000051
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 75.028950
## iter 10 value 0.211835
## iter 20 value 0.047533
## iter 30 value 0.000726
## final value 0.000089
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 81.497192
## iter 10 value 29.729416
## iter 20 value 13.050973
## iter 30 value 10.186826
## iter 40 value 10.177992
## final value 10.177991
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 100.078171
## iter 10 value 16.833723
## iter 20 value 6.199342
## iter 30 value 5.692799
## iter 40 value 5.593955
## iter 50 value 5.591083
## iter 60 value 5.590968
## iter 70 value 5.590924
## final value 5.590923
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 91.217533
## iter 10 value 28.368524
## iter 20 value 5.112483
## iter 30 value 4.509600
## iter 40 value 4.419733
## iter 50 value 4.414387
## iter 60 value 4.413967
## iter 70 value 4.413964
## final value 4.413963
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 78.712964
## iter 10 value 19.300074
## iter 20 value 12.642973
## iter 30 value 8.201686
## iter 40 value 8.183742
## iter 50 value 8.178196
## iter 60 value 8.173883
## iter 70 value 8.173058
## iter 80 value 8.171417
## iter 90 value 8.170625
## iter 100 value 8.170058
## final value 8.170058
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 75.177306
## iter 10 value 2.243684
## iter 20 value 1.534463
## iter 30 value 0.433129
## iter 40 value 0.154217
## iter 50 value 0.144209
## iter 60 value 0.085468
## iter 70 value 0.061275
## iter 80 value 0.053074
## iter 90 value 0.041694
## iter 100 value 0.036679
## final value 0.036679
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 81.260625
## iter 10 value 3.389063
## iter 20 value 1.527312
## iter 30 value 0.174777
## iter 40 value 0.135477
## iter 50 value 0.070857
## iter 60 value 0.054661
## iter 70 value 0.047655
## iter 80 value 0.039987
## iter 90 value 0.035506
## iter 100 value 0.032602
## final value 0.032602
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## # weights: 83
## initial value 84.575494
## iter 10 value 18.085247
## final value 18.085198
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## # weights: 247
## initial value 78.032179
## iter 10 value 7.503883
## iter 20 value 1.448965
## iter 30 value 1.386272
## iter 40 value 0.005642
## iter 50 value 0.002634
## iter 60 value 0.001669
## iter 70 value 0.001376
## iter 80 value 0.000380
## iter 90 value 0.000289
## iter 100 value 0.000171
## final value 0.000171
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## # weights: 411
## initial value 77.106773
## iter 10 value 1.573781
## iter 20 value 0.065635
## iter 30 value 0.014075
## iter 40 value 0.003513
## iter 50 value 0.000699
## iter 60 value 0.000277
## final value 0.000088
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## # weights: 83
## initial value 90.018263
## iter 10 value 19.128137
## iter 20 value 12.063274
## iter 30 value 10.666813
## iter 40 value 10.615723
## iter 50 value 10.615513
## final value 10.615513
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## # weights: 247
## initial value 88.487395
## iter 10 value 17.253317
## iter 20 value 9.056591
## iter 30 value 5.535172
## iter 40 value 5.371946
## iter 50 value 5.371081
## final value 5.371064
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## # weights: 411
## initial value 134.047989
## iter 10 value 13.205610
## iter 20 value 5.081229
## iter 30 value 4.491152
## iter 40 value 4.465657
## iter 50 value 4.465407
## final value 4.465402
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## # weights: 83
## initial value 78.555308
## iter 10 value 13.760224
## iter 20 value 8.202709
## iter 30 value 8.177486
## iter 40 value 8.176874
## iter 50 value 8.162793
## iter 60 value 7.464108
## iter 70 value 4.889542
## iter 80 value 0.634184
## iter 90 value 0.130710
## iter 100 value 0.082904
## final value 0.082904
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## # weights: 247
## initial value 110.338405
## iter 10 value 11.148513
## iter 20 value 8.637958
## iter 30 value 8.253434
## iter 40 value 4.878137
## iter 50 value 4.861398
## iter 60 value 0.911550
## iter 70 value 0.094895
## iter 80 value 0.085611
## iter 90 value 0.070217
## iter 100 value 0.065438
## final value 0.065438
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses7
## # weights: 411
## initial value 109.861894
## iter 10 value 13.011499
## iter 20 value 7.993956
## iter 30 value 5.203492
## iter 40 value 5.147781
## iter 50 value 4.513468
## iter 60 value 3.010592
## iter 70 value 0.301052
## iter 80 value 0.162978
## iter 90 value 0.153303
## iter 100 value 0.140041
## final value 0.140041
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 79.556502
## iter 10 value 6.515499
## iter 20 value 0.392009
## iter 30 value 0.025637
## iter 40 value 0.002196
## iter 50 value 0.000553
## iter 60 value 0.000130
## iter 60 value 0.000072
## iter 60 value 0.000072
## final value 0.000072
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 89.990310
## iter 10 value 2.388830
## iter 20 value 1.913248
## iter 30 value 1.390752
## iter 40 value 1.386772
## iter 50 value 1.386640
## iter 60 value 1.386517
## iter 70 value 1.386321
## final value 1.386294
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 120.171277
## iter 10 value 2.318178
## iter 20 value 2.262596
## iter 30 value 2.249363
## iter 40 value 2.014047
## iter 50 value 1.909734
## final value 1.909587
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 81.505147
## iter 10 value 24.936676
## iter 20 value 10.408844
## iter 30 value 10.171230
## iter 40 value 10.163501
## final value 10.163501
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 77.835027
## iter 10 value 13.539075
## iter 20 value 6.637977
## iter 30 value 5.619076
## iter 40 value 5.368213
## final value 5.368091
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 98.768147
## iter 10 value 6.263095
## iter 20 value 4.518790
## iter 30 value 4.452266
## iter 40 value 4.450987
## final value 4.450986
## converged
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 80.164292
## iter 10 value 22.809665
## iter 20 value 10.184019
## iter 30 value 10.164862
## iter 40 value 10.157933
## iter 50 value 10.142994
## iter 60 value 4.847206
## iter 70 value 0.163345
## iter 80 value 0.070804
## iter 90 value 0.064345
## iter 100 value 0.057228
## final value 0.057228
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 247
## initial value 116.007248
## iter 10 value 4.923078
## iter 20 value 4.779633
## iter 30 value 4.338244
## iter 40 value 2.861976
## iter 50 value 2.550241
## iter 60 value 2.369424
## iter 70 value 1.495746
## iter 80 value 0.220865
## iter 90 value 0.150654
## iter 100 value 0.135248
## final value 0.135248
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 411
## initial value 106.521447
## iter 10 value 0.410637
## iter 20 value 0.296084
## iter 30 value 0.270696
## iter 40 value 0.170487
## iter 50 value 0.141572
## iter 60 value 0.120177
## iter 70 value 0.097221
## iter 80 value 0.066111
## iter 90 value 0.057062
## iter 100 value 0.049191
## final value 0.049191
## stopped after 100 iterations
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## # weights: 83
## initial value 88.087835
## iter 10 value 33.004046
## iter 20 value 16.844765
## iter 30 value 11.852408
## iter 40 value 11.094320
## iter 50 value 11.044422
## iter 60 value 11.042636
## iter 70 value 11.042410
## iter 80 value 11.042389
## final value 11.042387
## converged
resultado_entrenamiento5 <- predict(modelo5, entrenamiento)
resultado_prueba5 <- predict(modelo5, prueba)
#Matriz de Consufión
mcre5 <- confusionMatrix(resultado_entrenamiento5,entrenamiento$Class) #Matriz de confusion de resultado de entrenamiento
mcre5
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 88 0
## malignant 0 47
##
## Accuracy : 1
## 95% CI : (0.973, 1)
## No Information Rate : 0.6519
## P-Value [Acc > NIR] : < 2.2e-16
##
## Kappa : 1
##
## Mcnemar's Test P-Value : NA
##
## Sensitivity : 1.0000
## Specificity : 1.0000
## Pos Pred Value : 1.0000
## Neg Pred Value : 1.0000
## Prevalence : 0.6519
## Detection Rate : 0.6519
## Detection Prevalence : 0.6519
## Balanced Accuracy : 1.0000
##
## 'Positive' Class : benign
##
mcrp5 <- confusionMatrix(resultado_prueba5, prueba$Class) #Matriz de confusion de resultado de prueba
mcrp5
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 344 11
## malignant 12 181
##
## Accuracy : 0.958
## 95% CI : (0.9377, 0.9732)
## No Information Rate : 0.6496
## P-Value [Acc > NIR] : <2e-16
##
## Kappa : 0.9079
##
## Mcnemar's Test P-Value : 1
##
## Sensitivity : 0.9663
## Specificity : 0.9427
## Pos Pred Value : 0.9690
## Neg Pred Value : 0.9378
## Prevalence : 0.6496
## Detection Rate : 0.6277
## Detection Prevalence : 0.6478
## Balanced Accuracy : 0.9545
##
## 'Positive' Class : benign
##
modelo6 <- train(Class ~ ., data=entrenamiento,
method = "rf",
preProcess = c("scale", "center"),
trControl = trainControl(method="cv", number=10),
tuneGrid = expand.grid(mtry=c(2,4,6))
)
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7,
## Mitoses8
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses6, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses6, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses5,
## Mitoses6, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bare.nuclei9, Bl.cromatin9,
## Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
## Warning in preProcess.default(thresh = 0.95, k = 5, freqCut = 19, uniqueCut =
## 10, : These variables have zero variances: Bl.cromatin9, Mitoses4, Mitoses7
resultado_entrenamiento6 <- predict(modelo6, entrenamiento)
resultado_prueba6 <- predict(modelo6, prueba)
#Matriz de Consufión
mcre6 <- confusionMatrix(resultado_entrenamiento6,entrenamiento$Class) #Matriz de confusion de resultado de entrenamiento
mcre6
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 88 0
## malignant 0 47
##
## Accuracy : 1
## 95% CI : (0.973, 1)
## No Information Rate : 0.6519
## P-Value [Acc > NIR] : < 2.2e-16
##
## Kappa : 1
##
## Mcnemar's Test P-Value : NA
##
## Sensitivity : 1.0000
## Specificity : 1.0000
## Pos Pred Value : 1.0000
## Neg Pred Value : 1.0000
## Prevalence : 0.6519
## Detection Rate : 0.6519
## Detection Prevalence : 0.6519
## Balanced Accuracy : 1.0000
##
## 'Positive' Class : benign
##
mcrp6 <- confusionMatrix(resultado_prueba6, prueba$Class) #Matriz de confusion de resultado de prueba
mcrp6
## Confusion Matrix and Statistics
##
## Reference
## Prediction benign malignant
## benign 345 12
## malignant 11 180
##
## Accuracy : 0.958
## 95% CI : (0.9377, 0.9732)
## No Information Rate : 0.6496
## P-Value [Acc > NIR] : <2e-16
##
## Kappa : 0.9077
##
## Mcnemar's Test P-Value : 1
##
## Sensitivity : 0.9691
## Specificity : 0.9375
## Pos Pred Value : 0.9664
## Neg Pred Value : 0.9424
## Prevalence : 0.6496
## Detection Rate : 0.6296
## Detection Prevalence : 0.6515
## Balanced Accuracy : 0.9533
##
## 'Positive' Class : benign
##
resultados <- data.frame(
"svmLinear" = c(mcre1$overall["Accuracy"], mcrp1$overall["Accuracy"]),
"svmRadial" = c(mcre2$overall["Accuracy"], mcrp2$overall["Accuracy"]),
"svmPoly" = c(mcre3$overall["Accuracy"], mcrp3$overall["Accuracy"]),
"rpart" = c(mcre4$overall["Accuracy"], mcrp4$overall["Accuracy"]),
"nnet" = c(mcre5$overall["Accuracy"], mcrp5$overall["Accuracy"]),
"rf" = c(mcre6$overall["Accuracy"], mcrp6$overall["Accuracy"])
)
rownames(resultados) <- c("Precision de entrenamiento", "Precision de prueba")
resultados
## svmLinear svmRadial svmPoly rpart nnet
## Precision de entrenamiento 1.0000000 1.000000 1.0000000 0.9407407 1.0000000
## Precision de prueba 0.9580292 0.649635 0.9580292 0.9270073 0.9580292
## rf
## Precision de entrenamiento 1.0000000
## Precision de prueba 0.9580292