- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我使用的hadoop版本是
$ hadoop version
Hadoop 2.5.0-cdh5.2.0
Subversion http://github.com/cloudera/hadoop -r e1f20a08bde76a33b79df026d00a0c91b2298387
Compiled by jenkins on 2014-10-11T21:00Z
Compiled with protoc 2.5.0
From source with checksum 309bccd135b199bdfdd6df5f3f4153d
This command was run using /DCNFS/applications/cdh/5.2/app/hadoop-2.5.0-cdh5.2.0/share/hadoop/common/hadoop-common-2.5.0-cdh5.2.0.jar
我的 input.txt 看起来像
$ hadoop dfs -cat input/input.txt | head -5
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
1: 1664968
2: 3 747213 1664968 1691047 4095634 5535664
3: 9 77935 79583 84707 564578 594898 681805 681886 835470 880698 1109091 1125108 1279972 1463445 1497566 1783284 1997564 2006526 2070954 2250217 2268713 2276203 2374802 2571397 2640902 2647217 2732378 2821237 3088028 3092827 3211549 3283735 3491412 3492254 3498305 3505664 3547201 3603437 3617913 3793767 3907547 4021634 4025897 4086017 4183126 4184025 4189168 4192731 4395141 4899940 4987592 4999120 5017477 5149173 5149311 5158741 5223097 5302153 5474252 5535280
4: 145
5: 8 57544 58089 60048 65880 284186 313376 564578 717529 729993 1097284 1204280 1204407 1255317 1670218 1720928 1850305 2269887 2333350 2359764 2640693 2743982 3303009 3322952 3492254 3573013 3721693 3797343 3797349 3797359 3849461 4033556 4173124 4189215 4207986 4669945 4817900 4901416 5010479 5062062 5072938 5098953 5292042 5429924 5599862 5599863 5689049
我的 users.txt 看起来像
$ hadoop dfs -cat input/users.txt
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
3: 9 77935 79583 84707 564578 594898 681805 681886 835470 880698 1109091
1125108 1279972 1463445 1497566 1783284 1997564 2006526 2070954 2250217
2268713 2276203 2374802 2571397 2640902 2647217 2732378 2821237 3088028
3092827 3211549 3283735 3491412 3492254 3498305 3505664 3547201 3603437
3617913 3793767 3907547 4021634 4025897 4086017 4183126 4184025 4189168
4192731 4395141 4899940 4987592 4999120 5017477 5149173 5149311 5158741
5223097 5302153 5474252 5535280
我的工作是
$ hadoop jar mahout-core-0.9-cdh5.2.0-job.jar org.apache.mahout.cf.taste.hadoop.item.RecommenderJob -Dmapred.input.dir=input/input.txt -Dmapred.output.dir=output --usersFile input/users.txt --booleanData -s SIMILARITY_COOCCURRENCE
它失败了,跟踪如下
15/02/07 16:48:44 INFO common.AbstractJob: Command line arguments: {--booleanData=[false], --endPhase=[2147483647], --maxPrefsInItemSimilarity=[500], --maxPrefsPerUser=[10], --maxSimilaritiesPerItem=[100], --minPrefsPerUser=[1], --numRecommendations=[10], --similarityClassname=[SIMILARITY_COOCCURRENCE], --startPhase=[0], --tempDir=[temp], --usersFile=[input/users.txt]}
15/02/07 16:48:44 INFO common.AbstractJob: Command line arguments: {--booleanData=[false], --endPhase=[2147483647], --input=[input/input.txt], --minPrefsPerUser=[1], --output=[temp/preparePreferenceMatrix], --ratingShift=[0.0], --startPhase=[0], --tempDir=[temp]}
15/02/07 16:48:44 INFO Configuration.deprecation: mapred.input.dir is deprecated. Instead, use mapreduce.input.fileinputformat.inputdir
15/02/07 16:48:44 INFO Configuration.deprecation: mapred.compress.map.output is deprecated. Instead, use mapreduce.map.output.compress
15/02/07 16:48:44 INFO Configuration.deprecation: mapred.output.dir is deprecated. Instead, use mapreduce.output.fileoutputformat.outputdir
15/02/07 16:48:44 INFO client.RMProxy: Connecting to ResourceManager at name1.hadoop.dc.engr.scu.edu/10.128.0.201:8032
15/02/07 16:48:45 INFO input.FileInputFormat: Total input paths to process : 1
15/02/07 16:48:45 INFO mapreduce.JobSubmitter: number of splits:8
15/02/07 16:48:46 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1422500076160_0023
15/02/07 16:48:46 INFO impl.YarnClientImpl: Submitted application application_1422500076160_0023
15/02/07 16:48:46 INFO mapreduce.Job: The url to track the job: http://name1.hadoop.dc.engr.scu.edu:8088/proxy/application_1422500076160_0023/
15/02/07 16:48:46 INFO mapreduce.Job: Running job: job_1422500076160_0023
15/02/07 16:48:56 INFO mapreduce.Job: Job job_1422500076160_0023 running in uber mode : false
15/02/07 16:48:56 INFO mapreduce.Job: map 0% reduce 0%
15/02/07 16:49:02 INFO mapreduce.Job: Task Id : attempt_1422500076160_0023_m_000006_0, Status : FAILED
Error: java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.mahout.cf.taste.hadoop.item.ItemIDIndexMapper.map(ItemIDIndexMapper.java:50)
at org.apache.mahout.cf.taste.hadoop.item.ItemIDIndexMapper.map(ItemIDIndexMapper.java:31)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:784)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1614)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
15/02/07 16:49:02 INFO mapreduce.Job: Task Id : attempt_1422500076160_0023_m_000001_0, Status : FAILED
Error: java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.mahout.cf.taste.hadoop.item.ItemIDIndexMapper.map(ItemIDIndexMapper.java:50)
at org.apache.mahout.cf.taste.hadoop.item.ItemIDIndexMapper.map(ItemIDIndexMapper.java:31)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:784)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1614)
at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
我认为数据格式不正确,有人可以帮我解决这个问题吗?我是 MapReduce
和 Hadoop
非常感谢
最佳答案
我不再从事该项目,现阶段本书不受支持。但似乎您是在原始输入上运行此作业,而不是在使用您在书中看到的自定义映射器将其从这种格式解析为标准格式之后。
关于java - Mahout 在行动 : Chapter 06: Wikipedia job fails with java. lang.ArrayIndexOutOfBoundsException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28389488/
我正在尝试在维基百科上找到所有图像的完整列表,然后我可以将其过滤到公共(public)领域的图像。我已经从这里下载了 SQL 转储: http://dumps.wikimedia.org/enwiki
我正在学习使用 rasa 语言。为了使目标的答案多样化,我决定使用 Wikipedia api。为了创建我的工作环境,我使用带有以下命令的 anaconda: conda create --name
本页:http://wikidata.dbpedia.org/downloads/20160111/ 有一个名为 wikidatawiki-20160111-page-ids.ttl.bz2 的转储
这个问题已经有答案了: How to get the Infobox data from Wikipedia? (8 个回答) 已关闭 3 年前。 维基百科文章可能有信息框模板。通过以下调用,我可以获
我正在使用 Wikipedia API,在其中获取我输入的某些字符串的图像。 它总是返回 10 个结果,但我想要超过大约 50 个。 https://en.wikipedia.org/w/api.ph
我需要从 jquery(首选)或 php 数组中的特定维基百科文章获取“外部链接”链接。我已经浏览了维基百科 api,但似乎没有办法做到这一点。看起来 dbpedia 有一种方法可以做到这一点(dbp
我想在 python 程序中访问给定文章标题的维基百科信息框图像。有人可以告诉我如何获得吗? 以下截图提供了页面中所有图像的列表。我只想访问信息框图像。我该怎么做? import wikipedia
给定维基百科上的任何页面,例如 Coffee 的页面,我试图弄清楚如何提取页面上所有引用(包括任何元数据)的列表。乍一看,这似乎很容易,因为大多数页面都将它们全部列在称为“引用”的部分下。但是,当您检
我想计算特定语言的 wiki 转储中的实体/类别,比如英语。对于初学者来说,很难找到/遵循官方文档。到目前为止我所了解的是我可以下载一个 XML 转储(我从所有可用的不同文件中下载什么),并解析它(?
是否有任何 API 可以使用该页面的标题或页面 ID 或 url 获取页面的所有类别?我尝试在网上搜索,但我能找到的只是获取特定类别的转储。任何形式的帮助将不胜感激。 谢谢 最佳答案 您正在寻找的 A
Closed. This question is off-topic。它当前不接受答案。 想要改善这个问题吗? Update the question,所以它是用于堆栈溢出的on-topic。 9年前
我正在尝试构建维基百科文章及其类别的树形图。我需要做什么? 从这个站点(http://dumps.wikimedia.org/enwiki/latest/),我下载了: enwiki-latest-p
我使用 Wikipedia API 检索给定类别的页面列表。然而,页面由它们的 page_id 表示。如何使用 Wikipedia API 通过 page_id 获取页面的实际文本内容 最佳答案 AF
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想要改善这个问题吗?更新问题,以便将其作为on-topi
以这个Freebase查询为例,如何使用Wikidata API运行相同的查询? [{ "id": null, "name": null, "type": "/film/film",
有没有一种方法可以使用 MediaWiki API 或任何其他工具自动检索使用大概日期的维基百科文章的先前版本(不知道 'oldid' 值)? 例如,我如何检索 history version of
从Wikipedia获取有关人员的所有文章的最简单方法是什么?我知道我可以下载所有页面的转储,但是然后如何过滤这些页面并仅获取有关人员的页面?我需要尽可能多的东西(最好超过一百万),因此使用任何一种A
有这个花哨的infobox在 中。如何获得 的值? 最佳答案 错误的方法:尝试解析 HTML Use (cURL/jQuery/file_get_contents/requests/wget/mor
我需要检索某个 wiki 项目的所有现有语言的列表。例如,所有 Wikivoyage或全部Wikipedia语言,就像他们的登陆页面一样。 如果可能的话,我更喜欢通过 MediaWiki API 来完
我需要访问非常旧的法语维基百科转储(维基百科的备份)。我成功地从 archive.org 找到了 2010 年的备份,现在我正在搜索 2006 年甚至更早的版本。我知道在最新的转储中包含以前的所有数据
我是一名优秀的程序员,十分优秀!