...
|
...
|
@@ -8,7 +8,9 @@ differentMeansRanking <- function(measurementsTrain, classesTrain, verbose = 3)
|
8
|
8
|
categorical <- sapply(measurementsTrain, class) %in% c("character", "factor")
|
9
|
9
|
if(any(categorical)){
|
10
|
10
|
pValues[categorical] <- sapply(which(categorical), function(featureIndex){
|
11
|
|
- chisq.test(measurementsTrain[, featureIndex], classesTrain)$p.value
|
|
11
|
+ pval <- 1
|
|
12
|
+ if(length(unique(measurementsTrain[, featureIndex])>1)) pval <- chisq.test(measurementsTrain[, featureIndex], classesTrain)$p.value
|
|
13
|
+ pval
|
12
|
14
|
})
|
13
|
15
|
}
|
14
|
16
|
|