网络的异质度有很多种评价方法。这里所说的异质度,指的是网络中节点的分布是否均匀。 The network heterogeneity has been defined in various ways in the literature [1] . If we carefully analyse the heterogeneity measures proposed in the literature, it becomes clear that two different aspects of a comp...
在计算均值时,numpy提供了两个现成的函数,np.mean() 和 np.average() 区别在于:np.mean() 只能计算算数平均值,而np.average() 通过添加 weights 参数可以计算加权平均值。 np.mean() 源码: @array_function_dispatch(_mean_dispatcher) def mean(a, axis=None, dtype=None, out=None, keepdims=np._NoValue): """ Compute the ar...
关于聚类系数的原汁原味的介绍,可以参考小世界网络这篇论文 [1]: The clustering coefficient C(p) is defined as follows. Suppose that a vertex v has kv neighbours; then at most kvkv 21=2 edges can exist between them (this occurs when every neighbourof v is connected to everyother neighbo...
传染病模型有四种状态:S(易感态)、I(感染态)、R(免疫态)、E(潜伏期)。 SI模型是最简单的传染病模型,仅仅包含易感态和感染态,真实场景中,例如人体感染某些疾病后会保留免疫能力,因此需要增加第三种疾病状态,也就是恢复态,一般用R表示,因此有了SIR模型。 SIR模型 [1],也就是 易感-感染-恢复模型 (susceptible-infected-recovered model). 对于有些疾病,人们感染后无法恢复健康,而是死亡,但是对于疾病传播而言,无论恢复健康和还是死亡,最终病毒都被移除了...
np.sign()是一个符号函数,用于把函数的符号析离出来,定义如下: python示例代码: #%% import numpy as np data = 1 print(data,'=>', np.sign(data)) data = 0 print(data,'=>', np.sign(data)) data = -1 print(data,'=>', np.sign(data)) data = [-100, -0.1, 0, 0.00001, 4, 0.0] print(data,'=>', np....