因此,我有一些字符串数据,对其进行一些操作,然后使用HDBSCAN创建集群:
textData = train['eudexHash'].apply(lambda x: str(x))
clusterer = hdbscan.HDBSCAN(min_cluster_size=5,
gen_min_span_tree=True,
prediction_data=True).fit(textData.values.reshape(-1,1))现在,当我调用集群来使用approximate_predict进行预测时,我得到了以下结果:
>>>> hdbscan.approximate_predict(clusterer, testCase)
(array([113]), array([1.]))甜的,看起来像是在预测新的情况,所以它认为新的字符串值对应于标签113。现在,如何找到标签/桶/集群中的其他成员?
干杯!
发布于 2019-11-19 16:28:11
如果您想找出您的培训数据中哪些是标签113的一部分,那么您可以这样做。
textdata_with_label_113 = textData[clusterer.labels_ == 113]https://stackoverflow.com/questions/58938577
复制相似问题