class_docstr: ```
  Node preprocessing base class
  ```
class_docstr_tok: ["``","`","Node","preprocessing","base","class","``","`"]
docstr: ```
  preprocess training set
  ```
docstr_tok: ["``","`","preprocess","training","set","``","`"]
code: def preprocess_train(self, node_ids):
      """
      ```
      preprocess training set
      ```
      """
      if not self.ids_exist(node_ids):
          raise ValueError("node_ids must exist in self.df")
  
      # subset df for training nodes
      df_tr = self.df[self.df.index.isin(node_ids)]
  
      # one-hot-encode target
      self.y_encoding = sklearn.feature_extraction.DictVectorizer(
          sparse=False
      )
      train_targets = self.y_encoding.fit_transform(
          df_tr[["target"]].to_dict("records")
      )
  
      # import stellargraph
      try:
          import stellargraph as sg
          from stellargraph.mapper import GraphSAGENodeGenerator
      except:
          raise Exception(SG_ERRMSG)
      if version.parse(sg.__version__) < version.parse("0.8"):
          raise Exception(SG_ERRMSG)
  
      # return generator
      G_sg = sg.StellarGraph(
          self.G, node_features=self.df[self.feature_names]
      )
      self.G_sg = G_sg
      generator = GraphSAGENodeGenerator(
          G_sg, U.DEFAULT_BS, [self.sampsize, self.sampsize]
      )
      train_gen = generator.flow(
          df_tr.index, train_targets, shuffle=True
      )
      from .sg_wrappers import NodeSequenceWrapper
  
      return NodeSequenceWrapper(train_gen)
  
imports: from ..None import utils
  from ..imports import *
  from ..preprocessor import Preprocessor
label_desc: Use image node_id 7 for calling the NodePreprocessor obj's underlying member method code with example usage: obj.preprocess_train(node_ids) and returns: NodeSequenceWrapper