class_docstr: ```
  Link preprocessing base class
  ```
class_docstr_tok: ["``","`","Link","preprocessing","base","class","``","`"]
docstr: ```
  preprocess training set
  Args:
    G (networkx graph): networkx graph
    edge_ids(list): list of tuples representing edge ids
    edge_labels(list): edge labels (1 or 0 to indicated whether it is a true edge in original graph or not)
  ```
docstr_tok: ["``","`","preprocess","training","set","Args",":","G","(","networkx","graph",")",":","networkx","graph","edge_ids","(","list",")",":","list","of","tuples","representing","edge","ids","edge_labels","(","list",")",":","edge","labels","(","1","or","0","to","indicated","whether","it","is","a","true","edge","in","original","graph","or","not",")","``","`"]
code: def preprocess_train(self, G, edge_ids, edge_labels, mode="train"):
      """
      ```
      preprocess training set
      Args:
        G (networkx graph): networkx graph
        edge_ids(list): list of tuples representing edge ids
        edge_labels(list): edge labels (1 or 0 to indicated whether it is a true edge in original graph or not)
      ```
      """
      # import stellargraph
      try:
          import stellargraph as sg
          from stellargraph.mapper import GraphSAGELinkGenerator
      except:
          raise Exception(SG_ERRMSG)
      if version.parse(sg.__version__) < version.parse("0.8"):
          raise Exception(SG_ERRMSG)
  
      # edge_labels = to_categorical(edge_labels)
      G_sg = sg.StellarGraph(G, node_features="feature")
      # print(G_sg.info())
      shuffle = True if mode == "train" else False
      link_seq = GraphSAGELinkGenerator(
          G_sg, U.DEFAULT_BS, self.sample_sizes
      ).flow(edge_ids, edge_labels, shuffle=shuffle)
      from .sg_wrappers import LinkSequenceWrapper
  
      return LinkSequenceWrapper(link_seq)
  
imports: from ..None import utils
  from ..imports import *
  from ..preprocessor import Preprocessor
label_desc: Use image node_id 5 for calling the LinkPreprocessor obj's underlying member method code with example usage: obj.preprocess_train(G, edge_ids, edge_labels, mode) and returns: LinkSequenceWrapper