runtime comparison

本文通过实际与合成数据集对比分析了谱聚类算法(PIC)与其他算法如NCut和ENCut的运行效率,展示了不同规模数据集上各算法的执行时间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

"""
Table 3. Runtime comparison (in milliseconds) of PIC and spectral
clustering algorithms on several real datasets.

Dataset         Size    NCutE   NCutI   PIC
Iris            150     17      61      1
PenDigits01     200     28      23      1
PenDigits17     200     30      36      1
PolBooks        102     7       22      1
UBMCBlog        404     104     32      1
AGBlog          1222    1095    70      3
20ngA           200     32      37      1
20ngB           400     124     56      3
20ngC           600     348     213     5
20ngD           800     584     385     10



Table 4. Runtime comparison (in milliseconds) of PIC and spectral
clustering algorithms on synthetic datasets.

Nodes   Edges       NCutE       NCutI   PIC
1k      10k         1885        177     1
5k      250k        154797      6939    7
10k     1000k       1111441     42045   34
50k     25000k      -           -       849
100k    100000k     -           -       2960
"""
import matplotlib.pyplot as plt
import numpy as np

plt.style.use('ggplot')
data = np.array([[17, 61, 1],
                 [28, 23, 1],
                 [30, 36, 1],
                 [7, 22, 1],
                 [104, 32, 1],
                 [1095, 70, 3],
                 [32, 37, 1],
                 [124, 56, 3],
                 [348, 213, 5],
                 [584, 385, 10]])
n_rows, n_cols = data.shape
width = 0.5
index = np.arange(n_rows) * (n_cols + 1) * width
bars = []
for i in range(n_cols):
    bars.append(plt.bar(index + i * width, data[:, i], width))
for bar in bars:
    for item in bar:
        y = item.get_height()
        plt.text(item.get_x() + 0.5 * width, y + 1, int(y), ha='center', va='bottom', size=6)
ticks = ["Iris", "PenDigits01", "PenDigits17", "PolBooks", "UBMCBlog", "AGBlog", "20ngA", "20ngB", "20ngC", "20ngD"]
plt.xticks(index + 0.5 * n_cols * width, ticks, rotation=90)
plt.tight_layout()
plt.show()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值