Example #1
0
print "storing..."
t.reset()
t.tic()
mat.store(coassc_path_spin, indptr_expanded=True, store_degree=False)
print "store time: {}".format(t.tac())

print 'copying file to ssd...'
t.reset()
t.tic()
shutil.copyfile(coassc_path_spin, coassc_path_ssd)
print "copy time: {}".format(t.tac())

print 'SSD clustering...'
t.reset()
t.tic()
nclusts_ssd, labels_ssd = myEAC.sp_sl_lifetime_disk(coassc_path_ssd,
                                                    n_partitions,
                                                    n_clusters=0,
                                                    index_dir=index_path_ssd)
ssd_time = t.tac()
print "ssd time: {}".format(ssd_time)

print 'Spin clustering...'
t.reset()
t.tic()
nclusts_spin, labels_spin = myEAC.sp_sl_lifetime_disk(
    coassc_path_spin, n_partitions, n_clusters=0, index_dir=index_path_spin)
spin_time = t.tac()
print "spin time: {}".format(spin_time)
print "storing..."
t.reset()
t.tic()
mat.store(coassc_path_spin, indptr_expanded=True, store_degree=False)
print "store time: {}".format(t.tac())

print "copying file to ssd..."
t.reset()
t.tic()
shutil.copyfile(coassc_path_spin, coassc_path_ssd)
print "copy time: {}".format(t.tac())


print "SSD clustering..."
t.reset()
t.tic()
nclusts_ssd, labels_ssd = myEAC.sp_sl_lifetime_disk(
    coassc_path_ssd, n_partitions, n_clusters=0, index_dir=index_path_ssd
)
ssd_time = t.tac()
print "ssd time: {}".format(ssd_time)

print "Spin clustering..."
t.reset()
t.tic()
nclusts_spin, labels_spin = myEAC.sp_sl_lifetime_disk(
    coassc_path_spin, n_partitions, n_clusters=0, index_dir=index_path_spin
)
spin_time = t.tac()
print "spin time: {}".format(spin_time)
Example #3
0
# t.tic()
# eacEst3.buildMatrix(ensemble)
# t.tac()
# print str_desc + " build time:", t.elapsed

# print str_desc + " SL..."
# t.reset()
# t.tic()
# labels_scc_disk = eacEst3.finalClustering(n_clusters=0)
# t.tac()
# print str_desc + " SL time: {}".format(t.elapsed)

t.reset()
t.tic()
nclusts, labels_scc_disk = myEAC.sp_sl_lifetime_disk(coassoc_store_path,
                                                     n_partitions,
                                                     n_clusters=8,
                                                     index_dir=diskdir)
t.tac()
print str_desc + " SL time: {}".format(t.elapsed)

labels_filename = name + "labels_{}_{}_{}.npy".format(n, rule.__doc__,
                                                      "scc_disk")
np.save(os.path.join(folder, labels_filename), labels_scc_disk)

t.reset()
t.tic()
print str_desc + " scoring (consistency)..."
accEst3_1 = myAcc.ConsistencyIndex(n)
accEst3_1.score(gt_sampled, labels_scc_disk)

print str_desc + " scoring (Hungarian)..."
# t.tic()
# eacEst3.buildMatrix(ensemble)
# t.tac()
# print str_desc + " build time:", t.elapsed

# print str_desc + " SL..."
# t.reset()
# t.tic()
# labels_scc_disk = eacEst3.finalClustering(n_clusters=0)
# t.tac()
# print str_desc + " SL time: {}".format(t.elapsed)

t.reset()
t.tic()
nclusts, labels_scc_disk = myEAC.sp_sl_lifetime_disk(coassoc_store_path,
                                                     n_partitions,
                                                     n_clusters=8,
                                                     index_dir=diskdir)
t.tac()
print str_desc + " SL time: {}".format(t.elapsed)

labels_filename = name + "labels_{}_{}_{}.npy".format(n, rule.__doc__,
                                                      "scc_disk")
np.save(os.path.join(folder,labels_filename), labels_scc_disk)

t.reset()
t.tic()
print str_desc + " scoring (consistency)..."
accEst3_1 = myAcc.ConsistencyIndex(n)
accEst3_1.score(gt_sampled, labels_scc_disk)

print str_desc + " scoring (Hungarian)..."
Example #5
0
                    logger.info(
                        "Accuracy time (Hungarian) (normal): {}".format(
                            t.elapsed))

                    results.t_accuracy_H[res_idx] = t.elapsed  # accuracy time
                    results.accuracy_H[res_idx] = accEstH.accuracy

                # disk clustering
                if tm >= 2:
                    logger.info("SL clustering (disk)...")

                    t.reset()
                    t.tic()
                    n_c, labels = myEAC.sp_sl_lifetime_disk(
                        eacEst.coassoc_store_path,
                        n_partitions,
                        n_clusters=0,
                        index_dir=eacEst.disk_dir)
                    t.tac()
                    logger.info("Clustering time (disk): {}".format(t.elapsed))

                    results.t_sl_disk[res_idx] = t.elapsed  # build time
                    results.sl_clusts_disk[res_idx] = n_c

                    t.reset()
                    t.tic()
                    logger.info("Scoring accuracy (consistency) (disk)...")
                    accEstCI = myAcc.ConsistencyIndex(n)
                    accEstCI.score(gt_sampled, labels)
                    t.tac()