Haplo Prediction
predict haplogroups
|
Weka J48 and PART classifiers. More...
#include <config.h>
#include <stdlib.h>
#include <inttypes.h>
#include <jwsc/base/error.h>
#include <jwsc/vector/vector.h>
#include <jwsc/matrix/matrix.h>
Go to the source code of this file.
Data Structures | |
struct | Weka_model_node |
Weka model tree node. More... | |
Typedefs | |
typedef struct Weka_model_node | Weka_model_node |
Weka model tree node. | |
typedef Weka_model_node | Weka_model_tree |
Weka model tree. | |
Functions | |
Error * | train_weka_j48_model (const Vector_u32 *labels, const Matrix_i32 *markers, const char *labels_fname, const char *model_fname, const char *weka_jar_fname) |
Trains a Weka J48 model and writes it to a file. | |
Error * | train_weka_part_model (const Vector_u32 *labels, const Matrix_i32 *markers, const char *labels_fname, const char *model_fname, const char *weka_jar_fname) |
Trains a Weka PART model and writes it to a file. | |
Error * | predict_labels_with_weka_j48_model (Vector_u32 **labels_out, Vector_d **confs_out, const Matrix_i32 *markers, const char *labels_fname, const char *model_fname, const char *weka_jar_fname) |
Predicts the labels for a set of marker samples using Weka's J48 classifier. | |
Error * | predict_labels_with_weka_part_model (Vector_u32 **labels_out, Vector_d **confs_out, const Matrix_i32 *markers, const char *labels_fname, const char *model_fname, const char *weka_jar_fname) |
Predicts the labels for a set of marker samples using Weka's PART classifier. | |
Error * | train_weka_j48_model_tree (Weka_model_tree **tree_out, const Vector_u32 *labels, const Matrix_i32 *markers, const char *tree_xml_fname, const char *tree_dtd_fname, const char *model_dirname, const char *weka_jar_fname) |
Trains a Weka J48 model tree . | |
Error * | train_weka_part_model_tree (Weka_model_tree **tree_out, const Vector_u32 *labels, const Matrix_i32 *markers, const char *tree_xml_fname, const char *tree_dtd_fname, const char *model_dirname, const char *weka_jar_fname) |
Trains a Weka PART model tree . | |
Error * | predict_labels_with_weka_j48_model_tree (Vector_u32 **labels_out, Vector_d **confidence_out, const Matrix_i32 *markers, const Weka_model_tree *tree, const char *weka_jar_fname) |
Predicts the labels for a set of marker samples using a Weka J48 model tree. | |
Error * | predict_labels_with_weka_part_model_tree (Vector_u32 **labels_out, Vector_d **confidence_out, const Matrix_i32 *markers, const Weka_model_tree *tree, const char *weka_jar_fname) |
Predicts the labels for a set of marker samples using a Weka PART model tree. | |
Error * | read_weka_model_tree (Weka_model_tree **tree_out, const char *tree_xml_fname, const char *tree_dtd_fname, const char *model_dirname) |
Reads a Weka model tree. | |
void | free_weka_model_tree (Weka_model_tree *tree) |
Frees a Weka model tree. |
typedef struct Weka_model_node Weka_model_node |
Weka model tree node.
typedef Weka_model_node Weka_model_tree |
Error* train_weka_j48_model | ( | const Vector_u32 * | labels, |
const Matrix_i32 * | markers, | ||
const char * | labels_fname, | ||
const char * | model_fname, | ||
const char * | weka_jar_fname | ||
) |
Trains a Weka J48 model and writes it to a file.
labels | Labels for training, with ith element as corresponding to the ith sample in markers. |
markers | Markers for training, with ith row as a sample corresponding to the ith label in labels. |
labels_fname | File name containing labels for groups in the model. |
model_fname | File name containing the model. |
weka_jar_fname | Weka java archive file. |
Error* train_weka_part_model | ( | const Vector_u32 * | labels, |
const Matrix_i32 * | markers, | ||
const char * | labels_fname, | ||
const char * | model_fname, | ||
const char * | weka_jar_fname | ||
) |
Trains a Weka PART model and writes it to a file.
labels | Labels for training, with ith element as corresponding to the ith sample in markers. |
markers | Markers for training, with ith row as a sample corresponding to the ith label in labels. |
labels_fname | File name containing labels for groups in the model. |
model_fname | File name containing the model. |
weka_jar_fname | Weka java archive file. |
Error* predict_labels_with_weka_j48_model | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
const Matrix_i32 * | markers, | ||
const char * | labels_fname, | ||
const char * | model_fname, | ||
const char * | weka_jar_fname | ||
) |
Predicts the labels for a set of marker samples using Weka's J48 classifier.
labels_out | Result parameter. |
confs_out | Result parameter. |
markers | Marker data to predict. |
labels_fname | File name containing labels used by the model. |
model_fname | File name containing the model. |
weka_jar_fname | Weka java archive file. |
Error* predict_labels_with_weka_part_model | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
const Matrix_i32 * | markers, | ||
const char * | labels_fname, | ||
const char * | model_fname, | ||
const char * | weka_jar_fname | ||
) |
Predicts the labels for a set of marker samples using Weka's PART classifier.
labels_out | Result parameter. |
confs_out | Result parameter. |
markers | Marker data to predict. |
labels_fname | File name containing labels used by the model. |
model_fname | File name containing the model. |
weka_jar_fname | Weka java archive file. |
Error* train_weka_j48_model_tree | ( | Weka_model_tree ** | tree_out, |
const Vector_u32 * | labels, | ||
const Matrix_i32 * | markers, | ||
const char * | tree_xml_fname, | ||
const char * | tree_dtd_fname, | ||
const char * | model_dirname, | ||
const char * | weka_jar_fname | ||
) |
Trains a Weka J48 model tree .
tree_out | Result parameter. |
labels | Sample group labels. |
markers | Sample marker values. |
tree_xml_fname | XML file containing the model tree information. |
tree_dtd_fname | DTD file for validating the XML file, can be NULL. |
model_dirname | Model directory location. |
weka_jar_fname | Weka java archive file. |
Error* train_weka_part_model_tree | ( | Weka_model_tree ** | tree_out, |
const Vector_u32 * | labels, | ||
const Matrix_i32 * | markers, | ||
const char * | tree_xml_fname, | ||
const char * | tree_dtd_fname, | ||
const char * | model_dirname, | ||
const char * | weka_jar_fname | ||
) |
Trains a Weka PART model tree .
tree_out | Result parameter. |
labels | Sample group labels. |
markers | Sample marker values. |
tree_xml_fname | XML file containing the model tree information. |
tree_dtd_fname | DTD file for validating the XML file, can be NULL. |
model_dirname | Model directory location. |
weka_jar_fname | Weka java archive file. |
Error* predict_labels_with_weka_j48_model_tree | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
const Matrix_i32 * | markers, | ||
const Weka_model_tree * | tree, | ||
const char * | weka_jar_fname | ||
) |
Predicts the labels for a set of marker samples using a Weka J48 model tree.
labels_out | Result parameter. If *labels_out is NULL, it is allocated; otherwise its space is re-used. |
confs_out | Result parameter. If *confs_out is NULL, it is allocated; otherwise its space is re-used. |
markers | Marker data to predict. Each row is a sample for prediction, corresponding to an element in the result parameters. |
tree | Trained model tree to use for predicting. |
weka_jar_fname | Weka java archive file. |
Error* predict_labels_with_weka_part_model_tree | ( | Vector_u32 ** | labels_out, |
Vector_d ** | confs_out, | ||
const Matrix_i32 * | markers, | ||
const Weka_model_tree * | tree, | ||
const char * | weka_jar_fname | ||
) |
Predicts the labels for a set of marker samples using a Weka PART model tree.
labels_out | Result parameter. If *labels_out is NULL, it is allocated; otherwise its space is re-used. |
confs_out | Result parameter. If *confs_out is NULL, it is allocated; otherwise its space is re-used. |
markers | Marker data to predict. Each row is a sample for prediction, corresponding to an element in the result parameters. |
tree | Trained model tree to use for predicting. |
weka_jar_fname | Weka java archive file. |
Error* read_weka_model_tree | ( | Weka_model_tree ** | tree_out, |
const char * | tree_xml_fname, | ||
const char * | tree_dtd_fname, | ||
const char * | model_dirname | ||
) |
void free_weka_model_tree | ( | Weka_model_tree * | tree | ) |