docstr: Create a Dataset and a Datarun and then work on it.
  
  Args:
      train_path (str):
          Path to the training CSV file. It can be a local filesystem path,
          absolute or relative, or an HTTP or HTTPS URL, or an S3 path in the
          format ``s3://{bucket_name}/{key}``. Required.
      test_path (str):
          Path to the testing CSV file. It can be a local filesystem path,
          absolute or relative, or an HTTP or HTTPS URL, or an S3 path in the
          format ``s3://{bucket_name}/{key}``.
          Optional. If not given, the training CSV will be split in two parts,
          train and test.
      name (str):
          Name given to this dataset. Optional. If not given, a hash will be
          generated from the training_path and used as the Dataset name.
      description (str):
          Human friendly description of the Dataset. Optional.
      class_column (str):
          Name of the column that will be used as the target variable.
          Optional. Defaults to ``'class'``.
      budget (int):
          Budget amount. Optional. Defaults to ``100``.
      budget_type (str):
          Budget Type. Can be 'classifier' or 'walltime'.
          Optional. Defaults to ``'classifier'``.
      gridding (int):
          ``gridding`` setting for the Tuner. Optional. Defaults to ``0``.
      k_window (int):
          ``k`` setting for the Selector. Optional. Defaults to ``3``.
      metric (str):
          Metric to use for the tuning and selection. Optional. Defaults to ``'f1'``.
      methods (list):
          List of methods to try. Optional. Defaults to ``['logreg', 'dt', 'knn']``.
      r_minimum (int):
          ``r_minimum`` setting for the Tuner. Optional. Defaults to ``2``.
      run_per_partition (bool):
          whether to create a separated Datarun for each Hyperpartition or not.
          Optional. Defaults to ``False``.
      score_target (str):
          Which score to use for the tuning and selection process. It can be ``'cv'`` or
          ``'test'``. Optional. Defaults to ``'cv'``.
      priority (int):
          Priority of this Datarun. The higher the better. Optional. Defaults to ``1``.
      selector (str):
          Type of selector to use. Optional. Defaults to ``'uniform'``.
      tuner (str):
          Type of tuner to use. Optional. Defaults to ``'uniform'``.
      deadline (str):
          Time deadline. It must be a string representing a datetime in the format
          ``'%Y-%m-%d %H:%M'``. If given, ``budget_type`` will be set to ``'walltime'``.
      verbose (bool):
          Whether to be verbose about the process. Optional. Defaults to ``True``.
  
  Returns:
      Datarun:
          The created Datarun or list of Dataruns.
