Bases: object

Model for Link Prediction task with unsupervised embeddings

Parameters:
  • dataset – (Graph): Input Graph

  • (int) (number_of_trials) – Number of trials for optuna tuning embeddings

  • device – (device): Device ‘cuda’ or ‘cpu’

  • emb_conv_name – (str): Name of convolution for embedding learning

  • loss_name – (str): Name of loss function for embedding learning

Calculate f1 measure for test edges

Param:

cl (BaseEstimator)

Parameters:
  • test_edges – (List): List of existing edges to test on

  • neg_samples_test – (List): List of negative samples to test on

Returns:

(float): Value of f1 measure

Train classifier for link prediction

Parameters:
  • train_edges – (List): List of existing edges

  • neg_samples_train – (List): List of negative samples to train

Returns:

(BaseEstimator): Classifier which support fit predict notation

Split dataset to train and test and calculate negative samples

Parameters:

dataset – (Graph): Data to split on train, test and negatives

Returns:

(Tuple): Tuple of four lists of train edges, negativу train samples, test and negative test samples edges