class_docstr: ```
  Node preprocessing base class
  ```
class_docstr_tok: ["``","`","Node","preprocessing","base","class","``","`"]
docstr: ```
  preprocess for inductive inference
  df_te (DataFrame): pandas dataframe containing new node attributes
  G_te (Graph):  a networkx Graph containing new nodes
  ```
docstr_tok: ["``","`","preprocess","for","inductive","inference","df_te","(","DataFrame",")",":","pandas","dataframe","containing","new","node","attributes","G_te","(","Graph",")",":","a","networkx","Graph","containing","new","nodes","``","`"]
code: def preprocess_test(self, df_te, G_te):
      """
      ```
      preprocess for inductive inference
      df_te (DataFrame): pandas dataframe containing new node attributes
      G_te (Graph):  a networkx Graph containing new nodes
      ```
      """
      try:
          import networkx as nx
      except ImportError:
          raise ImportError(
              "Please install networkx:  pip install networkx"
          )
  
      if self.y_encoding is None:
          raise Exception(
              "Unset parameters. Are you sure you called preprocess_train first?"
          )
  
      # get aggregrated df
      # df_agg = pd.concat([df_te, self.df]).drop_duplicates(keep='last')
      df_agg = pd.concat([df_te, self.df])
      # df_te = pd.concat([self.df, df_agg]).drop_duplicates(keep=False)
  
      # get aggregrated graph
      is_subset = set(self.G.nodes()) <= set(G_te.nodes())
      if not is_subset:
          raise ValueError("Nodes in self.G must be subset of G_te")
      G_agg = nx.compose(self.G, G_te)
  
      # one-hot-encode target
      if "target" in df_te.columns:
          test_targets = self.y_encoding.transform(
              df_te[["target"]].to_dict("records")
          )
      else:
          test_targets = [-1] * len(df_te.shape[0])
  
      # 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(
          G_agg, node_features=df_agg[self.feature_names]
      )
      generator = GraphSAGENodeGenerator(
          G_sg, U.DEFAULT_BS, [self.sampsize, self.sampsize]
      )
      test_gen = generator.flow(
          df_te.index, test_targets, shuffle=False
      )
      from .sg_wrappers import NodeSequenceWrapper
  
      return NodeSequenceWrapper(test_gen)
  
imports: from ..None import utils
  from ..imports import *
  from ..preprocessor import Preprocessor
label_desc: Use image node_id 9 for calling the NodePreprocessor obj's underlying member method code with example usage: obj.preprocess_test(df_te, G_te) and returns: NodeSequenceWrapper