bugfinder.features.extraction.node2vec.implementation

class bugfinder.features.extraction.node2vec.implementation.Node2VecImplementation(graph, dimensions=64, walk_length=80, num_walks=10, p=1, q=1, weight_key='weight', workers=1, sampling_strategy=None, seed=None)

Bases: object

An implementation of the node2vec algorithm based on eliorc’s module on PyPi.

FIRST_TRAVEL_KEY = 'first_travel_key'
NEIGHBORS_KEY = 'neighbors'
NUM_WALKS_KEY = 'num_walks'
PROBABILITIES_KEY = 'probabilities'
P_KEY = 'p'
Q_KEY = 'q'
WALK_LENGTH_KEY = 'walk_length'
WEIGHT_KEY = 'weight'
fit(**skip_gram_params) Word2Vec

Creates the embeddings using the skip-gram algorithm. Accepts any input the Word2Vec model accepts in a dict format, so it`s possible to tune the algorithm if necessary.

Returns

Trained model.

Return type

Word2Vec