default=False) parser.add_argument('--item_wins', type=bool, nargs='?', const=True, default=False) parser.add_argument('--item_fails', type=bool, nargs='?', const=True, default=False) parser.add_argument('--iter', type=int, nargs='?', default=1000) options = parser.parse_args() DATASET_NAME = options.dataset CSV_FOLDER, CSV_ALL, CONFIG_FILE, Q_NPZ, SKILL_WINS, SKILL_FAILS = dataio.build_new_paths( DATASET_NAME) config = dataio.get_config(CONFIG_FILE) experiment_args = vars(options) df_train, df_val, df_test = dataio.get_data(DATASET_NAME) try: skill_wins = load_npz(SKILL_WINS) skill_fails = load_npz(SKILL_FAILS) except: skill_wins = None skill_fails = None short_legend, full_legend, latex_legend, active_agents = dataio.get_legend( experiment_args) EXPERIMENT_FOLDER = os.path.join(CSV_FOLDER, short_legend)
parser.add_argument('--attempts', type=bool, nargs='?', const=True, default=False) parser.add_argument('--tw_kc', type=bool, nargs='?', const=True, default=False) parser.add_argument('--tw_items', type=bool, nargs='?', const=True, default=False) options = parser.parse_args() experiment_args = vars(options) DATASET_NAME = options.dataset CSV_FOLDER = dataio.build_new_paths(DATASET_NAME) # Build legend short_legend, full_legend, latex_legend, active_agents = dataio.get_legend( experiment_args) EXPERIMENT_FOLDER = os.path.join(CSV_FOLDER, "results", short_legend) dataio.prepare_folder(EXPERIMENT_FOLDER) maxRuns = 5 for run_id in range(maxRuns): dataio.prepare_folder(os.path.join(EXPERIMENT_FOLDER, str(run_id))) # Load sparsely encoded datasets X = csr_matrix(load_npz(options.X_file)) all_users = np.unique(X[:, 0].toarray().flatten()) y = X[:, 3].toarray().flatten()