docstr_tok: ["Create","a","Dataset","and","a","Datarun","and","then","work","on","it",".","Args",":","train_path","(","str",")",":","Path","to","the","training","CSV","file",".","It","can","be","a","local","filesystem","path",",","absolute","or","relative",",","or","an","HTTP","or","HTTPS","URL",",","or","an","S3","path","in","the","format","``","s3",":","\/\/","{","bucket_name","}","\/","{","key","}","``",".","Required",".","test_path","(","str",")",":","Path","to","the","testing","CSV","file",".","It","can","be","a","local","filesystem","path",",","absolute","or","relative",",","or","an","HTTP","or","HTTPS","URL",",","or","an","S3","path","in","the","format","``","s3",":","\/\/","{","bucket_name","}","\/","{","key","}","``",".","Optional",".","If","not","given",",","the","training","CSV","will","be","split","in","two","parts",",","train","and","test",".","name","(","str",")",":","Name","given","to","this","dataset",".","Optional",".","If","not","given",",","a","hash","will","be","generated","from","the","training_path","and","used","as","the","Dataset","name",".","description","(","str",")",":","Human","friendly","description","of","the","Dataset",".","Optional",".","class_column","(","str",")",":","Name","of","the","column","that","will","be","used","as","the","target","variable",".","Optional",".","Defaults","to","``","'class","'","``",".","budget","(","int",")",":","Budget","amount",".","Optional",".","Defaults","to","``","100","``",".","budget_type","(","str",")",":","Budget","Type",".","Can","be","'classifier","'","or","'walltime","'",".","Optional",".","Defaults","to","``","'classifier","'","``",".","gridding","(","int",")",":","``","gridding","``","setting","for","the","Tuner",".","Optional",".","Defaults","to","``","0","``",".","k_window","(","int",")",":","``","k","``","setting","for","the","Selector",".","Optional",".","Defaults","to","``","3","``",".","metric","(","str",")",":","Metric","to","use","for","the","tuning","and","selection",".","Optional",".","Defaults","to","``","'f1","'","``",".","methods","(","list",")",":","List","of","methods","to","try",".","Optional",".","Defaults","to","``","[","'logreg","'",",","'dt","'",",","'knn","'","]","``",".","r_minimum","(","int",")",":","``","r_minimum","``","setting","for","the","Tuner",".","Optional",".","Defaults","to","``","2","``",".","run_per_partition","(","bool",")",":","whether","to","create","a","separated","Datarun","for","each","Hyperpartition","or","not",".","Optional",".","Defaults","to","``","False","``",".","score_target","(","str",")",":","Which","score","to","use","for","the","tuning","and","selection","process",".","It","can","be","``","'cv","'","``","or","``","'test","'","``",".","Optional",".","Defaults","to","``","'cv","'","``",".","priority","(","int",")",":","Priority","of","this","Datarun",".","The","higher","the","better",".","Optional",".","Defaults","to","``","1","``",".","selector","(","str",")",":","Type","of","selector","to","use",".","Optional",".","Defaults","to","``","'uniform","'","``",".","tuner","(","str",")",":","Type","of","tuner","to","use",".","Optional",".","Defaults","to","``","'uniform","'","``",".","deadline","(","str",")",":","Time","deadline",".","It","must","be","a","string","representing","a","datetime","in","the","format","``","'","%","Y-","%","m-","%","d","%","H",":","%","M","'","``",".","If","given",",","``","budget_type","``","will","be","set","to","``","'walltime","'","``",".","verbose","(","bool",")",":","Whether","to","be","verbose","about","the","process",".","Optional",".","Defaults","to","``","True","``",".","Returns",":","Datarun",":","The","created","Datarun","or","list","of","Dataruns","."]
code: def run(
      self,
      train_path,
      test_path=None,
      name=None,
      description=None,
      class_column="class",
      budget=100,
      budget_type="classifier",
      gridding=0,
      k_window=3,
      metric="f1",
      methods=["logreg", "dt", "knn"],
      r_minimum=2,
      run_per_partition=False,
      score_target="cv",
      selector="uniform",
      tuner="uniform",
      deadline=None,
      priority=1,
      save_files=True,
      choose_randomly=True,
      cloud_mode=False,
      total_time=None,
      verbose=True,
  ):
      """Create a Dataset and a Datarun and then work on it.
  
      Args:
          train_path (str):
              Path to the training CSV file. It can be a local filesystem path,
              absolute or relative, or an HTTP or HTTPS URL, or an S3 path in the
              format ``s3://{bucket_name}/{key}``. Required.
          test_path (str):
              Path to the testing CSV file. It can be a local filesystem path,
              absolute or relative, or an HTTP or HTTPS URL, or an S3 path in the
              format ``s3://{bucket_name}/{key}``.
              Optional. If not given, the training CSV will be split in two parts,
              train and test.
          name (str):
              Name given to this dataset. Optional. If not given, a hash will be
              generated from the training_path and used as the Dataset name.
          description (str):
              Human friendly description of the Dataset. Optional.
          class_column (str):
              Name of the column that will be used as the target variable.
              Optional. Defaults to ``'class'``.
          budget (int):
              Budget amount. Optional. Defaults to ``100``.
          budget_type (str):
              Budget Type. Can be 'classifier' or 'walltime'.
              Optional. Defaults to ``'classifier'``.
          gridding (int):
              ``gridding`` setting for the Tuner. Optional. Defaults to ``0``.
          k_window (int):
              ``k`` setting for the Selector. Optional. Defaults to ``3``.
          metric (str):
              Metric to use for the tuning and selection. Optional. Defaults to ``'f1'``.
          methods (list):
              List of methods to try. Optional. Defaults to ``['logreg', 'dt', 'knn']``.
          r_minimum (int):
              ``r_minimum`` setting for the Tuner. Optional. Defaults to ``2``.
          run_per_partition (bool):
              whether to create a separated Datarun for each Hyperpartition or not.
              Optional. Defaults to ``False``.
          score_target (str):
              Which score to use for the tuning and selection process. It can be ``'cv'`` or
              ``'test'``. Optional. Defaults to ``'cv'``.
          priority (int):
              Priority of this Datarun. The higher the better. Optional. Defaults to ``1``.
          selector (str):
              Type of selector to use. Optional. Defaults to ``'uniform'``.
          tuner (str):
              Type of tuner to use. Optional. Defaults to ``'uniform'``.
          deadline (str):
              Time deadline. It must be a string representing a datetime in the format
              ``'%Y-%m-%d %H:%M'``. If given, ``budget_type`` will be set to ``'walltime'``.
          verbose (bool):
              Whether to be verbose about the process. Optional. Defaults to ``True``.
  
      Returns:
          Datarun:
              The created Datarun or list of Dataruns.
      """
  
      dataset = self.add_dataset(
          train_path, test_path, name, description, class_column
      )
      datarun = self.add_datarun(
          dataset.id,
          budget,
          budget_type,
          gridding,
          k_window,
          metric,
          methods,
          r_minimum,
          run_per_partition,
          score_target,
          priority,
          selector,
          tuner,
          deadline,
      )
  
      if run_per_partition:
          datarun_ids = [_datarun.id for _datarun in datarun]
  
      else:
          datarun_ids = [datarun.id]
  
      if verbose:
          print("Processing dataset {}".format(train_path))
  
      self.work(
          datarun_ids,
          save_files,
          choose_randomly,
          cloud_mode,
          total_time,
          False,
          verbose=verbose,
      )
  
      dataruns = self.db.get_dataruns(
          include_ids=datarun_ids,
          ignore_complete=False,
          ignore_pending=True,
      )
  
      if run_per_partition:
          return dataruns
  
      elif len(dataruns) == 1:
          return dataruns[0]
  
file_path: ATM/atm/core.py
imports: import logging
  import random
  import time
  from datetime import datetime, timedelta
  from operator import attrgetter
  from tqdm import tqdm
  from atm.constants import TIME_FMT, PartitionStatus, RunStatus
  from atm.database import Database
  from atm.method import Method
  from atm.worker import ClassifierError, Worker
label_desc: Use image node_id 5 for calling the ATM obj's underlying member method code with example usage: obj.run(train_path, test_path, name, description, class_column, budget, budget_type, gridding, k_window, metric, methods, r_minimum, run_per_partition, score_target, selector, tuner, deadline, priority, save_files, choose_randomly, cloud_mode, total_time, verbose) and returns: dataruns, dataruns