use_histogram=use_historgram) ######## Appending Metrics ######## train_label_list = conversions.tensor_list_to_int_list( train_labels) train_pred_list = conversions.tensor_list_to_int_list(train_preds) val_label_list = conversions.tensor_list_to_int_list(val_labels) val_pred_list = conversions.tensor_list_to_int_list(val_preds) train_scores = metrics.precision_recall_fscore_support( train_label_list, train_pred_list, average='weighted') val_scores = metrics.precision_recall_fscore_support( val_label_list, val_pred_list, average='weighted') validation_user_statistics_over_epochs.append( statistics.generate_training_statistics_for_user( val_labels, val_preds, val_users)) if val_scores[2] > best_split_score: best_split_score = val_scores[2] epoch_at_best_score = epoch split_val_scores.append(best_split_score) best_score_epoch_log.append(epoch_at_best_score) print("Avg Cross Val Score: {}".format(list_mean(split_val_scores))) print("Students Used for Training: {}".format(student_filter_ids)) # scores_and_epochs = (split_val_scores, epoch_at_best_score) # scores_and_epochs_file_name = os.path.join(definitions.DATA_DIR, "cross_val_scores/multitask_autoencoder.pkl") # write_utils.data_structure_to_pickle(scores_and_epochs, scores_and_epochs_file_name)
alpha=alpha, beta=beta, use_histogram=use_historgram, use_covariates=use_covariates) ######## Appending Metrics ######## train_label_list = conversions.tensor_list_to_int_list(train_labels) train_pred_list = conversions.tensor_list_to_int_list(train_preds) val_label_list = conversions.tensor_list_to_int_list(val_labels) val_pred_list = conversions.tensor_list_to_int_list(val_preds) train_scores = metrics.precision_recall_fscore_support(train_label_list, train_pred_list, average='weighted') val_scores = metrics.precision_recall_fscore_support(val_label_list, val_pred_list, average='weighted') validation_user_statistics_over_epochs.append(statistics.generate_training_statistics_for_user(val_labels, val_preds, val_users)) if val_scores[2] > best_split_score: best_split_score = val_scores[2] epoch_at_best_score = epoch best_model = deepcopy(model) print("Split: {} Score This Epoch: {} Best Score: {}".format(split_no, val_scores[2], best_split_score)) split_val_scores.append(best_split_score) best_score_epoch_log.append(epoch_at_best_score) best_models.append(deepcopy(best_model)) print("alpha: {} Beta: {}".format(alpha, beta)) print("Avg Cross Val Score: {}".format(list_mean(split_val_scores)))