ofs_aif.graph package¶
Submodules¶
ofs_aif.graph.deepwalk module¶
- class DeepWalk(window_size=5, walks_per_vertex=1, walk_length=1, layer_size=25, num_epochs=1, learning_rate=0.1, min_learning_rate=0.001, seed=1234, graph_name='GlobalGraphIH')¶
Bases:
BaseEstimator
,TransformerMixin
- Singleton class DeepWalk:
This class implements user interface API’s for DeepWalk.
- Input:
window_size : the context window size in the skipgram training walks_per_vertex : walks per vertex walk_length : the length of each random walk. layer_size : the dimension of final embedding of each node. num_epochs : Number of epochs. learning_rate : learning rate. seed : Random seed value. graph_name : Name of Global graph.
- fit(X)¶
- fit_deepwalk()¶
Deepwalk algorithm is to create embedding of the node in a graph. Under this part of code, PGX java session is getting used in pypgx and new token is being generated to connect to PGX server. After deepwalk algorithm, embedding are converting into pandas dataframe which is return type of this program. Inputs:
None
- Output:
Pandas dataframe containing embedding per entity ID
- get_pgx_session()¶
Get PGX session from the class member. Inputs:
None
- Returns:
PGX session object
- save()¶
Saving embedding dataframe into oracle database.
- Inputs:
None
- Output:
Boolean True
- set_pgx_session(session)¶
Set PGX session from the PGX interpreter notebook paragraph
- Inputs:
PGX session object
- Returns:
None
- transform(X, key_var='ENTITY_ID')¶
Fit-Transform to read embeddings from database table