目录端点¶
- enum graphdatascience.procedure_surface.api.catalog.Aggregation(value)¶
- 成员类型:
有效值如下:
- NONE = <Aggregation.NONE: 'NONE'>¶
- SINGLE = <Aggregation.SINGLE: 'SINGLE'>¶
- SUM = <Aggregation.SUM: 'SUM'>¶
- MIN = <Aggregation.MIN: 'MIN'>¶
- MAX = <Aggregation.MAX: 'MAX'>¶
- COUNT = <Aggregation.COUNT: 'COUNT'>¶
Enum及其成员也拥有以下方法- __new__(value)¶
- class graphdatascience.procedure_surface.api.catalog.CatalogEndpoints¶
- abstract construct(graph_name: str, nodes: DataFrame | list[DataFrame], relationships: DataFrame | list[DataFrame] | None = None, concurrency: int | None = None, undirected_relationship_types: list[str] | None = None) GraphV2¶
从节点和关系数据帧(DataFrames)列表构建图。
- 参数:
graph_name (str) – 要构建的图的名称
nodes (DataFrame | list[DataFrame]) –
节点数据帧。数据帧应遵循以下模式:
nodeId 用于在整个数据帧中唯一标识节点
labels 用于以字符串列表形式指定节点标签(可选)
其他列被视为节点属性
relationships (DataFrame | list[DataFrame] | None) –
关系数据帧。数据帧应遵循以下模式:
sourceNodeId 用于标识关系的起始节点
targetNodeId 用于标识关系的结束节点
relationshipType 用于指定关系类型(可选)
其他列被视为关系属性
concurrency (int | None) – 要使用的并发线程数。
undirected_relationship_types (list[str] | None) – 要视为无向关系的关系类型列表。
- 返回:
构建的图对象。
- 返回类型:
- property datasets: DatasetEndpoints¶
用于将预定义数据集加载到图目录中的端点。
- abstract filter(G: GraphV2, graph_name: str, node_filter: str, relationship_filter: str, concurrency: int | None = None, job_id: str | None = None) GraphWithFilterResult¶
基于过滤表达式创建图的子图。
- abstract generate(graph_name: str, node_count: int, average_degree: float, *, relationship_distribution: str | None = None, relationship_seed: int | None = None, relationship_property: RelationshipPropertySpec | None = None, orientation: str | None = None, allow_self_loops: bool | None = None, read_concurrency: int | None = None, job_id: str | None = None, sudo: bool = False, log_progress: bool = True, username: str | None = None) GraphWithGenerationStats¶
生成一个随机图并将其存储在图目录中。
- 参数:
graph_name (str) – 生成的图的名称。
node_count (int) – 生成图中的节点数量
average_degree (float) – 生成节点的平均出度
relationship_distribution (str | None, default=None) – 确定关系分布策略。
relationship_seed (int | None, default=None) – 用于生成确定性关系的种子值。
relationship_property (RelationshipPropertySpec | None, 默认=None) – 配置生成的关联属性。
orientation (str | None, default=None) – 指定生成关系的方向。
allow_self_loops (bool | None, default=None) – 图中的节点是否可以具有起始节点和结束节点相同的关系。
read_concurrency (int | None, default=None) – 图生成期间使用的并发线程/进程数。
job_id (str | None) – 计算任务的标识符。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含生成的图对象和包含生成统计信息的结果对象的元组。
- 返回类型:
- abstract list(G: GraphV2 | str | None = None) list[GraphInfoWithDegrees]¶
列出图目录中的图。
- abstract property node_labels: NodeLabelEndpoints¶
用于节点标签操作的端点。
- abstract property node_properties: NodePropertiesEndpoints¶
用于节点标签操作的端点。
- abstract property relationships: RelationshipsEndpoints¶
用于关系操作的端点。
- abstract property sample: GraphSamplingEndpoints¶
用于图采样的端点。
- class graphdatascience.procedure_surface.api.catalog.GraphBackend¶
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.GraphFilterResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.GraphGenerationStats¶
-
- 字段 relationship_property: RelationshipPropertySpec¶
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.GraphInfo¶
- 验证器:
strip_timezone»creation_timestrip_timezone»modification_time
- 字段 creation_time: datetime¶
- 验证依据:
strip_timezone
- 字段 modification_time: datetime¶
- 验证依据:
strip_timezone
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.GraphInfoWithDegrees¶
- 验证器:
- class graphdatascience.procedure_surface.api.catalog.GraphSamplingEndpoints¶
- abstract cnarw(G: GraphV2, graph_name: str, start_nodes: list[int] | None = None, restart_probability: float = 0.1, sampling_ratio: float = 0.15, node_label_stratification: bool = False, relationship_weight_property: str | None = None, 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) GraphWithSamplingResult¶
通用邻居感知随机游走 (CNARW) 通过从一组起始节点进行随机游走来对图进行采样。
CNARW 是一种图采样技术,涉及优化下一跳节点的选择。它考虑了当前节点和下一跳候选节点之间共同邻居的数量。在随机游走的每一步,都有一定概率停止游走,并从起始节点中的一个开始新的游走(即游走重新启动)。这些游走中访问的每个节点都将成为采样子图的一部分。生成的子图作为新图存储在图目录中。
- 参数:
G (GraphV2) – 要使用的图对象
graph_name (str) – 存储在图目录中的新图的名称。
start_nodes (list of int, 可选) –
- 原始图中初始节点集合的 ID,采样随机游走将从这些节点开始。
默认情况下,会随机均匀选择一个节点。
restart_probability (float, 可选) – 采样随机游走从起始节点之一重新启动的概率。默认为 0.1。
sampling_ratio (float, 可选) – 原始图中要采样的节点比例。默认为 0.15。
node_label_stratification (bool, 可选) – 如果为真,则保留原始图的节点标签分布。默认为 False。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含图对象和通用邻居感知随机游走 (CNARW) 结果的元组,包括采样图的维度。
- 返回类型:
- abstract estimate(G: GraphV2, start_nodes: list[int] | None = None, restart_probability: float = 0.1, sampling_ratio: float = 0.15, node_label_stratification: bool = False, relationship_weight_property: str | None = None, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None) EstimationResult¶
估算 CNARW 算法运行的内存消耗。
- 参数:
G (GraphV2) – 要使用的图对象
start_nodes (list of int, 可选) – 原始图中初始节点集合的 ID,采样随机游走将从这些节点开始。默认情况下,会随机均匀选择一个节点。
restart_probability (float, 可选) – 采样随机游走从起始节点之一重新启动的概率。默认为 0.1。
sampling_ratio (float, 可选) – 原始图中要采样的节点比例。默认为 0.15。
node_label_stratification (bool, 可选) – 如果为真,则保留原始图的节点标签分布。默认为 False。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
concurrency (int | None) – 要使用的并发线程数。
- 返回:
内存预估详情
- 返回类型:
- abstract rwr(G: GraphV2, graph_name: str, start_nodes: list[int] | None = None, restart_probability: float = 0.1, sampling_ratio: float = 0.15, node_label_stratification: bool = False, relationship_weight_property: str | None = None, 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) GraphWithSamplingResult¶
带重启的随机游走 (RWR) 通过从一组起始节点进行随机游走来对图进行采样。
在随机游走的每一步,都有一定概率停止游走,并从起始节点中的一个开始新的游走(即游走重新启动)。这些游走中访问的每个节点都将成为采样子图的一部分。生成的子图作为新图存储在图目录中。
- 参数:
G (GraphV2) – 要使用的图对象
graph_name (str) – 存储在图目录中的新图的名称。
start_nodes (list of int, 可选) – 原始图中初始节点集合的 ID,采样随机游走将从这些节点开始。默认情况下,会随机均匀选择一个节点。
restart_probability (float, 可选) – 采样随机游走从起始节点之一重新启动的概率。默认为 0.1。
sampling_ratio (float, 可选) – 原始图中要采样的节点比例。默认为 0.15。
node_label_stratification (bool, 可选) – 如果为真,则保留原始图的节点标签分布。默认为 False。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含图对象和带重启随机游走 (RWR) 结果的元组,包括采样图的维度。
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.GraphSamplingResult¶
- class graphdatascience.procedure_surface.api.catalog.GraphWithFilterResult¶
GraphWithFilterResult(graph, result)
- static __new__(_cls, graph: GraphV2, result: GraphFilterResult)¶
创建 GraphWithFilterResult(graph, result) 的新实例
- 参数:
graph (GraphV2)
result (GraphFilterResult)
- result: GraphFilterResult¶
字段编号 1 的别名
- class graphdatascience.procedure_surface.api.catalog.GraphWithGenerationStats¶
GraphWithGenerationStats(graph, result)
- static __new__(_cls, graph: GraphV2, result: GraphGenerationStats)¶
创建 GraphWithGenerationStats(graph, result) 的新实例
- 参数:
graph (GraphV2)
result (GraphGenerationStats)
- result: GraphGenerationStats¶
字段编号 1 的别名
- class graphdatascience.procedure_surface.api.catalog.GraphWithSamplingResult¶
GraphWithSamplingResult(graph, result)
- static __new__(_cls, graph: GraphV2, result: GraphSamplingResult)¶
创建 GraphWithSamplingResult(graph, result) 的新实例
- 参数:
graph (GraphV2)
result (GraphSamplingResult)
- result: GraphSamplingResult¶
字段编号 1 的别名
- class graphdatascience.procedure_surface.api.catalog.NodeLabelEndpoints¶
- abstract mutate(G: GraphV2, node_label: str, *, node_filter: str, sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, write_concurrency: int | None = None, job_id: str | None = None) NodeLabelMutateResult¶
将指定的节点标签附加到图中经过筛选的节点上。
- 参数:
G (GraphV2) – 要使用的图对象
node_label (str) – 要回写的节点标签。
node_filter (str) – 用于筛选输入图中节点的 Cypher 谓词。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
write_concurrency (int | None) – 用于写入的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
执行指标和统计信息
- 返回类型:
- abstract write(G: GraphV2, node_label: str, *, node_filter: str, sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, write_concurrency: int | None = None, job_id: str | None = None) NodeLabelWriteResult¶
将指定的节点标签写入数据库中经过筛选的节点。
- 参数:
G (GraphV2) – 要使用的图对象
node_label (str) – 要回写的节点标签。
node_filter (str) – 用于筛选输入图中节点的 Cypher 谓词。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
write_concurrency (int | None) – 用于写入的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
执行指标和统计信息
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.catalog.NodeLabelMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.catalog.NodeLabelPersistenceResult¶
- pydantic model graphdatascience.procedure_surface.api.catalog.NodeLabelWriteResult¶
- pydantic model graphdatascience.procedure_surface.api.catalog.NodePropertiesDropResult¶
- class graphdatascience.procedure_surface.api.catalog.NodePropertiesEndpoints¶
- abstract drop(G: GraphV2, node_properties: list[str], *, fail_if_missing: bool | None = None, concurrency: int | None = None, username: str | None = None) NodePropertiesDropResult¶
从图中删除指定的节点属性。
- abstract stream(G: GraphV2, node_properties: str | list[str], *, list_node_labels: bool | None = None, node_labels: list[str] = ['*'], concurrency: int | None = None, sudo: bool = False, log_progress: bool = True, username: str | None = None, job_id: str | None = None, db_node_properties: list[str] | None = None) DataFrame¶
以流式传输从图中提取指定的节点属性。
- 参数:
G (GraphV2) – 要使用的图对象
list_node_labels (boolean | None, default=None) – 是否在流中包含节点标签
concurrency (int | None) – 要使用的并发线程数。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
job_id (str | None) – 计算任务的标识符。
db_node_properties (list[str] | None, default=None) – 从数据库检索额外的节点属性并将其附加到流中。
- 返回:
流式传输的节点属性
- 返回类型:
DataFrame
- abstract write(G: GraphV2, node_properties: str | list[str] | dict[str, str], *, node_labels: list[str] = ['*'], concurrency: int | None = None, write_concurrency: int | None = None, sudo: bool = False, log_progress: bool = True, username: str | None = None, job_id: str | None = None) NodePropertiesWriteResult¶
将图中指定的节点属性写入数据库。
- 参数:
G (GraphV2) – 要使用的图对象
node_properties (str | list[str] | dict[str, str]) –
要写入的节点属性。可以是:
表示单个属性名称的字符串。
表示多个属性名称的字符串列表。
将 GDS 图中的属性名称映射到数据库中属性名称的字典。
concurrency (int | None) – 要使用的并发线程数。
write_concurrency (int | None) – 用于写入的并发线程数。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
job_id (str | None) – 计算任务的标识符。
- 返回:
执行指标和统计信息
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.catalog.NodePropertiesWriteResult¶
- class graphdatascience.procedure_surface.api.catalog.NodePropertySpec¶
NodePropertySpec(node_properties: ‘str | list[str] | dict[str, str]’) -> ‘None’
- pydantic model graphdatascience.procedure_surface.api.catalog.RelationshipPropertySpec¶
-
- static fixed(name: str, value: float) RelationshipPropertySpec¶
- 参数:
- 返回类型:
- static random(name: str, min: float, max: float) RelationshipPropertySpec¶
- 参数:
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.catalog.RelationshipsDropResult¶
- class graphdatascience.procedure_surface.api.catalog.RelationshipsEndpoints¶
- abstract collapse_path(G: GraphV2, path_templates: list[list[str]], mutate_relationship_type: str, *, allow_self_loops: bool = False, concurrency: int | None = None, job_id: str | None = None, sudo: bool = False, log_progress: bool = True, username: str | None = None) CollapsePathResult¶
将图中每条现有的路径折叠成一条关系。
- 参数:
G (GraphV2) – 要使用的图对象
path_templates (list[list[str]]) – 路径模板是用于遍历的有序关系类型列表。同一关系类型可以多次添加,以便按指示进行遍历。此外,您可以指定多个路径模板以便一次性处理。
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
allow_self_loops (bool, default=False) – 图中的节点是否可以具有起始节点和结束节点相同的关系。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
CollapsePathResult
- 返回类型:
关于生成关系的元数据。
- abstract drop(G: GraphV2, relationship_type: str, *, fail_if_missing: bool = True) RelationshipsDropResult¶
从图中删除指定关系类型的所有关系,包括其所有属性。
- 参数:
- 返回:
执行指标和统计信息
- 返回类型:
- abstract index_inverse(G: GraphV2, relationship_types: list[str], *, concurrency: int | None = None, sudo: bool = False, log_progress: bool = True, username: str | None = None, job_id: str | None = None) RelationshipsInverseIndexResult¶
为指定的关系创建索引,索引每个关系的相反方向。某些算法可以使用此索引来加速计算。
- 参数:
- 返回:
执行指标和统计信息
- 返回类型:
- abstract stream(G: GraphV2, relationship_types: list[str] = ['*'], relationship_properties: list[str] | None = None, *, concurrency: int | None = None, sudo: bool = False, log_progress: bool = True, username: str | None = None) DataFrame¶
以流式传输指定类型和属性的所有关系。
- 参数:
G (GraphV2) – 要使用的图对象
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_properties (list[str] | None, default = None) – 要流式传输的关系属性。如果未指定,将不流式传输任何属性。
concurrency (int | None) – 要使用的并发线程数。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
流式传输的关系 [sourceId, targetId, relationshipType],每个属性对应一列
- 返回类型:
DataFrame
- abstract to_undirected(G: GraphV2, relationship_type: str, mutate_relationship_type: str, *, aggregation: Aggregation | dict[str, Aggregation] | None = None, concurrency: int | None = None, sudo: bool = False, log_progress: bool = True, username: str | None = None, job_id: str | None = None) RelationshipsToUndirectedResult¶
在图中创建一种新的关系类型。该关系将基于现有的关系类型,但关系将作为无向关系存储。
- 参数:
G (GraphV2) – 要使用的图对象
relationship_type (str,) – 输入关系类型
mutate_relationship_type (str,) – 用于存储结果的关系类型的名称。
aggregation (Aggregation | dict[str, Aggregation] | None = None,) – 指定如何在图中聚合平行关系。如果提供了单个聚合方式,它将用于指定关系的所有属性。可以提供一个字典来指定特定属性的聚合方式。
concurrency (int | None) – 要使用的并发线程数。
sudo (bool = False,) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
job_id (str | None) – 计算任务的标识符。
- 返回:
执行指标和统计信息
- 返回类型:
- abstract write(G: GraphV2, relationship_type: str, relationship_properties: list[str] | None = None, *, concurrency: int | None = None, write_concurrency: int | None = None, sudo: bool = False, log_progress: bool = True, username: str | None = None, job_id: str | None = None) RelationshipsWriteResult¶
将图中指定关系类型及属性的所有关系写入数据库。
- 参数:
G (GraphV2) – 要使用的图对象
relationship_type (str) – 要写入数据库的关系类型
relationship_properties (list[str] | None, default = None) – 要写入的关系属性。如果未指定,则不会写入任何属性。
concurrency (int | None) – 要使用的并发线程数。
write_concurrency (int | None) – 用于写入的并发线程数。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
job_id (str | None) – 计算任务的标识符。
- 返回:
执行指标和统计信息
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.RelationshipsInverseIndexResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.RelationshipsToUndirectedResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.RelationshipsWriteResult¶
- 验证器:
coerce_relationship_properties»relationship_properties
- 类 graphdatascience.procedure_surface.api.catalog.ScalePropertiesEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], node_properties: list[str], scaler: str | dict[str, str | int | float] | ScalerConfig, node_labels: list[str] = ['*'], concurrency: int | None = None) EstimationResult¶
预估算法运行的内存消耗。
- 参数:
node_properties (Any) – 要缩放的节点属性。可以是属性名称列表,也可以是将属性名称映射到配置的字典。
scaler (str | dict[str, str | int | float] | ScalerConfig) –
要使用的缩放器。可以是
字符串(例如:‘MinMax’, ‘Mean’, ‘Max’, ‘Log’, ‘StdScore’, ‘Center’, ‘NONE’)
包含缩放器配置的字典(例如:{‘type’: ‘Log’, ‘offset’: 1.0})
ScalerConfig实例
concurrency (int | None) – 要使用的并发线程数。
- 返回:
内存预估详情
- 返回类型:
- abstract mutate(G: GraphV2, mutate_property: str, node_properties: list[str], scaler: str | dict[str, str | int | float] | ScalerConfig, node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None) ScalePropertiesMutateResult¶
运行“缩放属性”(Scale Properties)算法,并将结果作为新的节点属性存储在图目录中。
“缩放属性”算法使用指定的缩放器(例如:MinMax、Mean、Max、Log、StdScore、Center)对节点属性进行缩放。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
node_properties (list[str]) – 要缩放的节点属性。可以是属性名称列表,也可以是将属性名称映射到配置的字典。
scaler (str | dict[str, str | int | float] | ScalerConfig) –
要使用的缩放器。可以是
字符串(例如:‘MinMax’, ‘Mean’, ‘Max’, ‘Log’, ‘StdScore’, ‘Center’, ‘NONE’)
包含缩放器配置的字典(例如:{‘type’: ‘Log’, ‘offset’: 1.0})
ScalerConfig实例
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
算法指标和统计信息,包括缩放器统计信息
- 返回类型:
- abstract stats(G: GraphV2, node_properties: list[str], scaler: str | dict[str, str | int | float] | ScalerConfig, node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None) ScalePropertiesStatsResult¶
运行“缩放属性”算法并返回结果统计信息,而不存储结果。
“缩放属性”算法使用指定的缩放器(例如:MinMax、Mean、Max、Log、StdScore、Center)对节点属性进行缩放。
- 参数:
G (GraphV2) – 要使用的图对象
node_properties (list[str]) – 要缩放的节点属性。可以是属性名称列表,也可以是将属性名称映射到配置的字典。
scaler (str | dict[str, str | int | float] | ScalerConfig) –
要使用的缩放器。可以是
字符串(例如:‘MinMax’, ‘Mean’, ‘Max’, ‘Log’, ‘StdScore’, ‘Center’, ‘NONE’)
包含缩放器配置的字典(例如:{‘type’: ‘Log’, ‘offset’: 1.0})
ScalerConfig实例
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
算法统计信息,包括缩放器统计信息
- 返回类型:
- abstract stream(G: GraphV2, node_properties: list[str], scaler: str | dict[str, str | int | float] | ScalerConfig, node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None) DataFrame¶
执行“缩放属性”算法并返回结果流。
- 参数:
G (GraphV2) – 要使用的图对象
node_properties (list[str]) – 要缩放的节点属性。可以是属性名称列表,也可以是将属性名称映射到配置的字典。
scaler (str | dict[str, str | int | float] | ScalerConfig) –
要使用的缩放器。可以是
字符串(例如:‘MinMax’, ‘Mean’, ‘Max’, ‘Log’, ‘StdScore’, ‘Center’, ‘NONE’)
包含缩放器配置的字典(例如:{‘type’: ‘Log’, ‘offset’: 1.0})
ScalerConfig实例
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含 nodeId 和 scaledProperty 列的 DataFrame,其中包含缩放后的属性值。每一行代表一个带有相应缩放属性值的节点。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_property: str, node_properties: list[str], scaler: str | dict[str, str | int | float] | ScalerConfig, 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) ScalePropertiesWriteResult¶
运行“缩放属性”算法,并将结果作为新的节点属性存储在 Neo4j 数据库中。
“缩放属性”算法使用指定的缩放器(例如:MinMax、Mean、Max、Log、StdScore、Center)对节点属性进行缩放。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
node_properties (list[str]) – 要缩放的节点属性。可以是属性名称列表,也可以是将属性名称映射到配置的字典。
scaler (str | dict[str, str | int | float] | ScalerConfig) –
要使用的缩放器。可以是
字符串(例如:‘MinMax’, ‘Mean’, ‘Max’, ‘Log’, ‘StdScore’, ‘Center’, ‘NONE’)
包含缩放器配置的字典(例如:{‘type’: ‘Log’, ‘offset’: 1.0})
ScalerConfig实例
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
ScalePropertiesWriteResult – 算法指标和统计信息,包括缩放器统计信息和写入耗时
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.ScalePropertiesMutateResult¶
以 mutate 模式运行“缩放属性”算法的结果。
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.ScalePropertiesStatsResult¶
以 stats 模式运行“缩放属性”算法的结果。
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.ScalePropertiesWriteResult¶
以 write 模式运行“缩放属性”算法的结果。
- pydantic 模型 graphdatascience.procedure_surface.api.catalog.ScalerConfig¶