【问题标题】:Issue in creating Vectors from text in Mahout从 Mahout 中的文本创建向量的问题
【发布时间】:2016-02-08 00:52:15
【问题描述】:

我正在使用 Mahout 0.9(安装在 HDP 2.2 上)进行主题发现(潜在 Drichlet 分配算法)。我将文本文件存储在目录中 inputraw 并依次执行以下命令

命令#1:

mahout seqdirectory -i inputraw -o output-directory -c UTF-8

命令 #2:

mahout seq2sparse -i output-directory -o output-vector-str -wt tf -ng 3 --maxDFPercent 40 -ow -nv

命令#3:

mahout rowid -i output-vector-str/tf-vectors/ -o output-vector-int

命令#4:

mahout cvb -i output-vector-int/matrix -o output-topics -k 1 -mt output-tmp -x 10 -dict output-vector-str/dictionary.file-0

执行第二条命令后,正如预期的那样,它在下面创建了一堆子文件夹和文件 output-vector-str(命名为 df-countdictionary.file-0frequency.file-0tf-vectorstokenized-documentswordcount)。考虑到我的输入文件的大小,这些文件的大小看起来都还可以,但是 ``tf-vectors` 下的文件非常小,实际上只有 118 个字节)。

显然是

`tf-vectors` is the input to the 3rd command, the third command also generates a file of small size. Does anyone know:
  1. 下文件的原因是什么

    `tf-vectors` folder to be that small? There must be something wrong.
    
  2. 从第一个命令开始,所有生成的文件都有一个奇怪的编码,也不是人类可读的。这是预料之中的事情吗?

【问题讨论】:

    标签: hadoop mapreduce mahout hortonworks-data-platform


    【解决方案1】:

    你的答案如下:

    1. tf-vectors 文件夹下的文件这么小是什么原因?

    考虑到您将 maxdf 百分比设置为仅 40%,向量很小,这意味着仅会考虑文档频率(整个文档中出现的术语的百分比频率)小于 40% 的术语。换句话说,在生成向量时,只会考虑出现在 40% 或更少的文档中的术语。

    1. tf-vectors 文件夹下的文件这么小是什么原因?

    mahout 中有一个名为mahout seqdumper 的命令,可以帮助您将“顺序”格式的文件转储为“人类”可读格式。 祝你好运!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-31
      • 1970-01-01
      • 1970-01-01
      • 2014-12-10
      • 1970-01-01
      • 1970-01-01
      • 2021-09-12
      • 2013-01-10
      相关资源
      最近更新 更多