Mahout algorithm Canopy Source analysis: Get input data
Source: Internet
Author: User
Keywordsnbsp algorithm Java face
For canopy input data needs to be in the form of sequential files, while ensuring Key:text, http://www.aliyun.com/zixun/aggregation/9541.html "> Value:vectorwritable. Last night prepared to use a simple Java program to get ready to input data, but always will be a problem, last night's problem "can not find the file" for the moment has not found the reason.
In fact, if you just want to get input data, you can use the method provided by Mahout official website to copy the Mahout-distribution-0.7.zip to the virtual machine directly after getting the *.txt file of the sequence, (in/etc/ Profile to configure the next hadoop_home variable) and then locate the Mahout_home/bin directory, perform chmod +x mahout, and then perform the respective
The above <input>, <output> corresponds to its own input and output; The data I use is not the full data of the Reuters dataset, but the top three: REUT2-000.SGM, REUT2-001.SGM, REUT2-002.SGM, such data after Extractreuters became 3,000 files, and then after Seqdirectory merged into a 2.41M data file. Seq2sparse has 7 jobs, each job is responsible for its own content, this temporary analysis, the final result in the <output-in>/tfidf-vectors, that is, input data;
With the input data you can run the program, first, regardless of what the program looks like, first run out of the results to say:
At the beginning of my T1, T2 set to 3.1, 2.1 results map out of the result is 0 (this is not known what it means), and later changed to see the results of the map output of 509 records, Reduece Output 3 Records (the set value of the parameter Clusterfileter: 3), the final output is: canopy-output/clusters-0-final/part-r-00000.
In order to facilitate the observation of the following, so do not use the above data, and the use of their own data, to create data before the first need to know the format of the input data, then use the following code to see what the input data is:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.