Haplo Prediction
predict haplogroups
|
Test the classification accuracy of haplotype labels from Y-STR data. More...
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <inttypes.h>
#include <math.h>
#include <unistd.h>
#include <libxml/tree.h>
#include <jwsc/base/error.h>
#include <jwsc/base/option.h>
#include <jwsc/base/file_io.h>
#include <jwsc/vector/vector.h>
#include <jwsc/vector/vector_math.h>
#include <jwsc/matrix/matrix.h>
#include <jwsc/matrix/matrix_math.h>
#include <jwsc/matblock/matblock.h>
#include <jwsc/stat/stat.h>
#include "haplo_groups.h"
#include "options.h"
#include "output.h"
#include "input.h"
#include "xml.h"
#include "nb_freq.h"
#include "nb_gauss.h"
#include "nb_gmm.h"
#include "mv_gmm.h"
#include "nearest.h"
Go to the source code of this file.
Defines | |
#define | NUM_SVM_OPTS 0 |
#define | NUM_WEKA_OPTS 0 |
#define | NUM_OPTS_NO_ARG 2 + NUM_SHARED_OPTS_NO_ARG |
#define | NUM_OPTS_WITH_ARG 54 + NUM_SVM_OPTS + NUM_WEKA_OPTS + NUM_SHARED_OPTS_WITH_ARG |
#define | LABEL_COL 1 |
#define | TANDEM 0 |
#define | TEST_TYPE HAPLO_TEST_LEAVE_ONE_OUT |
#define | NUM_CV_FOLDS 5 |
#define | NUM_CV_ITERS 10 |
#define | TMP_DIRNAME "/tmp" |
#define | NB_FREQ_SUMMARY_FNAME "/dev/stdout" |
#define | NB_FREQ_DETAILS_CNT_FNAME "/dev/null" |
#define | NB_FREQ_DETAILS_PCT_FNAME "/dev/null" |
#define | NB_FREQ_CONFUSION_CNT_FNAME "/dev/null" |
#define | NB_FREQ_CONFUSION_PCT_FNAME "/dev/null" |
#define | NB_FREQ_PREDS_FNAME "/dev/null" |
#define | NB_GAUSS_SUMMARY_FNAME "/dev/stdout" |
#define | NB_GAUSS_DETAILS_CNT_FNAME "/dev/null" |
#define | NB_GAUSS_DETAILS_PCT_FNAME "/dev/null" |
#define | NB_GAUSS_CONFUSION_CNT_FNAME "/dev/null" |
#define | NB_GAUSS_CONFUSION_PCT_FNAME "/dev/null" |
#define | NB_GAUSS_PREDS_FNAME "/dev/null" |
#define | NB_GMM_SUMMARY_FNAME "/dev/stdout" |
#define | NB_GMM_DETAILS_CNT_FNAME "/dev/null" |
#define | NB_GMM_DETAILS_PCT_FNAME "/dev/null" |
#define | NB_GMM_CONFUSION_CNT_FNAME "/dev/null" |
#define | NB_GMM_CONFUSION_PCT_FNAME "/dev/null" |
#define | NB_GMM_PREDS_FNAME "/dev/null" |
#define | MV_GMM_SUMMARY_FNAME "/dev/stdout" |
#define | MV_GMM_DETAILS_CNT_FNAME "/dev/null" |
#define | MV_GMM_DETAILS_PCT_FNAME "/dev/null" |
#define | MV_GMM_CONFUSION_CNT_FNAME "/dev/null" |
#define | MV_GMM_CONFUSION_PCT_FNAME "/dev/null" |
#define | MV_GMM_PREDS_FNAME "/dev/null" |
#define | SVM_SUMMARY_FNAME "/dev/stdout" |
#define | SVM_DETAILS_CNT_FNAME "/dev/null" |
#define | SVM_DETAILS_PCT_FNAME "/dev/null" |
#define | SVM_CONFUSION_CNT_FNAME "/dev/null" |
#define | SVM_CONFUSION_PCT_FNAME "/dev/null" |
#define | SVM_PREDS_FNAME "/dev/null" |
#define | WEKA_J48_SUMMARY_FNAME "/dev/stdout" |
#define | WEKA_J48_DETAILS_CNT_FNAME "/dev/null" |
#define | WEKA_J48_DETAILS_PCT_FNAME "/dev/null" |
#define | WEKA_J48_CONFUSION_CNT_FNAME "/dev/null" |
#define | WEKA_J48_CONFUSION_PCT_FNAME "/dev/null" |
#define | WEKA_J48_PREDS_FNAME "/dev/null" |
#define | WEKA_PART_SUMMARY_FNAME "/dev/stdout" |
#define | WEKA_PART_DETAILS_CNT_FNAME "/dev/null" |
#define | WEKA_PART_DETAILS_PCT_FNAME "/dev/null" |
#define | WEKA_PART_CONFUSION_CNT_FNAME "/dev/null" |
#define | WEKA_PART_CONFUSION_PCT_FNAME "/dev/null" |
#define | WEKA_PART_PREDS_FNAME "/dev/null" |
#define | NEAREST_SUMMARY_FNAME "/dev/stdout" |
#define | NEAREST_DETAILS_CNT_FNAME "/dev/null" |
#define | NEAREST_DETAILS_PCT_FNAME "/dev/null" |
#define | NEAREST_CONFUSION_CNT_FNAME "/dev/null" |
#define | NEAREST_CONFUSION_PCT_FNAME "/dev/null" |
#define | NEAREST_PREDS_FNAME "/dev/null" |
#define | TANDEM_AGREE_SUMMARY_FNAME "/dev/stdout" |
#define | TANDEM_AGREE_DETAILS_CNT_FNAME "/dev/null" |
#define | TANDEM_AGREE_DETAILS_PCT_FNAME "/dev/null" |
#define | TANDEM_SUMMARY_FNAME "/dev/stdout" |
#define | TANDEM_DETAILS_CNT_FNAME "/dev/null" |
#define | TANDEM_DETAILS_PCT_FNAME "/dev/null" |
#define | TANDEM_CONFUSION_CNT_FNAME "/dev/null" |
#define | TANDEM_CONFUSION_PCT_FNAME "/dev/null" |
#define | TANDEM_PREDS_FNAME "/dev/null" |
Enumerations | |
enum | Haplo_test_type { HAPLO_TEST_LEAVE_ONE_OUT, HAPLO_TEST_CROSS_VALIDATE } |
Types of testing supported. More... | |
Functions | |
uint32_t | get_num_opts_no_arg () |
Returns the number of options not taking an argument. | |
uint32_t | get_num_opts_with_arg () |
Returns the number of options taking an argument. | |
void | print_usage () |
Prints the program usage to stderr. | |
static Error * | process_tandem_opt () |
Process the 'tandem' program option. | |
static Error * | process_test_type_opt (Option_arg arg) |
Process the 'test-type' program option. | |
static Error * | process_num_cv_folds_opt (Option_arg arg) |
Process the 'num-cv-folds' program option. | |
static Error * | process_num_cv_iters_opt (Option_arg arg) |
Process the 'num-cv-iters' program option. | |
Error * | process_tmp_dir_opt (Option_arg arg) |
Error * | process_nb_freq_summary_out_opt (Option_arg arg) |
Process the 'nb-freq-summary-out' program option. | |
Error * | process_nb_freq_details_pct_out_opt (Option_arg arg) |
Process the 'nb-freq-details-pct-out' program option. | |
Error * | process_nb_freq_details_cnt_out_opt (Option_arg arg) |
Process the 'nb-freq-details-cnt-out' program option. | |
Error * | process_nb_freq_confusion_cnt_out_opt (Option_arg arg) |
Process the 'nb-freq-confusion-cnt-out' program option. | |
Error * | process_nb_freq_confusion_pct_out_opt (Option_arg arg) |
Process the 'nb-freq-confusion-pct-out' program option. | |
Error * | process_nb_freq_preds_out_opt (Option_arg arg) |
Process the 'nb-freq-preds-out' program option. | |
Error * | process_nb_gauss_summary_out_opt (Option_arg arg) |
Process the 'nb-gauss-summary-out' program option. | |
Error * | process_nb_gauss_details_pct_out_opt (Option_arg arg) |
Process the 'nb-gauss-details-pct-out' program option. | |
Error * | process_nb_gauss_details_cnt_out_opt (Option_arg arg) |
Process the 'nb-gauss-details-cnt-out' program option. | |
Error * | process_nb_gauss_confusion_cnt_out_opt (Option_arg arg) |
Process the 'nb-gauss-confusion-cnt-out' program option. | |
Error * | process_nb_gauss_confusion_pct_out_opt (Option_arg arg) |
Process the 'nb-gauss-confusion-pct-out' program option. | |
Error * | process_nb_gauss_preds_out_opt (Option_arg arg) |
Process the 'nb-gauss-preds-out' program option. | |
Error * | process_nb_gmm_summary_out_opt (Option_arg arg) |
Process the 'nb-gmm-summary-out' program option. | |
Error * | process_nb_gmm_details_pct_out_opt (Option_arg arg) |
Process the 'nb-gmm-details-pct-out' program option. | |
Error * | process_nb_gmm_details_cnt_out_opt (Option_arg arg) |
Process the 'nb-gmm-details-cnt-out' program option. | |
Error * | process_nb_gmm_confusion_cnt_out_opt (Option_arg arg) |
Process the 'nb-gmm-confusion-cnt-out' program option. | |
Error * | process_nb_gmm_confusion_pct_out_opt (Option_arg arg) |
Process the 'nb-gmm-confusion-pct-out' program option. | |
Error * | process_nb_gmm_preds_out_opt (Option_arg arg) |
Process the 'nb-gmm-preds-out' program option. | |
Error * | process_mv_gmm_summary_out_opt (Option_arg arg) |
Process the 'mv-gmm-summary-out' program option. | |
Error * | process_mv_gmm_details_pct_out_opt (Option_arg arg) |
Process the 'mv-gmm-details-pct-out' program option. | |
Error * | process_mv_gmm_details_cnt_out_opt (Option_arg arg) |
Process the 'mv-gmm-details-cnt-out' program option. | |
Error * | process_mv_gmm_confusion_cnt_out_opt (Option_arg arg) |
Process the 'mv-gmm-confusion-cnt-out' program option. | |
Error * | process_mv_gmm_confusion_pct_out_opt (Option_arg arg) |
Process the 'mv-gmm-confusion-pct-out' program option. | |
Error * | process_mv_gmm_preds_out_opt (Option_arg arg) |
Process the 'mv-gmm-preds-out' program option. | |
Error * | process_svm_summary_out_opt (Option_arg arg) |
Process the 'svm-summary-out' program option. | |
Error * | process_svm_details_pct_out_opt (Option_arg arg) |
Process the 'svm-details-pct-out' program option. | |
Error * | process_svm_details_cnt_out_opt (Option_arg arg) |
Process the 'svm-details-cnt-out' program option. | |
Error * | process_svm_confusion_cnt_out_opt (Option_arg arg) |
Process the 'svm-confusion-cnt-out' program option. | |
Error * | process_svm_confusion_pct_out_opt (Option_arg arg) |
Process the 'svm-confusion-pct-out' program option. | |
Error * | process_svm_preds_out_opt (Option_arg arg) |
Process the 'svm-preds-out' program option. | |
Error * | process_weka_j48_summary_out_opt (Option_arg arg) |
Process the 'weka-j48-summary-out' program option. | |
Error * | process_weka_j48_details_pct_out_opt (Option_arg arg) |
Process the 'weka-j48-details-pct-out' program option. | |
Error * | process_weka_j48_details_cnt_out_opt (Option_arg arg) |
Process the 'weka-j48-details-cnt-out' program option. | |
Error * | process_weka_j48_confusion_cnt_out_opt (Option_arg arg) |
Process the 'weka-j48-confusion-cnt-out' program option. | |
Error * | process_weka_j48_confusion_pct_out_opt (Option_arg arg) |
Process the 'weka-j48-confusion-pct-out' program option. | |
Error * | process_weka_j48_preds_out_opt (Option_arg arg) |
Process the 'weka-j48-preds-out' program option. | |
Error * | process_weka_part_summary_out_opt (Option_arg arg) |
Process the 'weka-part-summary-out' program option. | |
Error * | process_weka_part_details_pct_out_opt (Option_arg arg) |
Process the 'weka-part-details-pct-out' program option. | |
Error * | process_weka_part_details_cnt_out_opt (Option_arg arg) |
Process the 'weka-part-details-cnt-out' program option. | |
Error * | process_weka_part_confusion_cnt_out_opt (Option_arg arg) |
Process the 'weka-part-confusion-cnt-out' program option. | |
Error * | process_weka_part_confusion_pct_out_opt (Option_arg arg) |
Process the 'weka-part-confusion-pct-out' program option. | |
Error * | process_weka_part_preds_out_opt (Option_arg arg) |
Process the 'weka-part-preds-out' program option. | |
Error * | process_nearest_summary_out_opt (Option_arg arg) |
Process the 'nearest-summary-out' program option. | |
Error * | process_nearest_details_pct_out_opt (Option_arg arg) |
Process the 'nearest-details-pct-out' program option. | |
Error * | process_nearest_details_cnt_out_opt (Option_arg arg) |
Process the 'nearest-details-cnt-out' program option. | |
Error * | process_nearest_confusion_cnt_out_opt (Option_arg arg) |
Process the 'nearest-confusion-cnt-out' program option. | |
Error * | process_nearest_confusion_pct_out_opt (Option_arg arg) |
Process the 'nearest-confusion-pct-out' program option. | |
Error * | process_nearest_preds_out_opt (Option_arg arg) |
Process the 'nearest-preds-out' program option. | |
Error * | process_tandem_agree_summary_out_opt (Option_arg arg) |
Process the 'tandem-agree-summary-out' program option. | |
Error * | process_tandem_agree_details_pct_out_opt (Option_arg arg) |
Process the 'tandem-agree-details-pct-out' program option. | |
Error * | process_tandem_agree_details_cnt_out_opt (Option_arg arg) |
Process the 'tandem-agree-details-cnt-out' program option. | |
Error * | process_tandem_summary_out_opt (Option_arg arg) |
Process the 'tandem-summary-out' program option. | |
Error * | process_tandem_details_pct_out_opt (Option_arg arg) |
Process the 'tandem-details-pct-out' program option. | |
Error * | process_tandem_details_cnt_out_opt (Option_arg arg) |
Process the 'tandem-details-cnt-out' program option. | |
Error * | process_tandem_confusion_cnt_out_opt (Option_arg arg) |
Process the 'tandem-confusion-cnt-out' program option. | |
Error * | process_tandem_confusion_pct_out_opt (Option_arg arg) |
Process the 'tandem-confusion-pct-out' program option. | |
Error * | process_tandem_preds_out_opt (Option_arg arg) |
Process the 'tandem-preds-out' program option. | |
static void | init_test_options (void) |
Initializes the program options. | |
static uint8_t | num_models_to_test () |
Returns the number of models to use for testing. | |
static void | find_ancestors (Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Vector_u32 *labels_1, const Vector_u32 *labels_2) |
Looks up the common ancestor for two sets of labels. | |
static void | find_tandem_ancestors (Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Vector_u32 *tandem_types, const Vector_u32 *tandem_labels, const Vector_u32 *test_labels) |
Looks up the common ancestor for two sets of labels. | |
static void | find_ancestors_of_sets (Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Vector_u32 *labels_1, const Vector_u32 *labels_2, const Vector_u32 *labels_3, const Vector_u32 *labels_4, const Vector_u32 *labels_5, const Vector_u32 *labels_6, const Vector_u32 *labels_7, const Vector_u32 *labels_8) |
Looks up the common ancestor for sets of labels. | |
static void | write_leave_one_out_summary (const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Vector_u32 *ancestor_types, const Vector_u32 *ancestor_labels, const Vector_u32 *pred_labels, const Vector_d *pred_confs, const Vector_u32 *tandem_types, const char *fname) |
Writes the leave-one-out test statistics to the output file. | |
static void | write_leave_one_out_details (const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Vector_u32 *ancestor_types, const Vector_u32 *ancestor_labels, const Vector_u32 *pred_labels, const Vector_d *pred_confs, const Vector_u32 *tandem_types, const char *cnt_fname, const char *pct_fname) |
Writes the leave-one-out test performance details to the output file. | |
static void | write_leave_one_out_confusion (const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Vector_u32 *ancestor_types, const Vector_u32 *ancestor_labels, const Vector_u32 *pred_labels, const Vector_d *pred_confs, const Vector_u32 *tandem_types, const char *cnt_fname, const char *pct_fname) |
Writes the leave-one-out test confusion matrix to the output file. | |
static void | write_leave_one_out_preds (const char *type, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Vector_u32 *ancestor_types, const Vector_u32 *ancestor_labels, const Vector_u32 *pred_labels, const Vector_d *pred_confs, const Vector_u32 *tandem_types, const char *fname) |
Writes the leave-one-out test predictions to the output file. | |
static void | create_leave_one_out_train_and_test_data (Vector_u32 **train_labels_out, Matrix_i32 **train_markers_out, Matrix_i32 **test_markers_out, const Vector_u32 *labels, const Matrix_i32 *markers, uint32_t i) |
Creates a set of training and testing data for a leave-one-out test. | |
static void | leave_one_out_nb_freq (Vector_u32 **labels_out, Vector_d **confs_out, Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Matrix_i32 *data_markers) |
Tests a Naive Bayes classifier using a leave-one-out strategy. | |
static void | leave_one_out_nb_gauss (Vector_u32 **labels_out, Vector_d **confs_out, Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Matrix_i32 *data_markers) |
Tests a Naive Bayes classifier using a leave-one-out strategy. | |
static void | leave_one_out_nb_gmm (Vector_u32 **labels_out, Vector_d **confs_out, Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Matrix_i32 *data_markers) |
Tests a Naive Bayes classifier using a leave-one-out strategy. | |
static void | leave_one_out_mv_gmm (Vector_u32 **labels_out, Vector_d **confs_out, Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Matrix_i32 *data_markers) |
Tests a multivariate classifier using a leave-one-out strategy. | |
static void | leave_one_out_svm (Vector_u32 **labels_out, Vector_d **confs_out, Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Matrix_i32 *data_markers) |
Tests a SVM classifier using a leave-one-out strategy. | |
static void | leave_one_out_j48 (Vector_u32 **labels_out, Vector_d **confs_out, Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Matrix_i32 *data_markers) |
Tests a Weka J48 classifier using a leave-one-out strategy. | |
static void | leave_one_out_part (Vector_u32 **labels_out, Vector_d **confs_out, Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Matrix_i32 *data_markers) |
Tests a Weka PART classifier using a leave-one-out strategy. | |
static void | leave_one_out_nearest (Vector_u32 **labels_out, Vector_d **dists_out, Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Matrix_i32 *data_markers) |
Tests a nearest neighbor classifier using a leave-one-out strategy. | |
static void | leave_one_out_tandem_agree (Vector_u32 **types_out, Vector_u32 **labels_out, Vector_u32 **ancestor_types_out, Vector_u32 **ancestor_labels_out, const Vector_u32 *nb_freq_labels, const Vector_u32 *nb_gauss_labels, const Vector_u32 *nb_gmm_labels, const Vector_u32 *mv_gmm_labels, const Vector_u32 *svm_labels, const Vector_u32 *j48_labels, const Vector_u32 *part_labels, const Vector_u32 *nearest_labels, const Matblock_u8 *data_ids, const Vector_u32 *data_labels) |
Tests the classifiers for agreement using a leave-one-out strategy. | |
static void | leave_one_out_tandem (const Vector_u32 *tandem_types, const Vector_u32 *tandem_labels, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, Vector_u32 *ancestor_types, Vector_u32 *ancestor_labels) |
Tests a tandem classifier decision using a leave-one-out strategy. | |
static void | create_cross_validation_train_and_test_data (Matblock_u8 ****train_ids_out, Vector_u32 ****train_labels_out, Matrix_i32 ****train_markers_out, Matblock_u8 ****test_ids_out, Vector_u32 ****test_labels_out, Matrix_i32 ****test_markers_out, const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Matrix_i32 *data_markers) |
Creates a folded set of training and testing data for cross-validation. | |
static void | free_cross_validation_train_and_test_data (Matblock_u8 ***train_ids, Vector_u32 ***train_labels, Matrix_i32 ***train_markers, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Matrix_i32 ***test_markers) |
Frees a set of cross-validation train and test data. | |
static void | write_cross_validation_summary (Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels, Vector_u32 ***pred_labels, Vector_d ***pred_confs, Vector_u32 ***tandem_types, const char *fname) |
Writes the cross-validation test summary to the output file. | |
static void | write_cross_validation_details (Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels, Vector_u32 ***pred_labels, Vector_d ***pred_confs, Vector_u32 ***tandem_types, const char *cnt_fname, const char *pct_fname) |
Writes the cross-validation test performance details to the output file. | |
static void | write_cross_validation_confusion (Vector_u32 ***test_labels, Vector_u32 ***pred_labels, Vector_d ***pred_confs, Vector_u32 ***tandem_types, const char *cnt_fname, const char *pct_fname) |
Writes the cross-validation test confusion matrix to the output file. | |
static void | write_cross_validation_preds (const char *type, Matblock_u8 ***data_ids, Vector_u32 ***data_labels, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels, Vector_u32 ***pred_labels, Vector_d ***pred_confs, Vector_u32 ***tandem_types, const char *fname) |
Writes the cross-validation test predictions to the output file. | |
static void | cross_validate_nb_freq (Vector_u32 ****labels_out, Vector_d ****confs_out, Matblock_u8 ***train_ids, Vector_u32 ***train_labels, Matrix_i32 ***train_markers, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Matrix_i32 ***test_markers, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
Tests a Naive Bayes classifier using a cross-validation strategy. | |
static void | cross_validate_nb_gauss (Vector_u32 ****labels_out, Vector_d ****confs_out, Matblock_u8 ***train_ids, Vector_u32 ***train_labels, Matrix_i32 ***train_markers, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Matrix_i32 ***test_markers, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
Tests a Naive Bayes classifier using a cross-validation strategy. | |
static void | cross_validate_nb_gmm (Vector_u32 ****labels_out, Vector_d ****confs_out, Matblock_u8 ***train_ids, Vector_u32 ***train_labels, Matrix_i32 ***train_markers, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Matrix_i32 ***test_markers, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
Tests a Naive Bayes classifier using a cross-validation strategy. | |
static void | cross_validate_mv_gmm (Vector_u32 ****labels_out, Vector_d ****confs_out, Matblock_u8 ***train_ids, Vector_u32 ***train_labels, Matrix_i32 ***train_markers, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Matrix_i32 ***test_markers, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
Tests a multivariate classifier using a cross-validation strategy. | |
static void | cross_validate_svm (Vector_u32 ****labels_out, Vector_d ****confs_out, Matblock_u8 ***train_ids, Vector_u32 ***train_labels, Matrix_i32 ***train_markers, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Matrix_i32 ***test_markers, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
Tests a SVM classifier using a cross-validation strategy. | |
static void | cross_validate_j48 (Vector_u32 ****labels_out, Vector_d ****confs_out, Matblock_u8 ***train_ids, Vector_u32 ***train_labels, Matrix_i32 ***train_markers, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Matrix_i32 ***test_markers, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
Tests a Weka J48 classifier using a cross-validation strategy. | |
static void | cross_validate_part (Vector_u32 ****labels_out, Vector_d ****confs_out, Matblock_u8 ***train_ids, Vector_u32 ***train_labels, Matrix_i32 ***train_markers, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Matrix_i32 ***test_markers, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
Tests a Weka PART classifier using a cross-validation strategy. | |
static void | cross_validate_nearest (Vector_u32 ****labels_out, Vector_d ****dists_out, Matblock_u8 ***train_ids, Vector_u32 ***train_labels, Matrix_i32 ***train_markers, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Matrix_i32 ***test_markers, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
Tests a nearest neighbor classifier using a cross-validation strategy. | |
static void | cross_validate_tandem_agree (Vector_u32 ****types_out, Vector_u32 ****labels_out, Vector_u32 ***nb_freq_labels, Vector_u32 ***nb_gauss_labels, Vector_u32 ***nb_gmm_labels, Vector_u32 ***mv_gmm_labels, Vector_u32 ***svm_labels, Vector_u32 ***j48_labels, Vector_u32 ***part_labels, Vector_u32 ***nearest_labels, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
Tests the classifiers for agreement using a cross-validation strategy. | |
static void | cross_validate_tandem (Vector_u32 ***tandem_types, Vector_u32 ***tandem_labels, Matblock_u8 ***test_ids, Vector_u32 ***test_labels, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
Tests a tandem classifier decision using a cross-validation strategy. | |
static void | leave_one_out (const Matblock_u8 *ids, const Vector_u32 *labels, const Matrix_i32 *markers) |
Tests a set of classifiers using a leave-one-out strategy. | |
static void | allocate_cross_validation_results (Vector_u32 ****nb_freq_labels_out, Vector_d ****nb_freq_confs_out, Vector_u32 ****nb_gauss_labels_out, Vector_d ****nb_gauss_confs_out, Vector_u32 ****nb_gmm_labels_out, Vector_d ****nb_gmm_confs_out, Vector_u32 ****mv_gmm_labels_out, Vector_d ****mv_gmm_confs_out, Vector_u32 ****svm_labels_out, Vector_d ****svm_confs_out, Vector_u32 ****j48_labels_out, Vector_d ****j48_confs_out, Vector_u32 ****part_labels_out, Vector_d ****part_confs_out, Vector_u32 ****nearest_labels_out, Vector_d ****nearest_dists_out, Vector_u32 ****tandem_types_out, Vector_u32 ****tandem_labels_out, Vector_u32 ****ancestor_types_out, Vector_u32 ****ancestor_labels_out, uint32_t num_samples) |
Allocates pointer space for the cross-validation iteration and fold test results. | |
static void | free_cross_validation_results (Vector_u32 ***nb_freq_labels, Vector_d ***nb_freq_confs, Vector_u32 ***nb_gauss_labels, Vector_d ***nb_gauss_confs, Vector_u32 ***nb_gmm_labels, Vector_d ***nb_gmm_confs, Vector_u32 ***mv_gmm_labels, Vector_d ***mv_gmm_confs, Vector_u32 ***svm_labels, Vector_d ***svm_confs, Vector_u32 ***j48_labels, Vector_d ***j48_confs, Vector_u32 ***part_labels, Vector_d ***part_confs, Vector_u32 ***nearest_labels, Vector_d ***nearest_dists, Vector_u32 ***tandem_types, Vector_u32 ***tandem_labels, Vector_u32 ***ancestor_types, Vector_u32 ***ancestor_labels) |
static void | cross_validate (const Matblock_u8 *data_ids, const Vector_u32 *data_labels, const Matrix_i32 *data_markers) |
Tests a set of classifiers using cross-validation strategy. | |
int | main (int argc, const char **argv) |
Main function for the haplo-test program. | |
Variables | |
Option_no_arg | opts_no_arg [NUM_OPTS_NO_ARG] |
Program options not taking an argument. | |
Option_with_arg | opts_with_arg [NUM_OPTS_WITH_ARG] |
Program options taking an argument. | |
static uint8_t | tandem = TANDEM |
Whether to do the tandem classification analysis. | |
static Haplo_test_type | test_type = TEST_TYPE |
Type of testing to use. | |
static uint32_t | num_cv_folds = NUM_CV_FOLDS |
Number of cross-validation folds. | |
static uint32_t | num_cv_iters = NUM_CV_ITERS |
Number of cross-validation iterations. | |
static const char * | tmp_dirname = TMP_DIRNAME |
Directory to put temporary models files in. | |
static const char * | nb_freq_summary_fname = NB_FREQ_SUMMARY_FNAME |
Naive Bayes freqency model test performance summary output file name. | |
static const char * | nb_freq_details_cnt_fname = NB_FREQ_DETAILS_CNT_FNAME |
Naive Bayes freqency model test performance details (counts) output file name. | |
static const char * | nb_freq_details_pct_fname = NB_FREQ_DETAILS_PCT_FNAME |
Naive Bayes freqency model test performance details (percents) output file name. | |
static const char * | nb_freq_confusion_cnt_fname = NB_FREQ_CONFUSION_CNT_FNAME |
Naive Bayes freqency model test confusion matrix output file name. | |
static const char * | nb_freq_confusion_pct_fname = NB_FREQ_CONFUSION_PCT_FNAME |
Naive Bayes freqency model test confusion matrix output file name. | |
static const char * | nb_freq_preds_fname = NB_FREQ_PREDS_FNAME |
Naive Bayes freqency model test prediction output file name. | |
static const char * | nb_gauss_summary_fname = NB_GAUSS_SUMMARY_FNAME |
Naive Bayes Gaussian model test performance summary output file name. | |
static const char * | nb_gauss_details_cnt_fname = NB_GAUSS_DETAILS_CNT_FNAME |
Naive Bayes Gaussian model test performance details (counts) output file name. | |
static const char * | nb_gauss_details_pct_fname = NB_GAUSS_DETAILS_PCT_FNAME |
Naive Bayes Gaussian model test performance details (percents) output file name. | |
static const char * | nb_gauss_confusion_cnt_fname = NB_GAUSS_CONFUSION_CNT_FNAME |
Naive Bayes Gaussian model test confusion matrix output file name. | |
static const char * | nb_gauss_confusion_pct_fname = NB_GAUSS_CONFUSION_PCT_FNAME |
Naive Bayes Gaussian model test confusion matrix output file name. | |
static const char * | nb_gauss_preds_fname = NB_GAUSS_PREDS_FNAME |
Naive Bayes Gaussian model test prediction output file name. | |
static const char * | nb_gmm_summary_fname = NB_GMM_SUMMARY_FNAME |
Naive Bayes Gaussian mixture model test performance summary output file name. | |
static const char * | nb_gmm_details_cnt_fname = NB_GMM_DETAILS_CNT_FNAME |
Naive Bayes Gaussian mixture model test performance details (counts) output file name. | |
static const char * | nb_gmm_details_pct_fname = NB_GMM_DETAILS_PCT_FNAME |
Naive Bayes Gaussian mixture model test performance details (percents) output file name. | |
static const char * | nb_gmm_confusion_cnt_fname = NB_GMM_CONFUSION_CNT_FNAME |
Naive Bayes Gaussian mixture model test confusion matrix output file name. | |
static const char * | nb_gmm_confusion_pct_fname = NB_GMM_CONFUSION_PCT_FNAME |
Naive Bayes Gaussian mixture model test confusion matrix output file name. | |
static const char * | nb_gmm_preds_fname = NB_GMM_PREDS_FNAME |
Naive Bayes Gaussian mixture model test prediction output file name. | |
static const char * | mv_gmm_summary_fname = MV_GMM_SUMMARY_FNAME |
Multivariate Gaussian mixture model test performance summary output file name. | |
static const char * | mv_gmm_details_cnt_fname = MV_GMM_DETAILS_CNT_FNAME |
Multivariate Gaussian mixture model test performance details (counts) output file name. | |
static const char * | mv_gmm_details_pct_fname = MV_GMM_DETAILS_PCT_FNAME |
Multivariate Gaussian mixture model test performance details (percents) output file name. | |
static const char * | mv_gmm_confusion_cnt_fname = MV_GMM_CONFUSION_CNT_FNAME |
Multivariate Gaussian mixture model test confusion matrix output file name. | |
static const char * | mv_gmm_confusion_pct_fname = MV_GMM_CONFUSION_PCT_FNAME |
Multivariate Gaussian mixture model test confusion matrix output file name. | |
static const char * | mv_gmm_preds_fname = MV_GMM_PREDS_FNAME |
Multivariate Gaussian mixture model test prediction output file name. | |
static const char * | svm_summary_fname = SVM_SUMMARY_FNAME |
SVM model test performance summary output file name. | |
static const char * | svm_details_cnt_fname = SVM_DETAILS_CNT_FNAME |
SVM model test performance details (counts) output file name. | |
static const char * | svm_details_pct_fname = SVM_DETAILS_PCT_FNAME |
SVM model test performance details (percents) output file name. | |
static const char * | svm_confusion_cnt_fname = SVM_CONFUSION_CNT_FNAME |
SVM model test confusion matrix output file name. | |
static const char * | svm_confusion_pct_fname = SVM_CONFUSION_PCT_FNAME |
SVM model test confusion matrix output file name. | |
static const char * | svm_preds_fname = SVM_PREDS_FNAME |
SVM model test prediction output file name. | |
static const char * | weka_j48_summary_fname = WEKA_J48_SUMMARY_FNAME |
Weka J48 model test performance summary output file name. | |
static const char * | weka_j48_details_cnt_fname = WEKA_J48_DETAILS_CNT_FNAME |
Weka J48 model test performance details (counts) output file name. | |
static const char * | weka_j48_details_pct_fname = WEKA_J48_DETAILS_PCT_FNAME |
Weka J48 model test performance details (percents) output file name. | |
static const char * | weka_j48_confusion_cnt_fname = WEKA_J48_CONFUSION_CNT_FNAME |
Weka J48 model test confusion matrix output file name. | |
static const char * | weka_j48_confusion_pct_fname = WEKA_J48_CONFUSION_PCT_FNAME |
Weka J48 model test confusion matrix output file name. | |
static const char * | weka_j48_preds_fname = WEKA_J48_PREDS_FNAME |
Weka J48 model test prediction output file name. | |
static const char * | weka_part_summary_fname = WEKA_PART_SUMMARY_FNAME |
Weka PART model test performance summary output file name. | |
static const char * | weka_part_details_cnt_fname = WEKA_PART_DETAILS_CNT_FNAME |
Weka PART model test performance details (counts) output file name. | |
static const char * | weka_part_details_pct_fname = WEKA_PART_DETAILS_PCT_FNAME |
Weka PART model test performance details (percents) output file name. | |
static const char * | weka_part_confusion_cnt_fname = WEKA_PART_CONFUSION_CNT_FNAME |
Weka PART model test confusion matrix output file name. | |
static const char * | weka_part_confusion_pct_fname = WEKA_PART_CONFUSION_PCT_FNAME |
Weka PART model test confusion matrix output file name. | |
static const char * | weka_part_preds_fname = WEKA_PART_PREDS_FNAME |
Weka PART model test prediction output file name. | |
static const char * | nearest_summary_fname = NEAREST_SUMMARY_FNAME |
Nearest model test performance summary output file name. | |
static const char * | nearest_details_cnt_fname = NEAREST_DETAILS_CNT_FNAME |
Nearest model test performance details (counts) output file name. | |
static const char * | nearest_details_pct_fname = NEAREST_DETAILS_PCT_FNAME |
Nearest model test performance details (percents) output file name. | |
static const char * | nearest_confusion_cnt_fname = NEAREST_CONFUSION_CNT_FNAME |
Nearest model test confusion matrix output file name. | |
static const char * | nearest_confusion_pct_fname = NEAREST_CONFUSION_PCT_FNAME |
Nearest model test confusion matrix output file name. | |
static const char * | nearest_preds_fname = NEAREST_PREDS_FNAME |
Nearest model test prediction output file name. | |
static const char * | tandem_agree_summary_fname = TANDEM_AGREE_SUMMARY_FNAME |
Tandem agreement test performance summary output file name. | |
static const char * | tandem_agree_details_cnt_fname = TANDEM_AGREE_DETAILS_CNT_FNAME |
Tandem agreement test performance details (counts) output file name. | |
static const char * | tandem_agree_details_pct_fname = TANDEM_AGREE_DETAILS_PCT_FNAME |
Tandem agreement test performance details (percents) output file name. | |
static const char * | tandem_summary_fname = TANDEM_SUMMARY_FNAME |
Tandem test performance summary output file name. | |
static const char * | tandem_details_cnt_fname = TANDEM_DETAILS_CNT_FNAME |
Tandem test performance details (counts) output file name. | |
static const char * | tandem_details_pct_fname = TANDEM_DETAILS_PCT_FNAME |
Tandem test performance details (percents) output file name. | |
static const char * | tandem_confusion_cnt_fname = TANDEM_CONFUSION_CNT_FNAME |
Tandem test confusion matrix output file name. | |
static const char * | tandem_confusion_pct_fname = TANDEM_CONFUSION_PCT_FNAME |
Tandem test confusion matrix output file name. | |
static const char * | tandem_preds_fname = TANDEM_PREDS_FNAME |
Tandem test prediction output file name. |
Test the classification accuracy of haplotype labels from Y-STR data.
Classifier types are
Definition in file haplo_test.c.
#define NUM_SVM_OPTS 0 |
Definition at line 102 of file haplo_test.c.
#define NUM_WEKA_OPTS 0 |
Definition at line 108 of file haplo_test.c.
#define NUM_OPTS_NO_ARG 2 + NUM_SHARED_OPTS_NO_ARG |
Definition at line 111 of file haplo_test.c.
#define NUM_OPTS_WITH_ARG 54 + NUM_SVM_OPTS + NUM_WEKA_OPTS + NUM_SHARED_OPTS_WITH_ARG |
Definition at line 112 of file haplo_test.c.
#define LABEL_COL 1 |
Definition at line 115 of file haplo_test.c.
#define TANDEM 0 |
Definition at line 116 of file haplo_test.c.
#define TEST_TYPE HAPLO_TEST_LEAVE_ONE_OUT |
Definition at line 117 of file haplo_test.c.
#define NUM_CV_FOLDS 5 |
Definition at line 118 of file haplo_test.c.
#define NUM_CV_ITERS 10 |
Definition at line 119 of file haplo_test.c.
#define TMP_DIRNAME "/tmp" |
Definition at line 120 of file haplo_test.c.
#define NB_FREQ_SUMMARY_FNAME "/dev/stdout" |
Definition at line 121 of file haplo_test.c.
#define NB_FREQ_DETAILS_CNT_FNAME "/dev/null" |
Definition at line 122 of file haplo_test.c.
#define NB_FREQ_DETAILS_PCT_FNAME "/dev/null" |
Definition at line 123 of file haplo_test.c.
#define NB_FREQ_CONFUSION_CNT_FNAME "/dev/null" |
Definition at line 124 of file haplo_test.c.
#define NB_FREQ_CONFUSION_PCT_FNAME "/dev/null" |
Definition at line 125 of file haplo_test.c.
#define NB_FREQ_PREDS_FNAME "/dev/null" |
Definition at line 126 of file haplo_test.c.
#define NB_GAUSS_SUMMARY_FNAME "/dev/stdout" |
Definition at line 127 of file haplo_test.c.
#define NB_GAUSS_DETAILS_CNT_FNAME "/dev/null" |
Definition at line 128 of file haplo_test.c.
#define NB_GAUSS_DETAILS_PCT_FNAME "/dev/null" |
Definition at line 129 of file haplo_test.c.
#define NB_GAUSS_CONFUSION_CNT_FNAME "/dev/null" |
Definition at line 130 of file haplo_test.c.
#define NB_GAUSS_CONFUSION_PCT_FNAME "/dev/null" |
Definition at line 131 of file haplo_test.c.
#define NB_GAUSS_PREDS_FNAME "/dev/null" |
Definition at line 132 of file haplo_test.c.
#define NB_GMM_SUMMARY_FNAME "/dev/stdout" |
Definition at line 133 of file haplo_test.c.
#define NB_GMM_DETAILS_CNT_FNAME "/dev/null" |
Definition at line 134 of file haplo_test.c.
#define NB_GMM_DETAILS_PCT_FNAME "/dev/null" |
Definition at line 135 of file haplo_test.c.
#define NB_GMM_CONFUSION_CNT_FNAME "/dev/null" |
Definition at line 136 of file haplo_test.c.
#define NB_GMM_CONFUSION_PCT_FNAME "/dev/null" |
Definition at line 137 of file haplo_test.c.
#define NB_GMM_PREDS_FNAME "/dev/null" |
Definition at line 138 of file haplo_test.c.
#define MV_GMM_SUMMARY_FNAME "/dev/stdout" |
Definition at line 139 of file haplo_test.c.
#define MV_GMM_DETAILS_CNT_FNAME "/dev/null" |
Definition at line 140 of file haplo_test.c.
#define MV_GMM_DETAILS_PCT_FNAME "/dev/null" |
Definition at line 141 of file haplo_test.c.
#define MV_GMM_CONFUSION_CNT_FNAME "/dev/null" |
Definition at line 142 of file haplo_test.c.
#define MV_GMM_CONFUSION_PCT_FNAME "/dev/null" |
Definition at line 143 of file haplo_test.c.
#define MV_GMM_PREDS_FNAME "/dev/null" |
Definition at line 144 of file haplo_test.c.
#define SVM_SUMMARY_FNAME "/dev/stdout" |
Definition at line 145 of file haplo_test.c.
#define SVM_DETAILS_CNT_FNAME "/dev/null" |
Definition at line 146 of file haplo_test.c.
#define SVM_DETAILS_PCT_FNAME "/dev/null" |
Definition at line 147 of file haplo_test.c.
#define SVM_CONFUSION_CNT_FNAME "/dev/null" |
Definition at line 148 of file haplo_test.c.
#define SVM_CONFUSION_PCT_FNAME "/dev/null" |
Definition at line 149 of file haplo_test.c.
#define SVM_PREDS_FNAME "/dev/null" |
Definition at line 150 of file haplo_test.c.
#define WEKA_J48_SUMMARY_FNAME "/dev/stdout" |
Definition at line 151 of file haplo_test.c.
#define WEKA_J48_DETAILS_CNT_FNAME "/dev/null" |
Definition at line 152 of file haplo_test.c.
#define WEKA_J48_DETAILS_PCT_FNAME "/dev/null" |
Definition at line 153 of file haplo_test.c.
#define WEKA_J48_CONFUSION_CNT_FNAME "/dev/null" |
Definition at line 154 of file haplo_test.c.
#define WEKA_J48_CONFUSION_PCT_FNAME "/dev/null" |
Definition at line 155 of file haplo_test.c.
#define WEKA_J48_PREDS_FNAME "/dev/null" |
Definition at line 156 of file haplo_test.c.
#define WEKA_PART_SUMMARY_FNAME "/dev/stdout" |
Definition at line 157 of file haplo_test.c.
#define WEKA_PART_DETAILS_CNT_FNAME "/dev/null" |
Definition at line 158 of file haplo_test.c.
#define WEKA_PART_DETAILS_PCT_FNAME "/dev/null" |
Definition at line 159 of file haplo_test.c.
#define WEKA_PART_CONFUSION_CNT_FNAME "/dev/null" |
Definition at line 160 of file haplo_test.c.
#define WEKA_PART_CONFUSION_PCT_FNAME "/dev/null" |
Definition at line 161 of file haplo_test.c.
#define WEKA_PART_PREDS_FNAME "/dev/null" |
Definition at line 162 of file haplo_test.c.
#define NEAREST_SUMMARY_FNAME "/dev/stdout" |
Definition at line 163 of file haplo_test.c.
#define NEAREST_DETAILS_CNT_FNAME "/dev/null" |
Definition at line 164 of file haplo_test.c.
#define NEAREST_DETAILS_PCT_FNAME "/dev/null" |
Definition at line 165 of file haplo_test.c.
#define NEAREST_CONFUSION_CNT_FNAME "/dev/null" |
Definition at line 166 of file haplo_test.c.
#define NEAREST_CONFUSION_PCT_FNAME "/dev/null" |
Definition at line 167 of file haplo_test.c.
#define NEAREST_PREDS_FNAME "/dev/null" |
Definition at line 168 of file haplo_test.c.
#define TANDEM_AGREE_SUMMARY_FNAME "/dev/stdout" |
Definition at line 169 of file haplo_test.c.
#define TANDEM_AGREE_DETAILS_CNT_FNAME "/dev/null" |
Definition at line 170 of file haplo_test.c.
#define TANDEM_AGREE_DETAILS_PCT_FNAME "/dev/null" |
Definition at line 171 of file haplo_test.c.
#define TANDEM_SUMMARY_FNAME "/dev/stdout" |
Definition at line 172 of file haplo_test.c.
#define TANDEM_DETAILS_CNT_FNAME "/dev/null" |
Definition at line 173 of file haplo_test.c.
#define TANDEM_DETAILS_PCT_FNAME "/dev/null" |
Definition at line 174 of file haplo_test.c.
#define TANDEM_CONFUSION_CNT_FNAME "/dev/null" |
Definition at line 175 of file haplo_test.c.
#define TANDEM_CONFUSION_PCT_FNAME "/dev/null" |
Definition at line 176 of file haplo_test.c.
#define TANDEM_PREDS_FNAME "/dev/null" |
Definition at line 177 of file haplo_test.c.
enum Haplo_test_type |
Types of testing supported.
Definition at line 181 of file haplo_test.c.
uint32_t get_num_opts_no_arg | ( | ) |
Returns the number of options not taking an argument.
Definition at line 454 of file haplo_test.c.
uint32_t get_num_opts_with_arg | ( | ) |
Returns the number of options taking an argument.
Definition at line 460 of file haplo_test.c.
void print_usage | ( | void | ) |
Prints the program usage to stderr.
Definition at line 466 of file haplo_test.c.
static Error* process_tandem_opt | ( | ) | [static] |
Process the 'tandem' program option.
Definition at line 474 of file haplo_test.c.
static Error* process_test_type_opt | ( | Option_arg | arg | ) | [static] |
Process the 'test-type' program option.
Definition at line 481 of file haplo_test.c.
static Error* process_num_cv_folds_opt | ( | Option_arg | arg | ) | [static] |
Process the 'num-cv-folds' program option.
Definition at line 503 of file haplo_test.c.
static Error* process_num_cv_iters_opt | ( | Option_arg | arg | ) | [static] |
Process the 'num-cv-iters' program option.
Definition at line 518 of file haplo_test.c.
Error* process_tmp_dir_opt | ( | Option_arg | arg | ) |
Definition at line 532 of file haplo_test.c.
Error* process_nb_freq_summary_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-freq-summary-out' program option.
Definition at line 544 of file haplo_test.c.
Error* process_nb_freq_details_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-freq-details-pct-out' program option.
Definition at line 555 of file haplo_test.c.
Error* process_nb_freq_details_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-freq-details-cnt-out' program option.
Definition at line 566 of file haplo_test.c.
Error* process_nb_freq_confusion_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-freq-confusion-cnt-out' program option.
Definition at line 577 of file haplo_test.c.
Error* process_nb_freq_confusion_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-freq-confusion-pct-out' program option.
Definition at line 588 of file haplo_test.c.
Error* process_nb_freq_preds_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-freq-preds-out' program option.
Definition at line 599 of file haplo_test.c.
Error* process_nb_gauss_summary_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gauss-summary-out' program option.
Definition at line 610 of file haplo_test.c.
Error* process_nb_gauss_details_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gauss-details-pct-out' program option.
Definition at line 621 of file haplo_test.c.
Error* process_nb_gauss_details_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gauss-details-cnt-out' program option.
Definition at line 632 of file haplo_test.c.
Error* process_nb_gauss_confusion_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gauss-confusion-cnt-out' program option.
Definition at line 643 of file haplo_test.c.
Error* process_nb_gauss_confusion_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gauss-confusion-pct-out' program option.
Definition at line 654 of file haplo_test.c.
Error* process_nb_gauss_preds_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gauss-preds-out' program option.
Definition at line 665 of file haplo_test.c.
Error* process_nb_gmm_summary_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gmm-summary-out' program option.
Definition at line 676 of file haplo_test.c.
Error* process_nb_gmm_details_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gmm-details-pct-out' program option.
Definition at line 687 of file haplo_test.c.
Error* process_nb_gmm_details_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gmm-details-cnt-out' program option.
Definition at line 698 of file haplo_test.c.
Error* process_nb_gmm_confusion_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gmm-confusion-cnt-out' program option.
Definition at line 709 of file haplo_test.c.
Error* process_nb_gmm_confusion_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gmm-confusion-pct-out' program option.
Definition at line 720 of file haplo_test.c.
Error* process_nb_gmm_preds_out_opt | ( | Option_arg | arg | ) |
Process the 'nb-gmm-preds-out' program option.
Definition at line 731 of file haplo_test.c.
Error* process_mv_gmm_summary_out_opt | ( | Option_arg | arg | ) |
Process the 'mv-gmm-summary-out' program option.
Definition at line 742 of file haplo_test.c.
Error* process_mv_gmm_details_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'mv-gmm-details-pct-out' program option.
Definition at line 753 of file haplo_test.c.
Error* process_mv_gmm_details_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'mv-gmm-details-cnt-out' program option.
Definition at line 764 of file haplo_test.c.
Error* process_mv_gmm_confusion_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'mv-gmm-confusion-cnt-out' program option.
Definition at line 775 of file haplo_test.c.
Error* process_mv_gmm_confusion_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'mv-gmm-confusion-pct-out' program option.
Definition at line 786 of file haplo_test.c.
Error* process_mv_gmm_preds_out_opt | ( | Option_arg | arg | ) |
Process the 'mv-gmm-preds-out' program option.
Definition at line 797 of file haplo_test.c.
Error* process_svm_summary_out_opt | ( | Option_arg | arg | ) |
Process the 'svm-summary-out' program option.
Definition at line 808 of file haplo_test.c.
Error* process_svm_details_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'svm-details-pct-out' program option.
Definition at line 819 of file haplo_test.c.
Error* process_svm_details_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'svm-details-cnt-out' program option.
Definition at line 830 of file haplo_test.c.
Error* process_svm_confusion_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'svm-confusion-cnt-out' program option.
Definition at line 841 of file haplo_test.c.
Error* process_svm_confusion_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'svm-confusion-pct-out' program option.
Definition at line 852 of file haplo_test.c.
Error* process_svm_preds_out_opt | ( | Option_arg | arg | ) |
Process the 'svm-preds-out' program option.
Definition at line 863 of file haplo_test.c.
Error* process_weka_j48_summary_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-j48-summary-out' program option.
Definition at line 874 of file haplo_test.c.
Error* process_weka_j48_details_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-j48-details-pct-out' program option.
Definition at line 885 of file haplo_test.c.
Error* process_weka_j48_details_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-j48-details-cnt-out' program option.
Definition at line 896 of file haplo_test.c.
Error* process_weka_j48_confusion_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-j48-confusion-cnt-out' program option.
Definition at line 907 of file haplo_test.c.
Error* process_weka_j48_confusion_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-j48-confusion-pct-out' program option.
Definition at line 918 of file haplo_test.c.
Error* process_weka_j48_preds_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-j48-preds-out' program option.
Definition at line 929 of file haplo_test.c.
Error* process_weka_part_summary_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-part-summary-out' program option.
Definition at line 940 of file haplo_test.c.
Error* process_weka_part_details_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-part-details-pct-out' program option.
Definition at line 951 of file haplo_test.c.
Error* process_weka_part_details_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-part-details-cnt-out' program option.
Definition at line 962 of file haplo_test.c.
Error* process_weka_part_confusion_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-part-confusion-cnt-out' program option.
Definition at line 973 of file haplo_test.c.
Error* process_weka_part_confusion_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-part-confusion-pct-out' program option.
Definition at line 984 of file haplo_test.c.
Error* process_weka_part_preds_out_opt | ( | Option_arg | arg | ) |
Process the 'weka-part-preds-out' program option.
Definition at line 995 of file haplo_test.c.
Error* process_nearest_summary_out_opt | ( | Option_arg | arg | ) |
Process the 'nearest-summary-out' program option.
Definition at line 1006 of file haplo_test.c.
Error* process_nearest_details_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'nearest-details-pct-out' program option.
Definition at line 1017 of file haplo_test.c.
Error* process_nearest_details_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'nearest-details-cnt-out' program option.
Definition at line 1028 of file haplo_test.c.
Error* process_nearest_confusion_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'nearest-confusion-cnt-out' program option.
Definition at line 1039 of file haplo_test.c.
Error* process_nearest_confusion_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'nearest-confusion-pct-out' program option.
Definition at line 1050 of file haplo_test.c.
Error* process_nearest_preds_out_opt | ( | Option_arg | arg | ) |
Process the 'nearest-preds-out' program option.
Definition at line 1061 of file haplo_test.c.
Error* process_tandem_agree_summary_out_opt | ( | Option_arg | arg | ) |
Process the 'tandem-agree-summary-out' program option.
Definition at line 1072 of file haplo_test.c.
Error* process_tandem_agree_details_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'tandem-agree-details-pct-out' program option.
Definition at line 1083 of file haplo_test.c.
Error* process_tandem_agree_details_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'tandem-agree-details-cnt-out' program option.
Definition at line 1094 of file haplo_test.c.
Error* process_tandem_summary_out_opt | ( | Option_arg | arg | ) |
Process the 'tandem-summary-out' program option.
Definition at line 1105 of file haplo_test.c.
Error* process_tandem_details_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'tandem-details-pct-out' program option.
Definition at line 1116 of file haplo_test.c.
Error* process_tandem_details_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'tandem-details-cnt-out' program option.
Definition at line 1127 of file haplo_test.c.
Error* process_tandem_confusion_cnt_out_opt | ( | Option_arg | arg | ) |
Process the 'tandem-confusion-cnt-out' program option.
Definition at line 1138 of file haplo_test.c.
Error* process_tandem_confusion_pct_out_opt | ( | Option_arg | arg | ) |
Process the 'tandem-confusion-pct-out' program option.
Definition at line 1149 of file haplo_test.c.
Error* process_tandem_preds_out_opt | ( | Option_arg | arg | ) |
Process the 'tandem-preds-out' program option.
Definition at line 1160 of file haplo_test.c.
static void init_test_options | ( | void | ) | [static] |
Initializes the program options.
Definition at line 1171 of file haplo_test.c.
static uint8_t num_models_to_test | ( | ) | [static] |
Returns the number of models to use for testing.
Definition at line 1680 of file haplo_test.c.
static void find_ancestors | ( | Vector_u32 ** | ancestor_types_out, |
Vector_u32 ** | ancestor_labels_out, | ||
const Vector_u32 * | labels_1, | ||
const Vector_u32 * | labels_2 | ||
) | [static] |
Looks up the common ancestor for two sets of labels.
Definition at line 1698 of file haplo_test.c.
static void find_tandem_ancestors | ( | Vector_u32 ** | ancestor_types_out, |
Vector_u32 ** | ancestor_labels_out, | ||
const Vector_u32 * | tandem_types, | ||
const Vector_u32 * | tandem_labels, | ||
const Vector_u32 * | test_labels | ||
) | [static] |
Looks up the common ancestor for two sets of labels.
Definition at line 1728 of file haplo_test.c.
static void find_ancestors_of_sets | ( | Vector_u32 ** | ancestor_types_out, |
Vector_u32 ** | ancestor_labels_out, | ||
const Vector_u32 * | labels_1, | ||
const Vector_u32 * | labels_2, | ||
const Vector_u32 * | labels_3, | ||
const Vector_u32 * | labels_4, | ||
const Vector_u32 * | labels_5, | ||
const Vector_u32 * | labels_6, | ||
const Vector_u32 * | labels_7, | ||
const Vector_u32 * | labels_8 | ||
) | [static] |
Looks up the common ancestor for sets of labels.
Definition at line 1764 of file haplo_test.c.
static void write_leave_one_out_summary | ( | const Matblock_u8 * | data_ids, |
const Vector_u32 * | data_labels, | ||
const Vector_u32 * | ancestor_types, | ||
const Vector_u32 * | ancestor_labels, | ||
const Vector_u32 * | pred_labels, | ||
const Vector_d * | pred_confs, | ||
const Vector_u32 * | tandem_types, | ||
const char * | fname | ||
) | [static] |
Writes the leave-one-out test statistics to the output file.
Definition at line 1850 of file haplo_test.c.
static void write_leave_one_out_details | ( | const Matblock_u8 * | data_ids, |
const Vector_u32 * | data_labels, | ||
const Vector_u32 * | ancestor_types, | ||
const Vector_u32 * | ancestor_labels, | ||
const Vector_u32 * | pred_labels, | ||
const Vector_d * | pred_confs, | ||
const Vector_u32 * | tandem_types, | ||
const char * | cnt_fname, | ||
const char * | pct_fname | ||
) | [static] |
Writes the leave-one-out test performance details to the output file.
Uses the following mapping for counts indices:
direct=0, indirect=1, none=2
Definition at line 1985 of file haplo_test.c.
static void write_leave_one_out_confusion | ( | const Matblock_u8 * | data_ids, |
const Vector_u32 * | data_labels, | ||
const Vector_u32 * | ancestor_types, | ||
const Vector_u32 * | ancestor_labels, | ||
const Vector_u32 * | pred_labels, | ||
const Vector_d * | pred_confs, | ||
const Vector_u32 * | tandem_types, | ||
const char * | cnt_fname, | ||
const char * | pct_fname | ||
) | [static] |
Writes the leave-one-out test confusion matrix to the output file.
Definition at line 2135 of file haplo_test.c.
static void write_leave_one_out_preds | ( | const char * | type, |
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
const Vector_u32 * | ancestor_types, | ||
const Vector_u32 * | ancestor_labels, | ||
const Vector_u32 * | pred_labels, | ||
const Vector_d * | pred_confs, | ||
const Vector_u32 * | tandem_types, | ||
const char * | fname | ||
) | [static] |
Writes the leave-one-out test predictions to the output file.
Definition at line 2355 of file haplo_test.c.
static void create_leave_one_out_train_and_test_data | ( | Vector_u32 ** | train_labels_out, |
Matrix_i32 ** | train_markers_out, | ||
Matrix_i32 ** | test_markers_out, | ||
const Vector_u32 * | labels, | ||
const Matrix_i32 * | markers, | ||
uint32_t | i | ||
) | [static] |
Creates a set of training and testing data for a leave-one-out test.
Definition at line 2463 of file haplo_test.c.
static void leave_one_out_nb_freq | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
Vector_u32 ** | ancestor_types_out, | ||
Vector_u32 ** | ancestor_labels_out, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
const Matrix_i32 * | data_markers | ||
) | [static] |
Tests a Naive Bayes classifier using a leave-one-out strategy.
Definition at line 2497 of file haplo_test.c.
static void leave_one_out_nb_gauss | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
Vector_u32 ** | ancestor_types_out, | ||
Vector_u32 ** | ancestor_labels_out, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
const Matrix_i32 * | data_markers | ||
) | [static] |
Tests a Naive Bayes classifier using a leave-one-out strategy.
Definition at line 2570 of file haplo_test.c.
static void leave_one_out_nb_gmm | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
Vector_u32 ** | ancestor_types_out, | ||
Vector_u32 ** | ancestor_labels_out, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
const Matrix_i32 * | data_markers | ||
) | [static] |
Tests a Naive Bayes classifier using a leave-one-out strategy.
Definition at line 2643 of file haplo_test.c.
static void leave_one_out_mv_gmm | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
Vector_u32 ** | ancestor_types_out, | ||
Vector_u32 ** | ancestor_labels_out, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
const Matrix_i32 * | data_markers | ||
) | [static] |
Tests a multivariate classifier using a leave-one-out strategy.
Definition at line 2716 of file haplo_test.c.
static void leave_one_out_svm | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
Vector_u32 ** | ancestor_types_out, | ||
Vector_u32 ** | ancestor_labels_out, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
const Matrix_i32 * | data_markers | ||
) | [static] |
Tests a SVM classifier using a leave-one-out strategy.
Definition at line 2789 of file haplo_test.c.
static void leave_one_out_j48 | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
Vector_u32 ** | ancestor_types_out, | ||
Vector_u32 ** | ancestor_labels_out, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
const Matrix_i32 * | data_markers | ||
) | [static] |
Tests a Weka J48 classifier using a leave-one-out strategy.
Definition at line 2866 of file haplo_test.c.
static void leave_one_out_part | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
Vector_u32 ** | ancestor_types_out, | ||
Vector_u32 ** | ancestor_labels_out, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
const Matrix_i32 * | data_markers | ||
) | [static] |
Tests a Weka PART classifier using a leave-one-out strategy.
Definition at line 2962 of file haplo_test.c.
static void leave_one_out_nearest | ( | Vector_u32 ** | labels_out, |
Vector_d ** | dists_out, | ||
Vector_u32 ** | ancestor_types_out, | ||
Vector_u32 ** | ancestor_labels_out, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
const Matrix_i32 * | data_markers | ||
) | [static] |
Tests a nearest neighbor classifier using a leave-one-out strategy.
Definition at line 3061 of file haplo_test.c.
static void leave_one_out_tandem_agree | ( | Vector_u32 ** | types_out, |
Vector_u32 ** | labels_out, | ||
Vector_u32 ** | ancestor_types_out, | ||
Vector_u32 ** | ancestor_labels_out, | ||
const Vector_u32 * | nb_freq_labels, | ||
const Vector_u32 * | nb_gauss_labels, | ||
const Vector_u32 * | nb_gmm_labels, | ||
const Vector_u32 * | mv_gmm_labels, | ||
const Vector_u32 * | svm_labels, | ||
const Vector_u32 * | j48_labels, | ||
const Vector_u32 * | part_labels, | ||
const Vector_u32 * | nearest_labels, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels | ||
) | [static] |
Tests the classifiers for agreement using a leave-one-out strategy.
Definition at line 3136 of file haplo_test.c.
static void leave_one_out_tandem | ( | const Vector_u32 * | tandem_types, |
const Vector_u32 * | tandem_labels, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
Vector_u32 * | ancestor_types, | ||
Vector_u32 * | ancestor_labels | ||
) | [static] |
Tests a tandem classifier decision using a leave-one-out strategy.
Definition at line 3173 of file haplo_test.c.
static void create_cross_validation_train_and_test_data | ( | Matblock_u8 **** | train_ids_out, |
Vector_u32 **** | train_labels_out, | ||
Matrix_i32 **** | train_markers_out, | ||
Matblock_u8 **** | test_ids_out, | ||
Vector_u32 **** | test_labels_out, | ||
Matrix_i32 **** | test_markers_out, | ||
const Matblock_u8 * | data_ids, | ||
const Vector_u32 * | data_labels, | ||
const Matrix_i32 * | data_markers | ||
) | [static] |
Creates a folded set of training and testing data for cross-validation.
Definition at line 3207 of file haplo_test.c.
static void free_cross_validation_train_and_test_data | ( | Matblock_u8 *** | train_ids, |
Vector_u32 *** | train_labels, | ||
Matrix_i32 *** | train_markers, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Matrix_i32 *** | test_markers | ||
) | [static] |
Frees a set of cross-validation train and test data.
Definition at line 3423 of file haplo_test.c.
static void write_cross_validation_summary | ( | Vector_u32 *** | ancestor_types, |
Vector_u32 *** | ancestor_labels, | ||
Vector_u32 *** | pred_labels, | ||
Vector_d *** | pred_confs, | ||
Vector_u32 *** | tandem_types, | ||
const char * | fname | ||
) | [static] |
Writes the cross-validation test summary to the output file.
Definition at line 3464 of file haplo_test.c.
static void write_cross_validation_details | ( | Vector_u32 *** | ancestor_types, |
Vector_u32 *** | ancestor_labels, | ||
Vector_u32 *** | pred_labels, | ||
Vector_d *** | pred_confs, | ||
Vector_u32 *** | tandem_types, | ||
const char * | cnt_fname, | ||
const char * | pct_fname | ||
) | [static] |
Writes the cross-validation test performance details to the output file.
Uses the following mapping for counts and stats indices:
direct=0, indirect=1, none=3 mean=0, var=1, err=2
Definition at line 3646 of file haplo_test.c.
static void write_cross_validation_confusion | ( | Vector_u32 *** | test_labels, |
Vector_u32 *** | pred_labels, | ||
Vector_d *** | pred_confs, | ||
Vector_u32 *** | tandem_types, | ||
const char * | cnt_fname, | ||
const char * | pct_fname | ||
) | [static] |
Writes the cross-validation test confusion matrix to the output file.
Definition at line 3845 of file haplo_test.c.
static void write_cross_validation_preds | ( | const char * | type, |
Matblock_u8 *** | data_ids, | ||
Vector_u32 *** | data_labels, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels, | ||
Vector_u32 *** | pred_labels, | ||
Vector_d *** | pred_confs, | ||
Vector_u32 *** | tandem_types, | ||
const char * | fname | ||
) | [static] |
Writes the cross-validation test predictions to the output file.
Definition at line 4075 of file haplo_test.c.
static void cross_validate_nb_freq | ( | Vector_u32 **** | labels_out, |
Vector_d **** | confs_out, | ||
Matblock_u8 *** | train_ids, | ||
Vector_u32 *** | train_labels, | ||
Matrix_i32 *** | train_markers, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Matrix_i32 *** | test_markers, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Tests a Naive Bayes classifier using a cross-validation strategy.
Definition at line 4190 of file haplo_test.c.
static void cross_validate_nb_gauss | ( | Vector_u32 **** | labels_out, |
Vector_d **** | confs_out, | ||
Matblock_u8 *** | train_ids, | ||
Vector_u32 *** | train_labels, | ||
Matrix_i32 *** | train_markers, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Matrix_i32 *** | test_markers, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Tests a Naive Bayes classifier using a cross-validation strategy.
Definition at line 4251 of file haplo_test.c.
static void cross_validate_nb_gmm | ( | Vector_u32 **** | labels_out, |
Vector_d **** | confs_out, | ||
Matblock_u8 *** | train_ids, | ||
Vector_u32 *** | train_labels, | ||
Matrix_i32 *** | train_markers, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Matrix_i32 *** | test_markers, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Tests a Naive Bayes classifier using a cross-validation strategy.
Definition at line 4312 of file haplo_test.c.
static void cross_validate_mv_gmm | ( | Vector_u32 **** | labels_out, |
Vector_d **** | confs_out, | ||
Matblock_u8 *** | train_ids, | ||
Vector_u32 *** | train_labels, | ||
Matrix_i32 *** | train_markers, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Matrix_i32 *** | test_markers, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Tests a multivariate classifier using a cross-validation strategy.
Definition at line 4373 of file haplo_test.c.
static void cross_validate_svm | ( | Vector_u32 **** | labels_out, |
Vector_d **** | confs_out, | ||
Matblock_u8 *** | train_ids, | ||
Vector_u32 *** | train_labels, | ||
Matrix_i32 *** | train_markers, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Matrix_i32 *** | test_markers, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Tests a SVM classifier using a cross-validation strategy.
Definition at line 4434 of file haplo_test.c.
static void cross_validate_j48 | ( | Vector_u32 **** | labels_out, |
Vector_d **** | confs_out, | ||
Matblock_u8 *** | train_ids, | ||
Vector_u32 *** | train_labels, | ||
Matrix_i32 *** | train_markers, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Matrix_i32 *** | test_markers, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Tests a Weka J48 classifier using a cross-validation strategy.
Definition at line 4498 of file haplo_test.c.
static void cross_validate_part | ( | Vector_u32 **** | labels_out, |
Vector_d **** | confs_out, | ||
Matblock_u8 *** | train_ids, | ||
Vector_u32 *** | train_labels, | ||
Matrix_i32 *** | train_markers, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Matrix_i32 *** | test_markers, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Tests a Weka PART classifier using a cross-validation strategy.
Definition at line 4582 of file haplo_test.c.
static void cross_validate_nearest | ( | Vector_u32 **** | labels_out, |
Vector_d **** | dists_out, | ||
Matblock_u8 *** | train_ids, | ||
Vector_u32 *** | train_labels, | ||
Matrix_i32 *** | train_markers, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Matrix_i32 *** | test_markers, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Tests a nearest neighbor classifier using a cross-validation strategy.
Definition at line 4669 of file haplo_test.c.
static void cross_validate_tandem_agree | ( | Vector_u32 **** | types_out, |
Vector_u32 **** | labels_out, | ||
Vector_u32 *** | nb_freq_labels, | ||
Vector_u32 *** | nb_gauss_labels, | ||
Vector_u32 *** | nb_gmm_labels, | ||
Vector_u32 *** | mv_gmm_labels, | ||
Vector_u32 *** | svm_labels, | ||
Vector_u32 *** | j48_labels, | ||
Vector_u32 *** | part_labels, | ||
Vector_u32 *** | nearest_labels, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Tests the classifiers for agreement using a cross-validation strategy.
Definition at line 4732 of file haplo_test.c.
static void cross_validate_tandem | ( | Vector_u32 *** | tandem_types, |
Vector_u32 *** | tandem_labels, | ||
Matblock_u8 *** | test_ids, | ||
Vector_u32 *** | test_labels, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Tests a tandem classifier decision using a cross-validation strategy.
Definition at line 4803 of file haplo_test.c.
static void leave_one_out | ( | const Matblock_u8 * | ids, |
const Vector_u32 * | labels, | ||
const Matrix_i32 * | markers | ||
) | [static] |
Tests a set of classifiers using a leave-one-out strategy.
Definition at line 4842 of file haplo_test.c.
static void allocate_cross_validation_results | ( | Vector_u32 **** | nb_freq_labels_out, |
Vector_d **** | nb_freq_confs_out, | ||
Vector_u32 **** | nb_gauss_labels_out, | ||
Vector_d **** | nb_gauss_confs_out, | ||
Vector_u32 **** | nb_gmm_labels_out, | ||
Vector_d **** | nb_gmm_confs_out, | ||
Vector_u32 **** | mv_gmm_labels_out, | ||
Vector_d **** | mv_gmm_confs_out, | ||
Vector_u32 **** | svm_labels_out, | ||
Vector_d **** | svm_confs_out, | ||
Vector_u32 **** | j48_labels_out, | ||
Vector_d **** | j48_confs_out, | ||
Vector_u32 **** | part_labels_out, | ||
Vector_d **** | part_confs_out, | ||
Vector_u32 **** | nearest_labels_out, | ||
Vector_d **** | nearest_dists_out, | ||
Vector_u32 **** | tandem_types_out, | ||
Vector_u32 **** | tandem_labels_out, | ||
Vector_u32 **** | ancestor_types_out, | ||
Vector_u32 **** | ancestor_labels_out, | ||
uint32_t | num_samples | ||
) | [static] |
Allocates pointer space for the cross-validation iteration and fold test results.
Definition at line 4930 of file haplo_test.c.
static void free_cross_validation_results | ( | Vector_u32 *** | nb_freq_labels, |
Vector_d *** | nb_freq_confs, | ||
Vector_u32 *** | nb_gauss_labels, | ||
Vector_d *** | nb_gauss_confs, | ||
Vector_u32 *** | nb_gmm_labels, | ||
Vector_d *** | nb_gmm_confs, | ||
Vector_u32 *** | mv_gmm_labels, | ||
Vector_d *** | mv_gmm_confs, | ||
Vector_u32 *** | svm_labels, | ||
Vector_d *** | svm_confs, | ||
Vector_u32 *** | j48_labels, | ||
Vector_d *** | j48_confs, | ||
Vector_u32 *** | part_labels, | ||
Vector_d *** | part_confs, | ||
Vector_u32 *** | nearest_labels, | ||
Vector_d *** | nearest_dists, | ||
Vector_u32 *** | tandem_types, | ||
Vector_u32 *** | tandem_labels, | ||
Vector_u32 *** | ancestor_types, | ||
Vector_u32 *** | ancestor_labels | ||
) | [static] |
Definition at line 5027 of file haplo_test.c.
static void cross_validate | ( | const Matblock_u8 * | data_ids, |
const Vector_u32 * | data_labels, | ||
const Matrix_i32 * | data_markers | ||
) | [static] |
Tests a set of classifiers using cross-validation strategy.
Definition at line 5124 of file haplo_test.c.
int main | ( | int | argc, |
const char ** | argv | ||
) |
Main function for the haplo-test program.
Definition at line 5223 of file haplo_test.c.
Option_no_arg opts_no_arg[NUM_OPTS_NO_ARG] |
Program options not taking an argument.
Definition at line 190 of file haplo_test.c.
Option_with_arg opts_with_arg[NUM_OPTS_WITH_ARG] |
Program options taking an argument.
Definition at line 193 of file haplo_test.c.
uint8_t tandem = TANDEM [static] |
Whether to do the tandem classification analysis.
Definition at line 196 of file haplo_test.c.
Haplo_test_type test_type = TEST_TYPE [static] |
Type of testing to use.
Definition at line 199 of file haplo_test.c.
uint32_t num_cv_folds = NUM_CV_FOLDS [static] |
Number of cross-validation folds.
Definition at line 202 of file haplo_test.c.
uint32_t num_cv_iters = NUM_CV_ITERS [static] |
Number of cross-validation iterations.
Definition at line 205 of file haplo_test.c.
const char* tmp_dirname = TMP_DIRNAME [static] |
Directory to put temporary models files in.
Definition at line 208 of file haplo_test.c.
const char* nb_freq_summary_fname = NB_FREQ_SUMMARY_FNAME [static] |
Naive Bayes freqency model test performance summary output file name.
Definition at line 214 of file haplo_test.c.
const char* nb_freq_details_cnt_fname = NB_FREQ_DETAILS_CNT_FNAME [static] |
Naive Bayes freqency model test performance details (counts) output file name.
Definition at line 220 of file haplo_test.c.
const char* nb_freq_details_pct_fname = NB_FREQ_DETAILS_PCT_FNAME [static] |
Naive Bayes freqency model test performance details (percents) output file name.
Definition at line 226 of file haplo_test.c.
const char* nb_freq_confusion_cnt_fname = NB_FREQ_CONFUSION_CNT_FNAME [static] |
Naive Bayes freqency model test confusion matrix output file name.
Definition at line 229 of file haplo_test.c.
const char* nb_freq_confusion_pct_fname = NB_FREQ_CONFUSION_PCT_FNAME [static] |
Naive Bayes freqency model test confusion matrix output file name.
Definition at line 232 of file haplo_test.c.
const char* nb_freq_preds_fname = NB_FREQ_PREDS_FNAME [static] |
Naive Bayes freqency model test prediction output file name.
Definition at line 235 of file haplo_test.c.
const char* nb_gauss_summary_fname = NB_GAUSS_SUMMARY_FNAME [static] |
Naive Bayes Gaussian model test performance summary output file name.
Definition at line 241 of file haplo_test.c.
const char* nb_gauss_details_cnt_fname = NB_GAUSS_DETAILS_CNT_FNAME [static] |
Naive Bayes Gaussian model test performance details (counts) output file name.
Definition at line 247 of file haplo_test.c.
const char* nb_gauss_details_pct_fname = NB_GAUSS_DETAILS_PCT_FNAME [static] |
Naive Bayes Gaussian model test performance details (percents) output file name.
Definition at line 253 of file haplo_test.c.
const char* nb_gauss_confusion_cnt_fname = NB_GAUSS_CONFUSION_CNT_FNAME [static] |
Naive Bayes Gaussian model test confusion matrix output file name.
Definition at line 256 of file haplo_test.c.
const char* nb_gauss_confusion_pct_fname = NB_GAUSS_CONFUSION_PCT_FNAME [static] |
Naive Bayes Gaussian model test confusion matrix output file name.
Definition at line 259 of file haplo_test.c.
const char* nb_gauss_preds_fname = NB_GAUSS_PREDS_FNAME [static] |
Naive Bayes Gaussian model test prediction output file name.
Definition at line 262 of file haplo_test.c.
const char* nb_gmm_summary_fname = NB_GMM_SUMMARY_FNAME [static] |
Naive Bayes Gaussian mixture model test performance summary output file name.
Definition at line 268 of file haplo_test.c.
const char* nb_gmm_details_cnt_fname = NB_GMM_DETAILS_CNT_FNAME [static] |
Naive Bayes Gaussian mixture model test performance details (counts) output file name.
Definition at line 274 of file haplo_test.c.
const char* nb_gmm_details_pct_fname = NB_GMM_DETAILS_PCT_FNAME [static] |
Naive Bayes Gaussian mixture model test performance details (percents) output file name.
Definition at line 280 of file haplo_test.c.
const char* nb_gmm_confusion_cnt_fname = NB_GMM_CONFUSION_CNT_FNAME [static] |
Naive Bayes Gaussian mixture model test confusion matrix output file name.
Definition at line 286 of file haplo_test.c.
const char* nb_gmm_confusion_pct_fname = NB_GMM_CONFUSION_PCT_FNAME [static] |
Naive Bayes Gaussian mixture model test confusion matrix output file name.
Definition at line 292 of file haplo_test.c.
const char* nb_gmm_preds_fname = NB_GMM_PREDS_FNAME [static] |
Naive Bayes Gaussian mixture model test prediction output file name.
Definition at line 297 of file haplo_test.c.
const char* mv_gmm_summary_fname = MV_GMM_SUMMARY_FNAME [static] |
Multivariate Gaussian mixture model test performance summary output file name.
Definition at line 303 of file haplo_test.c.
const char* mv_gmm_details_cnt_fname = MV_GMM_DETAILS_CNT_FNAME [static] |
Multivariate Gaussian mixture model test performance details (counts) output file name.
Definition at line 309 of file haplo_test.c.
const char* mv_gmm_details_pct_fname = MV_GMM_DETAILS_PCT_FNAME [static] |
Multivariate Gaussian mixture model test performance details (percents) output file name.
Definition at line 315 of file haplo_test.c.
const char* mv_gmm_confusion_cnt_fname = MV_GMM_CONFUSION_CNT_FNAME [static] |
Multivariate Gaussian mixture model test confusion matrix output file name.
Definition at line 321 of file haplo_test.c.
const char* mv_gmm_confusion_pct_fname = MV_GMM_CONFUSION_PCT_FNAME [static] |
Multivariate Gaussian mixture model test confusion matrix output file name.
Definition at line 327 of file haplo_test.c.
const char* mv_gmm_preds_fname = MV_GMM_PREDS_FNAME [static] |
Multivariate Gaussian mixture model test prediction output file name.
Definition at line 332 of file haplo_test.c.
const char* svm_summary_fname = SVM_SUMMARY_FNAME [static] |
SVM model test performance summary output file name.
Definition at line 335 of file haplo_test.c.
const char* svm_details_cnt_fname = SVM_DETAILS_CNT_FNAME [static] |
SVM model test performance details (counts) output file name.
Definition at line 338 of file haplo_test.c.
const char* svm_details_pct_fname = SVM_DETAILS_PCT_FNAME [static] |
SVM model test performance details (percents) output file name.
Definition at line 341 of file haplo_test.c.
const char* svm_confusion_cnt_fname = SVM_CONFUSION_CNT_FNAME [static] |
SVM model test confusion matrix output file name.
Definition at line 344 of file haplo_test.c.
const char* svm_confusion_pct_fname = SVM_CONFUSION_PCT_FNAME [static] |
SVM model test confusion matrix output file name.
Definition at line 347 of file haplo_test.c.
const char* svm_preds_fname = SVM_PREDS_FNAME [static] |
SVM model test prediction output file name.
Definition at line 350 of file haplo_test.c.
const char* weka_j48_summary_fname = WEKA_J48_SUMMARY_FNAME [static] |
Weka J48 model test performance summary output file name.
Definition at line 353 of file haplo_test.c.
const char* weka_j48_details_cnt_fname = WEKA_J48_DETAILS_CNT_FNAME [static] |
Weka J48 model test performance details (counts) output file name.
Definition at line 356 of file haplo_test.c.
const char* weka_j48_details_pct_fname = WEKA_J48_DETAILS_PCT_FNAME [static] |
Weka J48 model test performance details (percents) output file name.
Definition at line 362 of file haplo_test.c.
const char* weka_j48_confusion_cnt_fname = WEKA_J48_CONFUSION_CNT_FNAME [static] |
Weka J48 model test confusion matrix output file name.
Definition at line 365 of file haplo_test.c.
const char* weka_j48_confusion_pct_fname = WEKA_J48_CONFUSION_PCT_FNAME [static] |
Weka J48 model test confusion matrix output file name.
Definition at line 368 of file haplo_test.c.
const char* weka_j48_preds_fname = WEKA_J48_PREDS_FNAME [static] |
Weka J48 model test prediction output file name.
Definition at line 371 of file haplo_test.c.
const char* weka_part_summary_fname = WEKA_PART_SUMMARY_FNAME [static] |
Weka PART model test performance summary output file name.
Definition at line 374 of file haplo_test.c.
const char* weka_part_details_cnt_fname = WEKA_PART_DETAILS_CNT_FNAME [static] |
Weka PART model test performance details (counts) output file name.
Definition at line 379 of file haplo_test.c.
const char* weka_part_details_pct_fname = WEKA_PART_DETAILS_PCT_FNAME [static] |
Weka PART model test performance details (percents) output file name.
Definition at line 385 of file haplo_test.c.
const char* weka_part_confusion_cnt_fname = WEKA_PART_CONFUSION_CNT_FNAME [static] |
Weka PART model test confusion matrix output file name.
Definition at line 388 of file haplo_test.c.
const char* weka_part_confusion_pct_fname = WEKA_PART_CONFUSION_PCT_FNAME [static] |
Weka PART model test confusion matrix output file name.
Definition at line 391 of file haplo_test.c.
const char* weka_part_preds_fname = WEKA_PART_PREDS_FNAME [static] |
Weka PART model test prediction output file name.
Definition at line 394 of file haplo_test.c.
const char* nearest_summary_fname = NEAREST_SUMMARY_FNAME [static] |
Nearest model test performance summary output file name.
Definition at line 397 of file haplo_test.c.
const char* nearest_details_cnt_fname = NEAREST_DETAILS_CNT_FNAME [static] |
Nearest model test performance details (counts) output file name.
Definition at line 402 of file haplo_test.c.
const char* nearest_details_pct_fname = NEAREST_DETAILS_PCT_FNAME [static] |
Nearest model test performance details (percents) output file name.
Definition at line 408 of file haplo_test.c.
const char* nearest_confusion_cnt_fname = NEAREST_CONFUSION_CNT_FNAME [static] |
Nearest model test confusion matrix output file name.
Definition at line 411 of file haplo_test.c.
const char* nearest_confusion_pct_fname = NEAREST_CONFUSION_PCT_FNAME [static] |
Nearest model test confusion matrix output file name.
Definition at line 414 of file haplo_test.c.
const char* nearest_preds_fname = NEAREST_PREDS_FNAME [static] |
Nearest model test prediction output file name.
Definition at line 417 of file haplo_test.c.
const char* tandem_agree_summary_fname = TANDEM_AGREE_SUMMARY_FNAME [static] |
Tandem agreement test performance summary output file name.
Definition at line 420 of file haplo_test.c.
const char* tandem_agree_details_cnt_fname = TANDEM_AGREE_DETAILS_CNT_FNAME [static] |
Tandem agreement test performance details (counts) output file name.
Definition at line 426 of file haplo_test.c.
const char* tandem_agree_details_pct_fname = TANDEM_AGREE_DETAILS_PCT_FNAME [static] |
Tandem agreement test performance details (percents) output file name.
Definition at line 432 of file haplo_test.c.
const char* tandem_summary_fname = TANDEM_SUMMARY_FNAME [static] |
Tandem test performance summary output file name.
Definition at line 435 of file haplo_test.c.
const char* tandem_details_cnt_fname = TANDEM_DETAILS_CNT_FNAME [static] |
Tandem test performance details (counts) output file name.
Definition at line 438 of file haplo_test.c.
const char* tandem_details_pct_fname = TANDEM_DETAILS_PCT_FNAME [static] |
Tandem test performance details (percents) output file name.
Definition at line 441 of file haplo_test.c.
const char* tandem_confusion_cnt_fname = TANDEM_CONFUSION_CNT_FNAME [static] |
Tandem test confusion matrix output file name.
Definition at line 444 of file haplo_test.c.
const char* tandem_confusion_pct_fname = TANDEM_CONFUSION_PCT_FNAME [static] |
Tandem test confusion matrix output file name.
Definition at line 447 of file haplo_test.c.
const char* tandem_preds_fname = TANDEM_PREDS_FNAME [static] |
Tandem test prediction output file name.
Definition at line 450 of file haplo_test.c.