parameters: (self, reference)
docstring: Set reference Dataset.
  
          Parameters
          ----------
          reference : Dataset
              Reference that is used as a template to consturct the current Dataset.
docstring_summary: Set reference Dataset.
docstring_tokens: Set reference Dataset .
function: def set_reference(self, reference):
          """Set reference Dataset.
  
          Parameters
          ----------
          reference : Dataset
              Reference that is used as a template to consturct the current Dataset.
          """
          self.set_categorical_feature(reference.categorical_feature)
          self.set_feature_name(reference.feature_name)
          self._set_predictor(reference._predictor)
          # we're done if self and reference share a common upstrem reference
          if self.get_ref_chain().intersection(reference.get_ref_chain()):
              return
          if self.data is not None:
              self.reference = reference
              self._free_handle()
          else:
              raise LightGBMError("Cannot set reference after freed raw data, set free_raw_data=False when construct Dataset to avoid this.")
function_tokens: def set_reference ( self , reference ) : self . set_categorical_feature ( reference . categorical_feature ) self . set_feature_name ( reference . feature_name ) self . _set_predictor ( reference . _predictor ) # we're done if self and reference share a common upstrem reference if self . get_ref_chain ( ) . intersection ( reference . get_ref_chain ( ) ) : return if self . data is not None : self . reference = reference self . _free_handle ( ) else : raise LightGBMError ( "Cannot set reference after freed raw data, set free_raw_data=False when construct Dataset to avoid this." )