【问题标题】:Cluster string based on DBSCAN基于 DBSCAN 的集群字符串
【发布时间】:2020-03-04 16:13:08
【问题描述】:

总结: 在基于列'contents'对多列csv文件进行聚类时寻找python代码的DBSCAN实现

Input:

    input csv file rows sample

    Rank, Domain, Contents      

    1, abc.com, hello random text out
    2, xyz.com, hello random somethingelse
    3, not.com, a b c d
    4, plus.com, a b asdsadsa asdsadasdsadsa
    5, minus.com, man win 

   Where,

   Column 1 => Rank = digit
   Column 2 => Domain = domain name ex. abc.com
   Column 3 => Contents = list of words (string, this is 
extracted clean up words from html page)

Output :
    The output of the cluster be based on similar list of contents

    Cluster 1: abc.com, xyz.com
    Cluster 2: not.com, plus.com
    Cluster 3: minus.com
    ....

    Please note: In output, I am not looking for words that are in same cluster. Instead, I am looking for a 'domain name', column which is clustered based on similar contents of column 3, 'contents' 

我研究了以下资源,但它们基于 kmeans,与我正在寻找的 DBSCAN 集群输出无关。请注意,在这种情况下,提供集群编号将不适用,因为我们不想根据输入来限制集群编号。

1) How can I cluster text data with multiple columns?

2) Clustering text documents using scikit-learn kmeans in Python

3)http://brandonrose.org/clustering

4) https://datasciencelab.wordpress.com/2013/12/12/clustering-with-k-means-in-python/

5)https://towardsdatascience.com/applying-machine-learning-to-classify-an-unsupervised-text-document-e7bb6265f52

所以,

input <= csv file with 'Rank', 'Domain', 'Contents'
output <= cluster with domain name [NOT contents]

A python implementation in DBSCAN clustering would be an ideal.

谢谢!

【问题讨论】:

    标签: python machine-learning scikit-learn cluster-analysis dbscan


    【解决方案1】:

    您首先需要选择数据集的“内容”列。您可以使用 Python 的 csv 模块来完成该步骤。

    然后您必须将文本转换为可以训练 DBSCAN 的向量。您提供的第二个链接包含执行该步骤所需的一切。

    然后你必须在向量上训练 DBSCAN。例如,您可以使用DBSCAN in scikit-learn 的实现。

    一旦有了与向量关联的标签(即 csv 文件的行),您就可以按集群对行数进行分组并检索域。

    【讨论】:

    • 谢谢斯坦尼斯拉斯!
    猜你喜欢
    • 2021-04-08
    • 2018-09-01
    • 2018-11-22
    • 2015-08-15
    • 2021-07-07
    • 2017-05-20
    • 2013-01-15
    • 2016-02-28
    • 2015-07-21
    相关资源
    最近更新 更多