コード例 #1
0
ファイル: kmeans.py プロジェクト: Calvin-he/docclustering
def out_result(predicted,k, real_labels):
    adjr = cmpcluster.cmp_doc_clusters(predicted,real_labels, 'rand')
    nmi = cmpcluster.cmp_doc_clusters(predicted,real_labels,'nmi')
    fm = cmpcluster.cmp_doc_clusters(predicted,real_labels,'f-measure')
    vm = cmpcluster.cmp_doc_clusters(predicted,real_labels, 'v-measure')
    s = '%d \t%.3f \t%.3f \t%.3f \t%.3f\r\n' % (k, adjr, nmi, fm, vm)
    return s
コード例 #2
0
def cmp_cluster(predicted, real_labels):
    ncluster = len(set(predicted))
    adjr = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'rand')
    nmi = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'nmi')
    fm = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'f-measure')
    vm = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'v-measure')
    return [ncluster, adjr, nmi, fm, vm]
コード例 #3
0
ファイル: fudan.py プロジェクト: Calvin-he/docclustering
def cmp_cluster(predicted, real_labels):
    ncluster = len(set(predicted))
    adjr = cmpcluster.cmp_doc_clusters(predicted,real_labels, 'rand')
    nmi = cmpcluster.cmp_doc_clusters(predicted,real_labels,'nmi')
    fm = cmpcluster.cmp_doc_clusters(predicted,real_labels,'f-measure')
    vm = cmpcluster.cmp_doc_clusters(predicted,real_labels, 'v-measure')
    return [ncluster, adjr,nmi,fm,vm]
コード例 #4
0
ファイル: kmeans.py プロジェクト: piaofu110/docclustering
def out_result(predicted, k, real_labels):
    adjr = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'rand')
    nmi = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'nmi')
    fm = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'f-measure')
    vm = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'v-measure')
    s = '%d \t%.3f \t%.3f \t%.3f \t%.3f\r\n' % (k, adjr, nmi, fm, vm)
    return s
コード例 #5
0
def cmp_cluster_result(predicted,ncluster,real_labels):
    adjr = cmpcluster.cmp_doc_clusters(predicted,real_labels, 'rand')
    nmi = cmpcluster.cmp_doc_clusters(predicted,real_labels,'nmi')
    fm = cmpcluster.cmp_doc_clusters(predicted,real_labels, 'f-measure')
    vm = cmpcluster.cmp_doc_clusters(predicted,real_labels, 'v-measure')
    prec = cmpcluster.cmp_doc_clusters(predicted,real_labels,'prec')
    call = cmpcluster.cmp_doc_clusters(predicted,real_labels,'call')
    #h**o = cmpcluster.cmp_doc_clusters(predicted, real_labels,'h**o')
    #compt = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'complete')
    s = '%d \t%.3f \t%.3f \t%.3f \t%.3f \t%.3f \t%.3f\n' % (ncluster, adjr, nmi, fm, vm, prec, call)
    return s
コード例 #6
0
def cmp_cluster_result(predicted, ncluster, real_labels):
    adjr = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'rand')
    nmi = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'nmi')
    fm = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'f-measure')
    vm = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'v-measure')
    prec = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'prec')
    call = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'call')
    #h**o = cmpcluster.cmp_doc_clusters(predicted, real_labels,'h**o')
    #compt = cmpcluster.cmp_doc_clusters(predicted, real_labels, 'complete')
    s = '%d \t%.3f \t%.3f \t%.3f \t%.3f \t%.3f \t%.3f\n' % (
        ncluster, adjr, nmi, fm, vm, prec, call)
    return s