使用 mRMRe 进行分类目标变量的特征选择

Using mRMRe for feature selection with Categorical target variable

我正在尝试使用 R 中的 mRMRe 包对基因表达数据集进行特征选择。

我的目标变量是一个分类变量,即每个样本都关联到一个class,用作目标变量。

但是,通过使用 mRMRe 包,当我尝试加载数据时出现以下错误:

data <- mRMR.data(data = data)

Error in .local(.Object, ...): data columns must be either of numeric, ordered factor or Surv type
Traceback:

1. mRMR.data(data = data)
2. new("mRMRe.Data", ...)
3. initialize(value, ...)
4. initialize(value, ...)
5. .local(.Object, ...)
6. stop("data columns must be either of numeric, ordered factor or Surv type")

第一列有分类标签,例如"Class1"、"Class2" 等。当我使用 str(data) 时,我发现第一列是 Factor 类型。但是,它不能排序,因为它是分类的。

有没有可能mRMRe不能处理分类数据?

该列必须按 ordered(data$variable1) 转换为有序因子 str(data) 应该类似于 Ord.factor

我收到了开发人员的答复并且:

The target variable can be categorical only if ordered. In the case of 2 categories, the order is arbitrary. For more categories that are not logically ordered (multicategorical classification) mRMRe is not adapted.

所以在这种情况下我不能使用它,因为我的标签是分类的。