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
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]
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]
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
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
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