I am using Max-min Markov blanket algorithm for variable selection in R
from MXM
package. Following is my code:
library(MXM)
dataset = read.table('data.txt', na.string = c("", "NA"), sep = '\t', header = FALSE)
dataset = dataset[, colSums(is.na(dataset)) == 0]
D = as.matrix(as.data.frame(lapply(dataset, as.numeric)))
target = read.table('class_num.txt')
target = c(target)
aa = mmmb(target, D, max_k = 3, threshold = 0.05, test = "testIndFisher", user_test = NULL, robust = FALSE, ncores = 2)
I am getting the following error:
Error in unique(as.numeric(target)) :
(list) object cannot be coerced to type 'double'
According to the mmmb manual page my dataset D
is a matrix of continuous value of dimension (95933 x 85)
and my target
is a vector of [0, 1]
of size 95933
.
Can someone help me understand the error?