如何处理 SVR 任务中的高维稀疏特征?

How could I deal with the sparse feature with high dimension in an SVR task?

我有一个类似 Twitter 的(另一个微博)数据集,包含 160 万个数据点,并试图根据其内容预测其转发数量。我提取了它的关键字并将关键字用作词袋特征。然后我得到了120万维的特征。特征向量非常稀疏,通常一个数据点只有十维。我使用 SVR 进行回归。现在已经用了2天了。我认为训练时间可能需要相当长的时间。我不知道我像这样做这个任务是否正常。有什么办法或者有必要优化这个问题吗?
顺便提一句。如果在这种情况下,我不使用任何内核并且机器是 32GB RAM 和 i-7 16 核。估计训练时间是多久?我使用了 lib pyml.

一开始你可以简单地去掉所有高频词和所有低频词,因为它们都不能告诉你太多关于文本内容的信息,然后你必须做一个词干。

之后你可以尝试降低 space 的维度,使用 Feature hashing, or some more advance dimensionality reduction trick (PCA, ICA),甚至两者都降低。

您需要找到适合您问题的降维方法。

我处理过与您类似的问题,我发现信息增益效果很好,但还有其他问题。

我发现这篇论文(Fabrizio Sebastiani,自动文本分类中的机器学习,ACM Computing Surveys,第 34 卷,第 1 期,第 1-47 页,2002 年)是对文本分类的很好的理论处理,包括通过从简单的(词频)到复杂的(信息理论)的各种方法进行特征缩减。

These functions try to capture the intuition that the best terms for ci are the ones distributed most differently in the sets of positive and negative examples of ci. However, interpretations of this principle vary across different functions. For instance, in the experimental sciences χ2 is used to measure how the results of an observation differ (i.e., are independent) from the results expected according to an initial hypothesis (lower values indicate lower dependence). In DR we measure how independent tk and ci are. The terms tk with the lowest value for χ2(tk, ci) are thus the most independent from ci; since we are interested in the terms which are not, we select the terms for which χ2(tk, ci) is highest.

这些技术可帮助您选择最有用的术语,将训练文档分成给定的 类;对您的问题具有最高预测值的术语。

我已成功使用信息增益进行特征缩减,并发现这篇论文(用于文本分类的基于熵的特征选择 Largeron、Christine 和 Moulin、Christophe 和 Géry、Mathias - SAC - 第 924-928 页 2011)是很好的实用指南。

在这里,作者提出了一个基于熵的特征选择的简单公式,这对在代码中实现很有用:

Given a term tj and a category ck, ECCD(tj , ck) can be computed from a contingency table. Let A be the number of documents in the category containing tj ; B, the number of documents in the other categories containing tj ; C, the number of documents of ck which do not contain tj and D, the number of documents in the other categories which do not contain tj (with N = A + B + C + D):

使用这种偶然性 table,信息增益可以通过以下方式估算:

这种方法易于实施,并提供非常好的信息论特征缩减。

你也不需要使用单一的技术;你可以把它们结合起来。 Ter-Frequency 很简单,但也很有效。我将信息增益方法与词频相结合,成功地进行了特征选择。您应该对您的数据进行试验,以查看哪种或哪些技术最有效。