A. Covert text file to sequeces file
Class: SequenceFilesFromDirectory
Functions: Converts a directory of text documents into SequenceFiles of Specified chunkSize. This class takes in a parent directory containing sub folders of text documents and recursively reads the files and creates the {@link org.apache.hadoop.io.SequenceFile}s of docid => content. The docid is set as the relative path of the document from the parent directory prepended with a specified prefix. You can also specify the input encoding of the text files. The content of the output SequenceFiles are encoded as UTF-8 text.
B.Covert sequences file to Document Vectors
Class: SparseVectorsFromSequenceFiles
Functions: Converts a given set of sequence files into SparseVectors
1. tokenize the documents in sequence file
DocumentProcessor.tokenizeDocuments(inputDir, analyzerClass, tokenizedPath, conf);
Key: /2435: Value: 为什么很多看起来不是很复杂的网站,比如 Facebook 需要大量顶尖高手来开发?
Key: /2436: Value: iNOKNOK敲门网络是怎样的一个网站?
Key: /2437: Value: 北京上海生活成本为何超过了巴黎和纽约?
======>
Key: /2435: Value: [为什么, 很多, 看起来, 不是, 很复杂, 网站, 比如, facebook, 需要, 大量, 顶尖, 高手, 开发]
Key: /2436: Value: [inoknok, 敲门, 网络, 怎样, 一个, 网站]
Key: /2437: Value: [北京, 上海, 生活, 成本, 为何, 超过, 巴黎, 纽约]
2.Create Term Frequency (Tf) Vectors from the input set of documents
DictionaryVectorizer.createTermFrequencyVectors
2-1 startWordCounting(input, dictionaryJobPath, baseConf, minSupport);
Count the frequencies of words in parallel using Map/Reduce. If term frequency in the corpus is smaller than
minSupport, then the term will be stripped, which means that the word or term will not be included in the dictionary.
tokenzied-documents:
Key: /2435: Value: [为什么, 很多, 看起来, 不是, 很复杂, 网站, 比如, facebook, 需要, 大量, 顶尖, 高手, 开发]
Key: /2436: Value: [inoknok, 敲门, 网络, 怎样, 一个, 网站]
Key: /2437: Value: [北京, 上海, 生活, 成本, 为何, 超过, 巴黎, 纽约]
.......
=============>
wordcount:
Key: 专用: Value: 1
Key: 世外桃源: Value: 1
Key: 世界: Value: 13
Key: 世界上: Value: 6
Key: 世界杯: Value: 20
Key: 世界观: Value: 1
2-2 Read the feature frequency List which is built at the end of the Word Count Job and assign ids to them
createDictionaryChunks(dictionaryJobPath, output, baseConf, chunkSizeInMegabytes, maxTermDimension);
wordcount:
Key: 80、90后最大疑惑: Value: 1
Key: -727379968: Value: 1
Key: 0.25%: Value: 1
Key: 0.9秒: Value: 1
Key: 00: Value: 1
Key: 001: Value: 1
Key: 0day: Value: 1
Key: 1.8: Value: 1
Key: 1/100: Value: 1
Key: 10: Value: 4
......
===========>
dictionary:
Key: 80、90后最大疑惑: Value: 0
Key: -727379968: Value: 1
Key: 0.25%: Value: 2
Key: 0.9秒: Value: 3
Key: 00: Value: 4
Key: 001: Value: 5
Key: 0day: Value: 6
Key: 1.8: Value: 7
Key: 1/100: Value: 8
Key: 10: Value: 9
Key: 100: Value: 10
.........
2-3 Create a partial vector using a chunk of features from the input documents. And merge partial vector to complete document vector
makePartialVectors
PartialVectorMerger.mergePartialVectors
dictionary
Key: 80、90后最大疑惑: Value: 0Key: -727379968: Value: 1
Key: 0.25%: Value: 2
Key: 0.9秒: Value: 3
tokenized-documents
Key: /2435: Value: [为什么, 很多, 看起来, 不是, 很复杂, 网站, 比如, facebook, 需要, 大量, 顶尖, 高手, 开发]
Key: /2436: Value: [inoknok, 敲门, 网络, 怎样, 一个, 网站]
Key: /2437: Value: [北京, 上海, 生活, 成本, 为何, 超过, 巴黎, 纽约]
......
======>
Key: /2435: Value: {181:1.0,512:1.0,618:1.0,1738:1.0,2142:1.0,2221:1.0,2222:1.0,3072:1.0,3517:1.0,3776:1.0,4518:1.0,4545:1.0,4631:1.0}
Key: /2436: Value: {210:1.0,329:1.0,2296:1.0,2666:1.0,3776:1.0,3777:1.0}
Key: /2437: Value: {441:1.0,619:1.0,1208:1.0,2066:1.0,2390:1.0,3375:1.0,3714:1.0,4173:1.0}
.......
3. Calculates the document frequencies of all terms from the input set of vectors
相关推荐
Unsupervised Learning: Principle Component Analysis Dimension Reduction Clustering Distributed Representation PCA PCA – Another Point of View
基于改进K-means算法的光伏曲线聚类分析与优化研究,基于K-means算法的光伏曲线聚类研究 关键词:k-means 光伏聚类 聚类 参考文档:《基于改进 K-means 聚类的风光发电场景划分》仅部分参考 仿真平台:MATLAB平台 ...
MATLAB代码:基于K-means算法的光伏曲线聚类研究 关键词:k-means 光伏聚类 聚类 参考文档:《基于改进 K-means 聚类的风光发电场景划分》仅部分参考,非完全复现 仿真平台:MATLAB平台 主要内容:代码主要做的是一...
基于K-means算法的光伏曲线聚类研究 关键词:k-means 光伏聚类 聚类 参考文档:《基于改进 K-means 聚类的风光发电场景划分》仅部分参考 仿真平台:MATLAB平台 主要内容:代码主要做的是一个光伏曲线聚类的模型,...
基于Matlab的彩色图像K-means与Mean Shift聚类分析GUI系统:可视化迭代轨迹与聚类结果,基于Matlab的彩色图像K-means与Mean Shift聚类分析GUI系统:可视化迭代轨迹与聚类结果,74.基于matlab的图像k-means聚类GUI,可...
基于MATLAB的K-means算法光伏曲线聚类分析与优化研究,MATLAB代码:基于K-means算法的光伏曲线聚类研究 关键词:k-means 光伏聚类 聚类 参考文档:《基于改进 K-means 聚类的风光发电场景划分》仅部分参考,非完全...
毕业设计:基于C++的AP聚类算法设计与实现 毕业设计:基于C++的AP聚类算法设计与实现 毕业设计:基于C++的AP聚类算法设计与实现 毕业设计:基于C++的AP聚类算法设计与实现 毕业设计:基于C++的AP聚类算法设计与实现 ...
基于K-means算法的MATLAB光伏曲线聚类模型研究与应用,基于改进K-means算法的光伏曲线聚类分析与优化研究,基于K-means算法的光伏曲线聚类研究 关键词:k-means 光伏聚类 聚类 参考文档:《基于改进 K-means 聚类的...
基于K-means算法的光伏时间序列聚类分析与优化调度研究,关键词:光伏聚类 K-means聚类 时间序列 编程语言:matlab 主题:基于k-means算法的光伏时间序列聚类 主要内容: 本代码研究大量随机场景下光伏序列聚类与...
kmeans数据集:20 支亚洲球队的聚类问题
基于K-means算法的光伏时间序列聚类优化与评估研究,关键词:光伏聚类 K-means聚类 时间序列 编程语言:matlab 主题:基于k-means算法的光伏时间序列聚类 主要内容: 本代码研究大量随机场景下光伏序列聚类与削减...
基于K-means算法的光伏时间序列聚类优化与调度评估研究,基于K-means算法的光伏时间序列聚类分析与优化调度研究,关键词:光伏聚类 K-means聚类 时间序列 编程语言:matlab 主题:基于k-means算法的光伏时间序列聚类 ...
MATLAB辅助的Kmeans聚类中心自动寻优工具:通过简易界面实现最佳聚类数自动计算与聚类结果可视化展示,基于MATLAB界面的Kmeans自动寻找与展示最佳聚类中心应用软件,基于MATLAB的Kmeans自动寻找最佳聚类中心App。...
DBSCAN(Density-Based Spatial Clustering of Applications with Noise)是一种基于密度的空间聚类算法,由Martin Ester等人于1996年提出。该算法的核心思想是基于密度的概念来确定簇的边界,即簇是高密度区域中...
聚类验证是聚类分析中一个重要且必要的步骤。 这种基于GUI的可视化聚类验证工具CVAP为聚类解的有效性评估、聚类数的估计以及候选聚类算法之间的性能比较提供了重要的工具和便利的分析环境。 CVAP包括4个外部有效性...
在数学建模中,聚类分析是一种非常重要的数据挖掘技术,它主要用于无监督学习场景,通过对数据集中的对象进行分组,使得同一组内的对象相似度较高,而不同组之间的对象相似度较低。本资源“数学建模扩展:4几种常用...
ISODATA(Iterative Self-Organizing Data Analysis Technique,自组织数据分析迭代法)是一种动态的聚类算法,结合了k均值和聚类合并/分裂操作,具有自适应性和稳定性。其主要步骤如下: 1. 初始化:随机选择一...
MYDBSCAN:基于密度的聚类DBSCAN(Density-Based Spatial Clustering of Applications with Noise)算法的底层实现 MYAP:基于划分的聚类AP(Affinity Propagation Clustering Algorithm )算法的底层实现--近邻传播...
这个"clustering_code_中文聚类_"的项目显然关注的是如何利用编程实现中文文本的聚类算法,以便将相似的文本分组在一起。让我们深入探讨一下中文聚类的基本概念、常用方法以及可能涉及的技术。 中文聚类的主要目标...