Clustering text documents using k-means
源代码的链接为http://scikit-learn.org/stable/auto_examples/text/document_clustering.html
Loading 20 newsgroups dataset for categories:
['alt.atheism', 'talk.religion.misc', 'comp.graphics', 'sci.space']
3387 documents
4 categories Extracting features from the training dataset using a sparse vectorizer
done in 2.980000s
n_samples: 3387, n_features: 10000 Clustering sparse data with MiniBatchKMeans(batch_size=1000, compute_labels=True, init='k-means++',
init_size=1000, max_iter=100, max_no_improvement=10, n_clusters=4,
n_init=1, random_state=None, reassignment_ratio=0.01, tol=0.0,
verbose=False)
done in 0.514s Homogeneity: 0.506
Completeness: 0.576
V-measure: 0.539
Adjusted Rand-Index: 0.477
Silhouette Coefficient: 0.006 Top terms per cluster:
Cluster 0: hst nasa mission jpl ___ gov baalke access orbit __
Cluster 1: space henry nasa access toronto com alaska digex pat sky
Cluster 2: god com people sandvik keith don jesus article say think
Cluster 3: graphics com university thanks posting image host nntp computer ac
一、
TfidfVectorizer
HashingVectorizer
二、
Two algorithms are demoed: ordinary k-means and its more scalable cousin minibatch k-means
(To be continued)
Clustering text documents using k-means的更多相关文章
- 犀利的background-clip:text,实现K歌字幕效果
今天学到了一个新的CSS3属性,更准确的说是属性值,那就是background-clip:text.利用此属性值可以制作出很神奇的效果.可惜只有chrome支持,不过今天可以先来玩玩这个属性. 先来介 ...
- Classification of text documents: using a MLComp dataset
注:原文代码链接http://scikit-learn.org/stable/auto_examples/text/mlcomp_sparse_document_classification.html ...
- KNN 与 K - Means 算法比较
KNN K-Means 1.分类算法 聚类算法 2.监督学习 非监督学习 3.数据类型:喂给它的数据集是带label的数据,已经是完全正确的数据 喂给它的数据集是无label的数据,是杂乱无章的,经过 ...
- 软件——机器学习与Python,聚类,K——means
K-means是一种聚类算法: 这里运用k-means进行31个城市的分类 城市的数据保存在city.txt文件中,内容如下: BJ,2959.19,730.79,749.41,513.34,467. ...
- scikit-learn:4.2.3. Text feature extraction
http://scikit-learn.org/stable/modules/feature_extraction.html 4.2节内容太多,因此将文本特征提取单独作为一块. 1.the bag o ...
- sklearn文本特征提取
http://cloga.info/2014/01/19/sklearn_text_feature_extraction/ 文本特征提取 词袋(Bag of Words)表征 文本分析是机器学习算法的 ...
- Feature extraction - sklearn文本特征提取
http://blog.csdn.net/pipisorry/article/details/41957763 文本特征提取 词袋(Bag of Words)表征 文本分析是机器学习算法的主要应用领域 ...
- coursera课程Text Retrieval and Search Engines之Week 2 Overview
Week 2 OverviewHelp Center Week 2 On this page: Instructional Activities Time Goals and Objectives K ...
- 论文解读SDCN《Structural Deep Clustering Network》
前言 主体思想:深度聚类需要考虑数据内在信息以及结构信息. 考虑自身信息采用 基础的 Autoencoder ,考虑结构信息采用 GCN. 1.介绍 在现实中,将结构信息集成到深度聚类中通常需要解决以 ...
随机推荐
- JSP基础语法--跳转指令 jsp:forward page
带参数的跳转指令: <jsp:forward page="{路径|<%=表达式%>}"/> <jsp:param name="参数名称&qu ...
- 杂音 & pop 音的解决方法
杂音 & pop 音的解决方法 1. 喇叭有严重的"吱吱"破音,绝大多数的原因有可能在于V(out)电压不稳定,所以最好测一下无负载时的输出电压.同时也可以测量 VCC – ...
- iptables进行端口重定向
使用iptables进行端口重定向,方法如下: 在机器A上操作: #iptables -t nat -A PREROUTING -d 192.168.203.173 -p tcp -m tcp --d ...
- iOS8.0以后的相册
在 iOS 8.0 后, 使用the Photos framework 代替 the Assets Library framework , The Photos framework 提供更特色和更好的 ...
- Bitmap与Matrix旋转ImageView
Bitmap与Matrix旋转ImageView 标签: matrixfloatbutton测试importlayout 2010-08-23 22:18 8569人阅读 评论(0) 收藏 举报 分 ...
- 【Python初学】深copy&浅copy
在python中,对象赋值实际上是对象的引用.当创建一个对象,然后把它赋给另一个变量的时候,python并没有拷贝这个对象,而只是拷贝了这个对象的引用. 1. copy.copy 浅拷贝 只拷贝父对象 ...
- 代码创建xml文档并写入指定节点
//首先创建 XmlDocument xml文档 XmlDocument xml = new XmlDocument(); //创建根节点 config XmlElement config = xml ...
- 【转载】GDI 映像方式 之 SetViewportOrgEx 与 SetWindowOrgEx 解析
SetViewportOrgEx 与 SetWindowOrgEx 解析 这两个函数,用来改变视端口和窗口的原点,并都具有改变轴的效果,以致(0,0)不再指左上角. 「视端口」是依据设备坐标(图素)的 ...
- 转:Jmeter 用户思考时间(User think time),定时器,和代理服务器(proxy server)
在负载测试中需要考虑的的一个重要要素是思考时间(think time), 也就是在两次成功的访问请求之间的暂停时间. 有多种情形挥发导致延迟的发生: 用户需要时间阅读文字内容,或者填表,或者查找正确的 ...
- 逆序一个8bit的2进制数