#### DEBUG MODE: Show dataset list and STOP if debug_mode>=3: data_io.show_io(input_dir, output_dir) print('\n****** Sample code version ' + str(version) + ' ******\n\n' + '========== DATASETS ==========\n') data_io.write_list(datanames) datanames = [] # Do not proceed with learning and testing # ==================== @RESULT SUBMISSION (KEEP THIS) ===================== # Always keep this code to enable result submission of pre-calculated results # deposited in the res/ subdirectory. if len(datanames)>0: vprint( verbose, "************************************************************************") vprint( verbose, "****** Attempting to copy files (from res/) for RESULT submission ******") vprint( verbose, "************************************************************************") OK = data_io.copy_results(datanames, res_dir, output_dir, verbose) # DO NOT REMOVE! if OK: vprint( verbose, "[+] Success") datanames = [] # Do not proceed with learning and testing else: vprint( verbose, "======== Some missing results on current datasets!") vprint( verbose, "======== Proceeding to train/test:\n") # =================== End @RESULT SUBMISSION (KEEP THIS) ================== # ================ @CODE SUBMISSION (SUBTITUTE YOUR CODE) ================= overall_time_budget = 0 for basename in datanames: # Loop over datasets vprint( verbose, "************************************************") vprint( verbose, "******** Processing dataset " + basename.capitalize() + " ********") vprint( verbose, "************************************************")
#### DEBUG MODE: Show dataset list and STOP if debug_mode>=3: data_io.show_io(input_dir, output_dir) print('\n****** Sample code version ' + str(version) + ' ******\n\n' + '========== DATASETS ==========\n') data_io.write_list(datanames) datanames = [] # Do not proceed with learning and testing # ==================== @RESULT SUBMISSION (KEEP THIS) ===================== # Always keep this code to enable result submission of pre-calculated results # deposited in the res/ subdirectory. if len(datanames)>0: vprint( verbose, "************************************************************************") vprint( verbose, "****** Attempting to copy files (from res/) for RESULT submission ******") vprint( verbose, "************************************************************************") datanames = data_io.copy_results(datanames, res_dir, output_dir, verbose) # DO NOT REMOVE! if not datanames: vprint( verbose, "[+] Results copied to output directory, no model trained/tested") else: vprint( verbose, "======== Some missing results on current datasets!") vprint( verbose, "======== Proceeding to train/test:\n") # =================== End @RESULT SUBMISSION (KEEP THIS) ================== # ================ @CODE SUBMISSION ================= overall_time_budget = 0 time_left_over = 0 for basename in datanames: # Loop over datasets vprint( verbose, "************************************************") vprint( verbose, "******** Processing dataset " + basename.capitalize() + " ********") vprint( verbose, "************************************************")
# Input / Output if len(argv) == 1: input_dir = os.path.join(CONFIG['root_dir'], '..', 'data') output_dir = CONFIG['default_output_dir'] else: input_dir = argv[1] output_dir = os.path.abspath(argv[2]) data_io.mvdir(output_dir, output_dir + '_' + the_date) data_io.mkdir(output_dir) datanames = data_io.inventory_data(input_dir) # datanames = ["madeline"] # Result submission : copy files from /res to output dir OK = data_io.copy_results(datanames, res_dir, output_dir, False) if OK: print "Result files copied output dir. Not running train code." execution_success = True else: execution_success = predict(datanames, input_dir) if execution_success and CONFIG["zipme"]: submission_filename = "../automl_{}_{}.zip".format(CONFIG['codename'], the_date) data_io.zipdir(submission_filename, ".") if CONFIG['running_on_codalab']: if execution_success: exit(0) else: exit(1)