vprint( verbose, "Using output_dir: " + output_dir) # Move old results and create a new output directory if not(running_on_codalab) and save_previous_results: data_io.mvdir(output_dir, output_dir+'_'+the_date) data_io.mkdir(output_dir) #### INVENTORY DATA (and sort dataset names alphabetically) datanames = data_io.inventory_data(input_dir) # Overwrite the "natural" order #### 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")
default_input_dir="C:\\Users\\vmkocheg\\Documents\\MLContest\\Phase2\\input" default_output_dir="C:\\Users\\vmkocheg\\Documents\\MLContest\\Phase2\\output" if len(argv)==1: # Use the default input and output directories if no arguments are provided input_dir = default_input_dir output_dir = default_output_dir else: input_dir = argv[1] output_dir = os.path.abspath(argv[2]); #### INVENTORY DATA (and sort dataset names alphabetically) datanames = data_io.inventory_data(input_dir) #### DEBUG MODE: Show dataset list and STOP if debug_mode>=3: data_io.show_io(input_dir, output_dir) data_io.write_list(datanames) datanames = [] # Do not proceed with learning and testing for basename in datanames: # Loop over datasets if basename not in ["robert"]: continue vprint( verbose, "************************************************") vprint( verbose, "******** Processing dataset " + basename.capitalize() + " ********") vprint( verbose, "************************************************") # ======== Learning on a time budget: # Keep track of time not to exceed your time budget. Time spent to inventory data neglected. start = time.time()