class_docstr: A global system that helps to manage the experiments.
class_docstr_tok: ["A","global","system","that","helps","to","manage","the","experiments","."]
docstr: Method to start an experiment. This method can only be called within a Python's `with` statement. Here is the example code:
  
  .. code-block:: Python
  
      # start new experiment and recorder
      with R.start(experiment_name='test', recorder_name='recorder_1'):
          model.fit(dataset)
          R.log...
          ... # further operations
  
      # resume previous experiment and recorder
      with R.start(experiment_name='test', recorder_name='recorder_1', resume=True): # if users want to resume recorder, they have to specify the exact same name for experiment and recorder.
          ... # further operations
  
  
  Parameters
  ----------
  experiment_id : str
      id of the experiment one wants to start.
  experiment_name : str
      name of the experiment one wants to start.
  recorder_id : str
      id of the recorder under the experiment one wants to start.
  recorder_name : str
      name of the recorder under the experiment one wants to start.
  uri : str
      The tracking uri of the experiment, where all the artifacts/metrics etc. will be stored.
      The default uri is set in the qlib.config. Note that this uri argument will not change the one defined in the config file.
      Therefore, the next time when users call this function in the same experiment,
      they have to also specify this argument with the same value. Otherwise, inconsistent uri may occur.
  resume : bool
      whether to resume the specific recorder with given name under the given experiment.
docstr_tok: ["Method","to","start","an","experiment",".","This","method","can","only","be","called","within","a","Python","'s","`","with","`","statement",".","Here","is","the","example","code",":","..","code-block",":",":","Python","#","start","new","experiment","and","recorder","with","R.start","(","experiment_name='test","'",",","recorder_name='recorder_1","'",")",":","model.fit","(","dataset",")","R.log","...","...","#","further","operations","#","resume","previous","experiment","and","recorder","with","R.start","(","experiment_name='test","'",",","recorder_name='recorder_1","'",",","resume=True",")",":","#","if","users","want","to","resume","recorder",",","they","have","to","specify","the","exact","same","name","for","experiment","and","recorder",".","...","#","further","operations","Parameters","--","--","--","--","--","experiment_id",":","str","id","of","the","experiment","one","wants","to","start",".","experiment_name",":","str","name","of","the","experiment","one","wants","to","start",".","recorder_id",":","str","id","of","the","recorder","under","the","experiment","one","wants","to","start",".","recorder_name",":","str","name","of","the","recorder","under","the","experiment","one","wants","to","start",".","uri",":","str","The","tracking","uri","of","the","experiment",",","where","all","the","artifacts\/metrics","etc",".","will","be","stored",".","The","default","uri","is","set","in","the","qlib.config",".","Note","that","this","uri","argument","will","not","change","the","one","defined","in","the","config","file",".","Therefore",",","the","next","time","when","users","call","this","function","in","the","same","experiment",",","they","have","to","also","specify","this","argument","with","the","same","value",".","Otherwise",",","inconsistent","uri","may","occur",".","resume",":","bool","whether","to","resume","the","specific","recorder","with","given","name","under","the","given","experiment","."]
code: def start(
      self,
      *,
      experiment_id: Optional[Text] = None,
      experiment_name: Optional[Text] = None,
      recorder_id: Optional[Text] = None,
      recorder_name: Optional[Text] = None,
      uri: Optional[Text] = None,
      resume: bool = False,
  ):
      """
      Method to start an experiment. This method can only be called within a Python's `with` statement. Here is the example code:
  
      .. code-block:: Python
  
          # start new experiment and recorder
          with R.start(experiment_name='test', recorder_name='recorder_1'):
              model.fit(dataset)
              R.log...
              ... # further operations
  
          # resume previous experiment and recorder
          with R.start(experiment_name='test', recorder_name='recorder_1', resume=True): # if users want to resume recorder, they have to specify the exact same name for experiment and recorder.
              ... # further operations
  
  
      Parameters
      ----------
      experiment_id : str
          id of the experiment one wants to start.
      experiment_name : str
          name of the experiment one wants to start.
      recorder_id : str
          id of the recorder under the experiment one wants to start.
      recorder_name : str
          name of the recorder under the experiment one wants to start.
      uri : str
          The tracking uri of the experiment, where all the artifacts/metrics etc. will be stored.
          The default uri is set in the qlib.config. Note that this uri argument will not change the one defined in the config file.
          Therefore, the next time when users call this function in the same experiment,
          they have to also specify this argument with the same value. Otherwise, inconsistent uri may occur.
      resume : bool
          whether to resume the specific recorder with given name under the given experiment.
      """
      run = self.start_exp(
          experiment_id=experiment_id,
          experiment_name=experiment_name,
          recorder_id=recorder_id,
          recorder_name=recorder_name,
          uri=uri,
          resume=resume,
      )
      try:
          yield run
      except Exception as e:
          self.end_exp(
              Recorder.STATUS_FA
          )  # end the experiment if something went wrong
          raise e
      self.end_exp(Recorder.STATUS_FI)
  
imports: from contextlib import contextmanager
  from typing import Text, Optional, Any, Dict
  from .expm import ExpManager
  from .exp import Experiment
  from .recorder import Recorder
  from ..utils import Wrapper
  from ..utils.exceptions import RecorderInitializationError
  import sys
label_desc: Use image node_id 3 for calling the QlibRecorder obj's underlying member method code with example usage: obj.start() without return types