libcity.model.road_representation.DeepWalk

class libcity.model.road_representation.DeepWalk.DeepWalk(config, data_feature)[源代码]

基类:libcity.model.abstract_traffic_tradition_model.AbstractTraditionModel

run(data=None)[源代码]
参数

data – input of tradition model

返回

output of tradition model

class libcity.model.road_representation.DeepWalk.Graph[源代码]

基类:collections.defaultdict

adjacency_iter()[源代码]
check_self_loops()[源代码]
degree(nodes=None)[源代码]
has_edge(v1, v2)[源代码]
make_consistent()[源代码]
make_undirected()[源代码]
nodes()[源代码]
number_of_edges()[源代码]

Returns the number of nodes in the graph

number_of_nodes()[源代码]

Returns the number of nodes in the graph

order()[源代码]

Returns the number of nodes in the graph

random_walk(path_length, alpha=0, rand=<random.Random object>, start=None)[源代码]

Returns a truncated random walk. path_length: Length of the random walk. alpha: probability of restarts. start: the start node of the random walk.

remove_self_loops()[源代码]
subgraph(nodes={})[源代码]
libcity.model.road_representation.DeepWalk.build_deepwalk_corpus(G, num_paths, path_length, alpha=0, rand=<random.Random object>)[源代码]
libcity.model.road_representation.DeepWalk.from_numpy(x, directed=False)[源代码]
libcity.model.road_representation.DeepWalk.learn_embeddings(walks, dimensions, window_size, workers, iters, min_count=0, sg=1, hs=0)[源代码]