|
|
|
@ -73,7 +73,7 @@ class GraphData:
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
>>> graph_dataset = ds.GraphData(graph_dataset_dir, 2)
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(0)
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(1)
|
|
|
|
|
>>> features = graph_dataset.get_node_feature(nodes, [1])
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
@ -114,7 +114,7 @@ class GraphData:
|
|
|
|
|
numpy.ndarray, array of nodes.
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(0)
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(1)
|
|
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
|
TypeError: If `node_type` is not integer.
|
|
|
|
@ -175,8 +175,8 @@ class GraphData:
|
|
|
|
|
numpy.ndarray, array of neighbors.
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(0)
|
|
|
|
|
>>> neighbors = graph_dataset.get_all_neighbors(nodes, 0)
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(1)
|
|
|
|
|
>>> neighbors = graph_dataset.get_all_neighbors(nodes, 2)
|
|
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
|
TypeError: If `node_list` is not list or ndarray.
|
|
|
|
@ -211,8 +211,8 @@ class GraphData:
|
|
|
|
|
numpy.ndarray, array of neighbors.
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(0)
|
|
|
|
|
>>> neighbors = graph_dataset.get_sampled_neighbors(nodes, [2, 2], [0, 0])
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(1)
|
|
|
|
|
>>> neighbors = graph_dataset.get_sampled_neighbors(nodes, [2, 2], [2, 1])
|
|
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
|
TypeError: If `node_list` is not list or ndarray.
|
|
|
|
@ -240,8 +240,8 @@ class GraphData:
|
|
|
|
|
numpy.ndarray, array of neighbors.
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(0)
|
|
|
|
|
>>> neg_neighbors = graph_dataset.get_neg_sampled_neighbors(nodes, 5, 0)
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(1)
|
|
|
|
|
>>> neg_neighbors = graph_dataset.get_neg_sampled_neighbors(nodes, 5, 2)
|
|
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
|
TypeError: If `node_list` is not list or ndarray.
|
|
|
|
@ -266,8 +266,8 @@ class GraphData:
|
|
|
|
|
numpy.ndarray, array of features.
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(0)
|
|
|
|
|
>>> features = graph_dataset.get_node_feature(nodes, [1])
|
|
|
|
|
>>> nodes = graph_dataset.get_all_nodes(1)
|
|
|
|
|
>>> features = graph_dataset.get_node_feature(nodes, [2, 3])
|
|
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
|
TypeError: If `node_list` is not list or ndarray.
|
|
|
|
@ -347,7 +347,7 @@ class GraphData:
|
|
|
|
|
numpy.ndarray, array of nodes.
|
|
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
>>> nodes = graph_dataset.random_walk([1,2], [1,2,1,2,1])
|
|
|
|
|
>>> nodes = graph_dataset.random_walk([1, 2], [1, 2, 1, 2, 1])
|
|
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
|
TypeError: If `target_nodes` is not list or ndarray.
|
|
|
|
|