社区算法¶
- class graphdatascience.procedure_surface.api.community.CliqueCountingEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], concurrency: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult¶
估算运行团计数算法的内存需求。
- abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) CliqueCountingMutateResult¶
执行团计数算法,并将结果作为节点属性写入内存中的图。
- 参数:
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) CliqueCountingStatsResult¶
执行团计数算法并返回统计信息。
- abstract stream(G: GraphV2, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool | None = False, username: str | None = None) DataFrame¶
执行团计数算法并返回结果流。
- abstract write(G: GraphV2, write_property: str, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) CliqueCountingWriteResult¶
执行团计数算法并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
CliqueCountingWriteResult – 算法指标和统计信息
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.community.CliqueCountingMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.community.CliqueCountingStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.community.CliqueCountingWriteResult¶
- class graphdatascience.procedure_surface.api.community.ConductanceEndpoints¶
- abstract stream(G: GraphV2, community_property: str, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, sudo: bool = False, username: str | None = None) DataFrame¶
执行导度(Conductance)算法并返回结果流。
- 参数:
G (GraphV2) – 要使用的图对象
community_property (str) – 包含社区分配的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含算法结果的 DataFrame,其中含有“community”和“conductance”列
- 返回类型:
DataFrame
- class graphdatascience.procedure_surface.api.community.HdbscanEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], node_property: str, *, leaf_size: int = 1, samples: int = 10, min_cluster_size: int = 5, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None) EstimationResult¶
估算 HDBSCAN 算法的内存需求及其他统计信息。
此方法提供 HDBSCAN 算法的内存估算,而无需实际执行聚类。它有助于在运行实际聚类程序之前确定计算需求。
- 参数:
node_property (str) – 用于聚类的节点属性(必需)
leaf_size (int | None, default=None) – 算法中使用的树结构的最大叶子节点大小
samples (int | None, default=None) – 用于密度估算的样本数量
min_cluster_size (int | None, default=None) – 聚类的最小尺寸
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
concurrency (int | None) – 要使用的并发线程数。
log_progress – 显示进度日志。
sudo – 禁用内存保护。
job_id – 计算任务的标识符。
username – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含内存需求及其他统计信息的估算结果
- 返回类型:
- abstract mutate(G: GraphV2, node_property: str, mutate_property: str, *, leaf_size: int = 1, samples: int = 10, min_cluster_size: int = 5, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, job_id: str | None = None, username: str | None = None) HdbscanMutateResult¶
运行 HDBSCAN 算法,并将每个节点的聚类 ID 写回内存中的图。
该算法对节点属性执行层次化密度聚类,根据密度可达性识别聚类。
- 参数:
G (GraphV2) – 要使用的图对象
node_property (str) – 用于聚类的节点属性(必需)
mutate_property (str) – 用于存储结果的节点属性名称。
leaf_size (int | None, default=None) – 算法中使用的树结构的最大叶子节点大小
samples (int | None, default=None) – 用于密度估算的样本数量
min_cluster_size (int | None, default=None) – 聚类的最小尺寸
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
concurrency (int | None) – 要使用的并发线程数。
log_progress (bool) – 显示进度日志。
sudo (bool) – 禁用内存保护。
job_id (str | None) – 计算任务的标识符。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含有关聚类和算法执行的统计信息的结果
- 返回类型:
- abstract stats(G: GraphV2, node_property: str, *, leaf_size: int = 1, samples: int = 10, min_cluster_size: int = 5, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, job_id: str | None = None, username: str | None = None) HdbscanStatsResult¶
运行 HDBSCAN 算法并仅返回有关聚类的统计信息。
此模式计算聚类分配而不将其写回图中,仅返回执行统计信息和聚类信息。
- 参数:
G (GraphV2) – 要使用的图对象
node_property (str) – 用于聚类的节点属性(必需)
leaf_size (int | None, default=None) – 算法中使用的树结构的最大叶子节点大小
samples (int | None, default=None) – 用于密度估算的样本数量
min_cluster_size (int | None, default=None) – 聚类的最小尺寸
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
concurrency (int | None) – 要使用的并发线程数。
log_progress (bool) – 显示进度日志。
sudo (bool) – 禁用内存保护。
job_id (str | None) – 计算任务的标识符。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含有关聚类和算法执行的统计信息的结果
- 返回类型:
- abstract stream(G: GraphV2, node_property: str, *, leaf_size: int = 1, samples: int = 10, min_cluster_size: int = 5, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, job_id: str | None = None, username: str | None = None) DataFrame¶
运行 HDBSCAN 算法并将每个节点的聚类 ID 作为 DataFrame 返回。
DataFrame 包含每个节点的聚类分配,噪声点通常被分配到聚类 -1。
- 参数:
G (GraphV2) – 要使用的图对象
node_property (str) – 用于聚类的节点属性(必需)
leaf_size (int | None, default=None) – 算法中使用的树结构的最大叶子节点大小
samples (int | None, default=None) – 用于密度估算的样本数量
min_cluster_size (int | None, default=None) – 聚类的最小尺寸
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
concurrency (int | None) – 要使用的并发线程数。
log_progress (bool) – 显示进度日志。
sudo (bool) – 禁用内存保护。
job_id (str | None) – 计算任务的标识符。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含‘nodeId’和‘label’列的 DataFrame
- 返回类型:
pd.DataFrame
- abstract write(G: GraphV2, node_property: str, write_property: str, *, leaf_size: int = 1, samples: int = 10, min_cluster_size: int = 5, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, job_id: str | None = None, username: str | None = None, write_concurrency: int | None = None) HdbscanWriteResult¶
运行 HDBSCAN 算法并将每个节点的聚类 ID 写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
node_property (str) – 用于聚类的节点属性(必需)
write_property (str) – 用于存储结果的节点属性名称。
leaf_size (int | None, default=None) – 算法中使用的树结构的最大叶子节点大小
samples (int | None, default=None) – 用于密度估算的样本数量
min_cluster_size (int | None, default=None) – 聚类的最小尺寸
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
write_concurrency (int | None) – 用于写入的并发线程数。
concurrency (int | None) – 要使用的并发线程数。
log_progress (bool) – 显示进度日志。
sudo (bool) – 禁用内存保护。
job_id (str | None) – 计算任务的标识符。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含有关聚类和算法执行的统计信息的结果
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.community.HdbscanMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.community.HdbscanStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.community.HdbscanWriteResult¶
- class graphdatascience.procedure_surface.api.community.K1ColoringEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], *, batch_size: int = 10000, concurrency: int | None = None, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult¶
预估算法运行的内存消耗。
- 参数:
- 返回:
内存预估详情
- 返回类型:
- abstract mutate(G: GraphV2, mutate_property: str, *, batch_size: int = 10000, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) K1ColoringMutateResult¶
运行 K-1 着色算法并将结果作为新的节点属性存储在图目录中。
K-1 着色算法为图中的每个节点分配一个颜色,旨在优化两个目标:确保给定节点的每个邻居的颜色与该节点自身不同,并尽可能使用最少的颜色。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
batch_size (int) – 每个批次处理的节点数量。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None, default=None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int, default=10) – 运行的最大迭代次数。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, *, batch_size: int = 10000, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) K1ColoringStatsResult¶
执行 K-1 着色算法并返回统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
batch_size (int) – 每个批次处理的节点数量。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stream(G: GraphV2, *, batch_size: int = 10000, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) DataFrame¶
执行 K-1 着色算法并返回结果流。
- 参数:
G (GraphV2) – 要使用的图对象
batch_size (int) – 每个批次处理的节点数量。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
min_community_size (int | None) – 结果中包含的社区的最小大小。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含算法结果的 DataFrame
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, *, batch_size: int = 10000, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) K1ColoringWriteResult¶
执行 K-1 着色算法并将结果写入 Neo4j 数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
batch_size (int) – 每个批次处理的节点数量。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
min_community_size (int | None) – 结果中包含的社区的最小大小。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
K1ColoringWriteResult – 算法指标和统计信息
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.community.K1ColoringMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.community.K1ColoringStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.community.K1ColoringWriteResult¶
- class graphdatascience.procedure_surface.api.community.KCoreEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult¶
预估算法运行的内存消耗。
- abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) KCoreMutateResult¶
运行 K-Core 分解算法并将结果作为新的节点属性存储在图目录中。
K-core 分解是一个根据图中节点的度序列和拓扑结构将图中的节点分离成组的过程。术语 i-core 指的是原始图的一个最大子图,使得该子图中的每个节点的度至少为 i。每个节点都关联一个核心值,该值表示节点所属 i-core 的最大值 i。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None, default=None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) KCoreStatsResult¶
执行 K-Core 算法并返回统计信息。
- abstract stream(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) DataFrame¶
执行 K-Core 算法并返回结果流。
- 参数:
- 返回:
包含算法结果(包含 nodeId 和 coreValue)的 DataFrame
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, *, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, write_concurrency: int | None = None) KCoreWriteResult¶
执行 K-Core 算法并将结果写入 Neo4j 数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
KCoreWriteResult – 算法指标和统计信息
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.community.KCoreMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.KCoreStatsResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.KCoreWriteResult¶
- 类 graphdatascience.procedure_surface.api.community.KMeansEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], node_property: str, *, compute_silhouette: bool = False, concurrency: int | None = None, delta_threshold: float = 0.05, initial_sampler: str = 'UNIFORM', k: int = 10, max_iterations: int = 10, node_labels: list[str] = ['*'], number_of_restarts: int = 1, random_seed: int | None = None, relationship_types: list[str] = ['*'], seed_centroids: list[list[float]] | None = None) EstimationResult¶
评估运行 K-Means 算法的内存需求。
- 参数:
node_property (str) – 用于聚类的节点属性
compute_silhouette (bool | None, 默认=False) – 是否计算轮廓系数
concurrency (int | None) – 要使用的并发线程数。
delta_threshold (float) – 迭代之间的最小变化阈值。
initial_sampler (str) – 初始质心的采样方法。
k (int) – 要形成的聚类数量。
max_iterations (int) – 运行的最大迭代次数。
number_of_restarts (int | None, 默认=1) – 算法使用不同初始中心进行重启的次数
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
- 返回:
内存估算结果
- 返回类型:
- abstract mutate(G: GraphV2, node_property: str, mutate_property: str, *, compute_silhouette: bool = False, concurrency: int | None = None, delta_threshold: float = 0.05, initial_sampler: str = 'UNIFORM', job_id: str | None = None, k: int = 10, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], number_of_restarts: int = 1, random_seed: int | None = None, relationship_types: list[str] = ['*'], seed_centroids: list[list[float]] | None = None, sudo: bool = False, username: str | None = None) KMeansMutateResult¶
执行 K-Means 算法并将结果作为节点属性写入内存中图。
- 参数:
G (GraphV2) – 要使用的图对象
node_property (str) – 用于聚类的节点属性
mutate_property (str) – 用于存储结果的节点属性名称。
compute_silhouette (bool | None, 默认=False) – 是否计算轮廓系数
concurrency (int | None) – 要使用的并发线程数。
delta_threshold (float) – 迭代之间的最小变化阈值。
initial_sampler (str) – 初始质心的采样方法。
job_id (str | None) – 计算任务的标识符。
k (int) – 要形成的聚类数量。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
number_of_restarts (int | None, 默认=1) – 算法使用不同初始中心进行重启的次数
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, node_property: str, *, compute_silhouette: bool = False, concurrency: int | None = None, delta_threshold: float = 0.05, initial_sampler: str = 'UNIFORM', job_id: str | None = None, k: int = 10, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], number_of_restarts: int = 1, random_seed: int | None = None, relationship_types: list[str] = ['*'], seed_centroids: list[list[float]] | None = None, sudo: bool = False, username: str | None = None) KMeansStatsResult¶
执行 K-Means 算法并返回统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
node_property (str) – 用于聚类的节点属性
compute_silhouette (bool | None, 默认=False) – 是否计算轮廓系数
concurrency (int | None) – 要使用的并发线程数。
delta_threshold (float) – 迭代之间的最小变化阈值。
initial_sampler (str) – 初始质心的采样方法。
job_id (str | None) – 计算任务的标识符。
k (int) – 要形成的聚类数量。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
number_of_restarts (int | None, 默认=1) – 算法使用不同初始中心进行重启的次数
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stream(G: GraphV2, node_property: str, *, compute_silhouette: bool = False, concurrency: int | None = None, delta_threshold: float = 0.05, initial_sampler: str = 'UNIFORM', job_id: str | None = None, k: int = 10, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], number_of_restarts: int = 1, random_seed: int | None = None, relationship_types: list[str] = ['*'], seed_centroids: list[list[float]] | None = None, sudo: bool = False, username: str | None = None) DataFrame¶
执行 K-Means 算法并返回结果流。
- 参数:
G (GraphV2) – 要使用的图对象
node_property (str) – 用于聚类的节点属性
compute_silhouette (bool | None, 默认=False) – 是否计算轮廓系数
concurrency (int | None) – 要使用的并发线程数。
delta_threshold (float) – 迭代之间的最小变化阈值。
initial_sampler (str) – 初始质心的采样方法。
job_id (str | None) – 计算任务的标识符。
k (int) – 要形成的聚类数量。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
number_of_restarts (int | None, 默认=1) – 算法使用不同初始中心进行重启的次数
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含 nodeId、communityId、distanceFromCentroid 和 silhouette 算法结果的 DataFrame
- 返回类型:
DataFrame
- abstract write(G: GraphV2, node_property: str, write_property: str, *, compute_silhouette: bool = False, concurrency: int | None = None, delta_threshold: float = 0.05, initial_sampler: str = 'UNIFORM', job_id: str | None = None, k: int = 10, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], number_of_restarts: int = 1, random_seed: int | None = None, relationship_types: list[str] = ['*'], seed_centroids: list[list[float]] | None = None, sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) KMeansWriteResult¶
执行 K-Means 算法并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
node_property (str) – 用于聚类的节点属性
write_property (str) – 用于存储结果的节点属性名称。
compute_silhouette (bool | None, 默认=False) – 是否计算轮廓系数
concurrency (int | None) – 要使用的并发线程数。
delta_threshold (float) – 迭代之间的最小变化阈值。
initial_sampler (str) – 初始质心的采样方法。
job_id (str | None) – 计算任务的标识符。
k (int) – 要形成的聚类数量。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
number_of_restarts (int | None, 默认=1) – 算法使用不同初始中心进行重启的次数
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
KMeansWriteResult – 算法指标和统计信息
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.community.KMeansMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.KMeansStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.community.KMeansWriteResult¶
- class graphdatascience.procedure_surface.api.community.LabelPropagationEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, consecutive_ids: bool = False, max_iterations: int = 10, node_labels: list[str] = ['*'], node_weight_property: str | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None) EstimationResult¶
估算运行标签传播(Label Propagation)算法所需的内存。
- 参数:
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
max_iterations (int) – 运行的最大迭代次数。
node_weight_property (str | None, default=None) – 节点权重的属性名称
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
- 返回:
内存估算结果
- 返回类型:
- abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], node_weight_property: str | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, username: str | None = None) LabelPropagationMutateResult¶
执行标签传播算法,并将结果作为节点属性写入内存图。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
node_weight_property (str | None, default=None) – 节点权重的属性名称
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], node_weight_property: str | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, username: str | None = None) LabelPropagationStatsResult¶
执行标签传播算法并返回统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
node_weight_property (str | None, default=None) – 节点权重的属性名称
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stream(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], node_weight_property: str | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, username: str | None = None) DataFrame¶
执行标签传播算法并以数据流形式返回结果。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
min_community_size (int | None) – 结果中包含的社区的最小大小。
node_weight_property (str | None, default=None) – 节点权重的属性名称
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含 nodeID 和 communityID 算法结果的 DataFrame
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], node_weight_property: str | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) LabelPropagationWriteResult¶
执行标签传播算法并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
min_community_size (int | None) – 结果中包含的社区的最小大小。
node_weight_property (str | None, default=None) – 节点权重的属性名称
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
LabelPropagationWriteResult – 算法指标和统计信息
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.community.LabelPropagationMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.community.LabelPropagationStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.community.LabelPropagationWriteResult¶
- class graphdatascience.procedure_surface.api.community.LeidenEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, consecutive_ids: bool = False, gamma: float = 1.0, include_intermediate_communities: bool = False, max_levels: int = 10, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, theta: float = 0.01, tolerance: float = 0.0001) EstimationResult¶
估算运行 Leiden 算法所需的内存。
- 参数:
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
gamma (float, default=1.0) – Leiden 算法的 gamma 参数
include_intermediate_communities (bool, default=False) – 是否包含中间社区
max_levels (int, default=10) – 最大层数
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
theta (float, default=0.01) – Leiden 算法的 theta 参数
tolerance (float) – 迭代间得分的最小变化量。
- 返回:
内存估算结果
- 返回类型:
- abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, gamma: float = 1.0, include_intermediate_communities: bool = False, job_id: str | None = None, log_progress: bool = True, max_levels: int = 10, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, theta: float = 0.01, tolerance: float = 0.0001, username: str | None = None) LeidenMutateResult¶
执行 Leiden 社区发现算法,并将结果作为节点属性写入内存中图。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
gamma (float, default=1.0) – Leiden 算法的 gamma 参数
include_intermediate_communities (bool, default=False) – 是否包含中间社区
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_levels (int, default=10) – 最大层数
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
theta (float, default=0.01) – Leiden 算法的 theta 参数
tolerance (float) – 迭代间得分的最小变化量。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, gamma: float = 1.0, include_intermediate_communities: bool = False, job_id: str | None = None, log_progress: bool = True, max_levels: int = 10, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, theta: float = 0.01, tolerance: float = 0.0001, username: str | None = None) LeidenStatsResult¶
执行 Leiden 社区发现算法并返回统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
gamma (float, default=1.0) – Leiden 算法的 gamma 参数
include_intermediate_communities (bool, default=False) – 是否包含中间社区
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_levels (int, default=10) – 最大层数
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
theta (float, default=0.01) – Leiden 算法的 theta 参数
tolerance (float) – 迭代间得分的最小变化量。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stream(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, gamma: float = 1.0, include_intermediate_communities: bool = False, job_id: str | None = None, log_progress: bool = True, max_levels: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, theta: float = 0.01, tolerance: float = 0.0001, username: str | None = None) DataFrame¶
执行 Leiden 社区发现算法并返回结果流。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
gamma (float, default=1.0) – Leiden 算法的 gamma 参数
include_intermediate_communities (bool, default=False) – 是否包含中间社区
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_levels (int, default=10) – 最大层数
min_community_size (int | None) – 结果中包含的社区的最小大小。
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
theta (float, default=0.01) – Leiden 算法的 theta 参数
tolerance (float) – 迭代间得分的最小变化量。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含以下列的 DataFrame:nodeId, communityId, intermediateCommunityIds
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, gamma: float = 1.0, include_intermediate_communities: bool = False, job_id: str | None = None, log_progress: bool = True, max_levels: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, theta: float = 0.01, tolerance: float = 0.0001, username: str | None = None, write_concurrency: int | None = None) LeidenWriteResult¶
执行 Leiden 社区发现算法并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
gamma (float, default=1.0) – Leiden 算法的 gamma 参数
include_intermediate_communities (bool, default=False) – 是否包含中间社区
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_levels (int, default=10) – 最大层数
min_community_size (int | None) – 结果中包含的社区的最小大小。
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
theta (float, default=0.01) – Leiden 算法的 theta 参数
tolerance (float) – 迭代间得分的最小变化量。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
LeidenWriteResult – 算法指标和统计信息
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.community.LeidenMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.community.LeidenStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.community.LeidenWriteResult¶
- class graphdatascience.procedure_surface.api.community.LocalClusteringCoefficientEndpoints¶
LocalClusteringCoefficient 算法端点的接口。
- abstract estimate(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool | None = False, triangle_count_property: str | None = None, username: str | None = None) EstimationResult¶
估算 LocalClusteringCoefficient 算法的内存需求。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool | None) – 禁用内存保护。
triangle_count_property (str | None, 默认=None) – 预计算三角形计数的属性名称
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
内存预估详情
- 返回类型:
- abstract mutate(G: GraphV2, *, mutate_property: str, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, triangle_count_property: str | None = None, username: str | None = None) LocalClusteringCoefficientMutateResult¶
执行 LocalClusteringCoefficient 算法并将结果写回图中。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
triangle_count_property (str | None, 默认=None) – 预计算三角形计数的属性名称
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含聚类系数统计信息和计时信息的结果
- 返回类型:
- abstract stats(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, triangle_count_property: str | None = None, username: str | None = None) LocalClusteringCoefficientStatsResult¶
执行局部聚类系数算法并返回统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
triangle_count_property (str | None, 默认=None) – 预计算三角形计数的属性名称
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含聚类系数统计信息和计时信息的结果
- 返回类型:
- abstract stream(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, triangle_count_property: str | None = None, username: str | None = None) DataFrame¶
执行局部聚类系数算法并以流形式返回结果。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
triangle_count_property (str | None, 默认=None) – 预计算三角形计数的属性名称
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含 nodeId 和 localClusteringCoefficient 列的 DataFrame
- 返回类型:
- abstract write(G: GraphV2, *, write_property: str, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, triangle_count_property: str | None = None, username: str | None = None, write_concurrency: int | None = None) LocalClusteringCoefficientWriteResult¶
执行局部聚类系数算法并将结果写入数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
triangle_count_property (str | None, 默认=None) – 预计算三角形计数的属性名称
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
LocalClusteringCoefficientWriteResult – 包含聚类系数统计信息和计时结果的结果
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.community.LocalClusteringCoefficientMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.LocalClusteringCoefficientStatsResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.LocalClusteringCoefficientWriteResult¶
- class graphdatascience.procedure_surface.api.community.LouvainEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], tolerance: float = 0.0001, max_levels: int = 10, include_intermediate_communities: bool = False, max_iterations: int = 10, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) EstimationResult¶
预估算法运行的内存消耗。
- 参数:
tolerance (float) – 迭代间得分的最小变化量。
max_levels (int, 默认=10) – 分层结构中的最大层级数
include_intermediate_communities (bool, 默认=False) – 是否包含中间社群分配
max_iterations (int) – 每个层级运行的最大迭代次数。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
concurrency (int | None) – 要使用的并发线程数。
seed_property (str | None) – 用于节点初始值的属性名称。
consecutive_ids (bool) – 为组件使用连续的 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
- 返回:
包含估计结果的对象
- 返回类型:
- abstract mutate(G: GraphV2, mutate_property: str, tolerance: float = 0.0001, max_levels: int = 10, include_intermediate_communities: bool = False, max_iterations: int = 10, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) LouvainMutateResult¶
运行 Louvain 算法并将结果以新的节点属性形式存储在图目录中。
Louvain 方法是一种用于检测大型网络中社群的算法。它为每个社群最大化一个模块度(modularity)分数。模块度通过评估节点在社群内的连接密度与随机网络中预期连接密度的对比,从而量化社群划分的质量。Louvain 算法是一种分层聚类算法,它递归地将社群合并为单个节点,并在压缩后的图上运行模块度聚类。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
tolerance (float) – 迭代间得分的最小变化量。
max_levels (int, 默认=10) – 分层结构中的最大层级数
include_intermediate_communities (bool, default=False) – 是否包含中间社区
max_iterations (int) – 每个层级运行的最大迭代次数。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None, default=None) – 计算任务的标识符。
seed_property (str | None) – 用于节点初始值的属性名称。
consecutive_ids (bool) – 为组件使用连续的 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, tolerance: float = 0.0001, max_levels: int = 10, include_intermediate_communities: bool = False, max_iterations: int = 10, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) LouvainStatsResult¶
执行 Louvain 算法并返回统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
tolerance (float) – 迭代间得分的最小变化量。
max_levels (int, 默认=10) – 分层结构中的最大层级数
include_intermediate_communities (bool, 默认=False) – 是否包含中间社群分配
max_iterations (int) – 每个层级运行的最大迭代次数。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
seed_property (str | None) – 用于节点初始值的属性名称。
consecutive_ids (bool) – 为组件使用连续的 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stream(G: GraphV2, tolerance: float = 0.0001, max_levels: int = 10, include_intermediate_communities: bool = False, max_iterations: int = 10, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None, min_community_size: int | None = None) DataFrame¶
执行 Louvain 算法并返回结果流。
- 参数:
G (GraphV2) – 要使用的图对象
tolerance (float) – 迭代间得分的最小变化量。
max_levels (int, 默认=10) – 分层结构中的最大层级数
include_intermediate_communities (bool, 默认=False) – 是否包含中间社群分配
max_iterations (int) – 每个层级运行的最大迭代次数。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
seed_property (str | None) – 用于节点初始值的属性名称。
consecutive_ids (bool) – 为组件使用连续的 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
min_community_size (int | None) – 结果中包含的社区的最小大小。
- 返回:
包含算法结果的 DataFrame
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, tolerance: float = 0.0001, max_levels: int = 10, include_intermediate_communities: bool = False, max_iterations: int = 10, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None, write_concurrency: int | None = None, min_community_size: int | None = None) LouvainWriteResult¶
执行 Louvain 算法并将结果写入 Neo4j 数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
tolerance (float) – 迭代间得分的最小变化量。
max_levels (int, 默认=10) – 分层结构中的最大层级数
include_intermediate_communities (bool, 默认=False) – 是否包含中间社群分配
max_iterations (int) – 每个层级运行的最大迭代次数。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
seed_property (str | None) – 用于节点初始值的属性名称。
consecutive_ids (bool) – 为组件使用连续的 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
write_concurrency (int | None) – 用于写入的并发线程数。
min_community_size (int | None) – 结果中包含的社区的最小大小。
- 返回:
算法指标和统计信息
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.community.LouvainMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.community.LouvainStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.community.LouvainWriteResult¶
- class graphdatascience.procedure_surface.api.community.MaxKCutEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, iterations: int = 8, k: int = 2, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, random_seed: int | None = None, vns_max_neighborhood_order: int = 0) EstimationResult¶
估算运行近似最大 K-割(Approximate Maximum k-cut)算法所需的内存。
此方法提供内存估算,而无需实际运行该算法,帮助您确定是否有足够的可用内存。
- 参数:
concurrency (int | None) – 要使用的并发线程数。
iterations (int) – 要运行的迭代次数。
k (int) – 要检测的社区数量。
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
vns_max_neighborhood_order (int | None, default=0) – 变邻域搜索(Variable Neighborhood Search)的最大邻域阶数。
- 返回:
内存估算结果,包括以字节为单位的所需内存和堆内存占比。
- 返回类型:
- abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, iterations: int = 8, job_id: str | None = None, k: int = 2, log_progress: bool = True, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, sudo: bool = False, username: str | None = None, vns_max_neighborhood_order: int = 0) MaxKCutMutateResult¶
执行近似最大 K-割算法,并将结果作为节点属性写入内存中的图。
近似最大 K-割算法是一种社区检测算法,它将图划分为 K 个社区,使得不同社区之间边的权重之和最大化。它使用变邻域搜索(VNS)方法来寻找高质量的割。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
iterations (int) – 要运行的迭代次数。
job_id (str | None) – 计算任务的标识符。
k (int) – 要检测的社区数量。
log_progress (bool) – 显示进度日志。
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
vns_max_neighborhood_order (int | None, default=0) – 变邻域搜索的最大邻域阶数。更高的值可能会获得更好的结果,但会增加计算时间。
- 返回:
算法指标和统计数据,包括割成本和处理时间。
- 返回类型:
- abstract stream(G: GraphV2, *, concurrency: int | None = None, iterations: int = 8, job_id: str | None = None, k: int = 2, log_progress: bool = True, min_community_size: int | None = None, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, sudo: bool = False, username: str | None = None, vns_max_neighborhood_order: int = 0) DataFrame¶
执行近似最大 K-割算法并返回结果流。
近似最大 K-割算法将图划分为 K 个社区以最大化割成本。此方法以流的形式返回每个节点的社区分配。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
iterations (int) – 要运行的迭代次数。
job_id (str | None) – 计算任务的标识符。
k (int) – 要检测的社区数量。
log_progress (bool) – 显示进度日志。
min_community_size (int | None) – 结果中包含的社区的最小大小。
random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
vns_max_neighborhood_order (int | None, default=0) – 变邻域搜索的最大邻域阶数。更高的值可能会获得更好的结果,但会增加计算时间。
- 返回:
一个 DataFrame,包含以下列: - nodeId:节点标识符 - communityId:节点的社区分配
- 返回类型:
DataFrame
- pydantic model graphdatascience.procedure_surface.api.community.MaxKCutMutateResult¶
- class graphdatascience.procedure_surface.api.community.ModularityEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], community_property: str, *, concurrency: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None) EstimationResult¶
估算模块度(Modularity)算法的内存消耗。
- abstract stats(G: GraphV2, community_property: str, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, sudo: bool = False, username: str | None = None) ModularityStatsResult¶
执行模块度算法并返回统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
community_property (str) – 包含社区分配的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法统计信息,包括 communityCount(社区数量)、modularity(模块度)、nodeCount(节点数量)和 relationshipCount(关系数量)。
- 返回类型:
- abstract stream(G: GraphV2, community_property: str, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, sudo: bool = False, username: str | None = None) DataFrame¶
执行模块度算法并返回结果流。
- 参数:
G (GraphV2) – 要使用的图对象
community_property (str) – 包含社区分配的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含算法结果的 DataFrame,其中含有 ‘communityId’ 和 ‘modularity’ 列。
- 返回类型:
DataFrame
- class graphdatascience.procedure_surface.api.community.ModularityOptimizationEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], *, batch_size: int = 10000, concurrency: int | None = None, consecutive_ids: bool = False, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, tolerance: float = 0.0001) EstimationResult¶
估算运行模块度优化(Modularity Optimization)算法的内存消耗。
- 参数:
batch_size (int) – 每个批次处理的节点数量。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
max_iterations (int) – 运行的最大迭代次数。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
tolerance (float) – 迭代间得分的最小变化量。
- 返回:
估算的内存消耗及其他指标。
- 返回类型:
- abstract mutate(G: GraphV2, mutate_property: str, *, batch_size: int = 10000, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, tolerance: float = 0.0001, username: str | None = None) ModularityOptimizationMutateResult¶
执行模块化优化算法,并将结果作为节点属性写入内存图。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
batch_size (int) – 每个批次处理的节点数量。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
tolerance (float) – 迭代间得分的最小变化量。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含社区统计信息和计时信息的计算结果
- 返回类型:
- abstract stats(G: GraphV2, *, batch_size: int = 10000, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, tolerance: float = 0.0001, username: str | None = None) ModularityOptimizationStatsResult¶
执行模块化优化算法,并返回有关社区的统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
batch_size (int) – 每个批次处理的节点数量。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
tolerance (float) – 迭代间得分的最小变化量。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含社区统计信息和计时信息的计算结果
- 返回类型:
- abstract stream(G: GraphV2, *, batch_size: int = 10000, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, tolerance: float = 0.0001, username: str | None = None) DataFrame¶
执行模块化优化算法,并以 DataFrame 形式返回结果。
- 参数:
G (GraphV2) – 要使用的图对象
batch_size (int) – 每个批次处理的节点数量。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
min_community_size (int | None) – 结果中包含的社区的最小大小。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
tolerance (float) – 迭代间得分的最小变化量。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含 ‘nodeId’ 和 ‘communityId’ 列的 DataFrame
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, *, batch_size: int = 10000, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, tolerance: float = 0.0001, username: str | None = None, write_concurrency: int | None = None) ModularityOptimizationWriteResult¶
执行模块化优化算法,并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
batch_size (int) – 每个批次处理的节点数量。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
max_iterations (int) – 运行的最大迭代次数。
min_community_size (int | None) – 结果中包含的社区的最小大小。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
seed_property (str | None) – 用于节点初始值的属性名称。
sudo (bool) – 禁用内存保护。
tolerance (float) – 迭代间得分的最小变化量。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
ModularityOptimizationWriteResult – 包含社区统计信息和计时信息的计算结果
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.community.ModularityOptimizationMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.community.ModularityOptimizationStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.community.ModularityOptimizationWriteResult¶
- pydantic model graphdatascience.procedure_surface.api.community.ModularityStatsResult¶
模块化统计算法的结果对象。
- class graphdatascience.procedure_surface.api.community.SccEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, consecutive_ids: bool = False, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult¶
预估算法运行的内存消耗。
- abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) SccMutateResult¶
运行强连通分量 (SCC) 算法,并将结果作为新的节点属性存储在图目录中。
强连通分量 (SCC) 算法在有向图中查找最大连通节点集。如果一个集合中的每对节点之间都存在有向路径,则该集合被视为一个强连通分量。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
job_id (str | None, default=None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) SccStatsResult¶
执行 SCC 算法并返回统计信息。
- 参数:
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stream(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) DataFrame¶
执行 SCC 算法并返回结果流。
- 参数:
- 返回:
包含算法结果的 DataFrame
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) SccWriteResult¶
执行 SCC(强连通分量)算法并将结果写入 Neo4j 数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
consecutive_ids (bool) – 为组件使用连续的 ID。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
SccWriteResult – 算法指标与统计信息
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.community.SccMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.SccStatsResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.SccWriteResult¶
- 类 graphdatascience.procedure_surface.api.community.SllpaEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], *, max_iterations: int, concurrency: int | None = None, min_association_strength: float = 0.2, node_labels: list[str] = ['*'], partitioning: str = 'RANGE', relationship_types: list[str] = ['*']) EstimationResult¶
估算运行说话人-听众标签传播(SLLPA)算法所需的内存。
- abstract mutate(G: GraphV2, mutate_property: str, *, max_iterations: int, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, min_association_strength: float = 0.2, node_labels: list[str] = ['*'], partitioning: str = 'RANGE', relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) SllpaMutateResult¶
执行说话人-听众标签传播(SLLPA)算法,并将结果作为节点属性写入内存图。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
max_iterations (int) – 运行的最大迭代次数。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
min_association_strength (float | None, 默认=None) – 社区分配的最小关联强度
partitioning (str | None) – 算法的分区配置
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含有关算法执行和突变(mutate)操作元数据的对象
- 返回类型:
- abstract stats(G: GraphV2, *, max_iterations: int, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, min_association_strength: float = 0.2, node_labels: list[str] = ['*'], partitioning: str = 'RANGE', relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) SllpaStatsResult¶
执行说话人-听众标签传播(SLLPA)算法并返回关于社区的统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
min_association_strength (float | None, 默认=None) – 社区分配的最小关联强度
partitioning (str | None) – 算法的分区配置
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
max_iterations (int)
- 返回:
包含关于算法执行统计信息的对象
- 返回类型:
- abstract stream(G: GraphV2, *, max_iterations: int, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, min_association_strength: float = 0.2, node_labels: list[str] = ['*'], partitioning: str = 'RANGE', relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) DataFrame¶
执行说话人-听众标签传播(SLLPA)算法,并以 DataFrame 的形式返回结果。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
min_association_strength (float | None, 默认=None) – 社区分配的最小关联强度
partitioning (str | None) – 算法的分区配置
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
max_iterations (int)
- 返回:
包含节点 ID 及其社区值的 DataFrame
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, *, max_iterations: int, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, min_association_strength: float = 0.2, node_labels: list[str] = ['*'], partitioning: str = 'RANGE', relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) SllpaWriteResult¶
执行说话人-听众标签传播(SLLPA)算法,并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
min_association_strength (float | None, 默认=None) – 社区分配的最小关联强度
partitioning (str | None) – 算法的分区配置
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
SllpaWriteResult – 包含有关算法执行和写入操作元数据的对象
max_iterations (int)
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.community.SllpaMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.SllpaStatsResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.SllpaWriteResult¶
- 类 graphdatascience.procedure_surface.api.community.TriangleCountEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, label_filter: list[str] | None = None, max_degree: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult¶
估算运行三角计数(Triangle Count)算法所需的内存要求。
此方法提供内存估算,而无需实际运行该算法,帮助您确定是否有足够的可用内存。
- abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, job_id: str | None = None, label_filter: list[str] | None = None, log_progress: bool = True, max_degree: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) TriangleCountMutateResult¶
执行三角形计数(Triangle Count)算法并将结果以节点属性的形式写入内存图。
三角形计数算法计算每个节点参与的三角形数量。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
label_filter (list[str] | None, 默认=None) – 按节点标签过滤三角形。仅计算所有节点均具有指定标签之一的三角形。
log_progress (bool) – 显示进度日志。
max_degree (int | None, 默认=None) – 要考虑的节点最大度数。度数高于此值的节点将从三角计数中排除,以提高性能。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息,包括全局三角形计数和处理时间
- 返回类型:
- abstract stats(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, label_filter: list[str] | None = None, log_progress: bool = True, max_degree: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) TriangleCountStatsResult¶
执行三角形计数算法并返回关于计算的统计信息。
此方法计算三角形数量而不将结果存储在图中,提供关于图三角形结构的聚合统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
label_filter (list[str] | None, 默认=None) – 按节点标签过滤三角形。仅计算所有节点均具有指定标签之一的三角形。
log_progress (bool) – 显示进度日志。
max_degree (int | None, 默认=None) – 要考虑的节点最大度数。度数高于此值的节点将从三角计数中排除,以提高性能。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法统计信息,包括全局三角形计数和处理时间
- 返回类型:
- abstract stream(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, label_filter: list[str] | None = None, log_progress: bool = True, max_degree: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) DataFrame¶
执行三角形计数算法并以流形式返回结果。
三角形计数算法计算每个节点参与的三角形数量。此方法以流形式返回每个节点的三角形计数。
- 参数:
G (GraphV2) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
label_filter (list[str] | None, 默认=None) – 按节点标签过滤三角形。仅计算所有节点均具有指定标签之一的三角形。
log_progress (bool) – 显示进度日志。
max_degree (int | None, 默认=None) – 要考虑的节点最大度数。度数高于此值的节点将从三角计数中排除,以提高性能。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含以下列的 DataFrame: - nodeId:节点标识符 - triangleCount:节点参与的三角形数量
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, *, concurrency: int | None = None, job_id: str | None = None, label_filter: list[str] | None = None, log_progress: bool = True, max_degree: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) TriangleCountWriteResult¶
执行三角形计数算法并将结果写回数据库。
此方法计算三角形数量并将结果直接以节点属性的形式写入 Neo4j 数据库,使其可用于后续的 Cypher 查询。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
label_filter (list[str] | None, 默认=None) – 按节点标签过滤三角形。仅计算所有节点均具有指定标签之一的三角形。
log_progress (bool) – 显示进度日志。
max_degree (int | None, 默认=None) – 要考虑的节点最大度数。度数高于此值的节点将从三角计数中排除,以提高性能。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。
- 返回:
算法指标和统计信息,包括全局三角形计数和处理时间
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.community.TriangleCountMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.community.TriangleCountStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.community.TriangleCountWriteResult¶
- class graphdatascience.procedure_surface.api.community.WccEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], threshold: float = 0.0, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) EstimationResult¶
预估算法运行的内存消耗。
- 参数:
- 返回:
内存预估详情
- 返回类型:
- abstract mutate(G: GraphV2, mutate_property: str, threshold: float = 0.0, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) WccMutateResult¶
运行弱连通分量(WCC)算法,并将结果作为新的节点属性存储在图目录中。
弱连通分量(WCC)算法在有向图和无向图中查找连通节点集,如果两个节点之间存在路径,则称它们是连通的。与强连通分量(SCC)不同,该算法不考虑节点间路径中关系的方向。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
threshold (float, default=0.0) – 在遍历过程中考虑关系时所需的最小权重
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None, default=None) – 计算任务的标识符。
seed_property (str | None) – 用于节点初始值的属性名称。
consecutive_ids (bool) – 为组件使用连续的 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, threshold: float = 0.0, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) WccStatsResult¶
执行 WCC 算法并返回统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
threshold (float, default=0.0) – 在遍历过程中考虑关系时所需的最小权重
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
seed_property (str | None) – 用于节点初始值的属性名称。
consecutive_ids (bool) – 为组件使用连续的 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stream(G: GraphV2, min_component_size: int | None = None, threshold: float = 0.0, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) DataFrame¶
执行 WCC 算法并以流形式返回结果。
- 参数:
G (GraphV2) – 要使用的图对象
min_component_size (int | None, default=None) – 不流式传输节点数少于此值的组件
threshold (float, default=0.0) – 在遍历过程中考虑关系时所需的最小权重
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
seed_property (str | None) – 用于节点初始值的属性名称。
consecutive_ids (bool) – 为组件使用连续的 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
- 返回:
包含算法结果的 DataFrame
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, min_component_size: int | None = None, threshold: float = 0.0, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None, write_concurrency: int | None = None) WccWriteResult¶
执行 WCC 算法并将结果写入 Neo4j 数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
min_component_size (int | None, default=None) – 不写入节点数少于此值的组件
threshold (float, default=0.0) – 在遍历过程中考虑关系时所需的最小权重
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
seed_property (str | None) – 用于节点初始值的属性名称。
consecutive_ids (bool) – 为组件使用连续的 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
WccWriteResult – 算法指标和统计信息
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.community.WccMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.WccStatsResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.community.WccWriteResult¶