evaluate_model | R Documentation |
Returns evaluation metric like confusion matrix, loss, AUC, AUPRC, MAE, MSE (depending on output layer).
evaluate_model(
path_input,
model = NULL,
batch_size = 100,
step = 1,
padding = FALSE,
vocabulary = c("a", "c", "g", "t"),
vocabulary_label = list(c("a", "c", "g", "t")),
number_batches = 10,
format = "fasta",
target_middle = FALSE,
mode = "lm",
output_format = "target_right",
ambiguous_nuc = "zero",
evaluate_all_files = FALSE,
verbose = TRUE,
max_iter = 20000,
target_from_csv = NULL,
max_samples = NULL,
proportion_per_seq = NULL,
concat_seq = NULL,
seed = 1234,
auc = FALSE,
auprc = FALSE,
path_pred_list = NULL,
exact_num_samples = NULL,
activations = NULL,
shuffle_file_order = FALSE,
include_seq = FALSE,
...
)
path_input |
Input directory where fasta, fastq or rds files are located. |
model |
A keras model. |
batch_size |
Number of samples per batch. |
step |
How often to take a sample. |
padding |
Whether to pad sequences too short for one sample with zeros. |
vocabulary |
Vector of allowed characters. Character outside vocabulary get encoded as specified in ambiguous_nuc. |
vocabulary_label |
List of labels for targets of each output layer. |
number_batches |
How many batches to evaluate. |
format |
File format, |
target_middle |
Whether model is language model with separate input layers. |
mode |
Either |
output_format |
Determines shape of output tensor for language model.
Either
|
ambiguous_nuc |
How to handle nucleotides outside vocabulary, either
|
evaluate_all_files |
Boolean, if |
verbose |
Boolean. |
max_iter |
Stop after |
target_from_csv |
Path to csv file with target mapping. One column should be called "file" and other entries in row are the targets. |
max_samples |
Maximum number of samples to use from one file. If not |
proportion_per_seq |
Numerical value between 0 and 1. Proportion of sequence to take samples from (use random subsequence). |
concat_seq |
Character string or |
seed |
Sets seed for |
auc |
Whether to include AUC metric. If output layer activation is |
auprc |
Whether to include AUPRC metric. If output layer activation is |
path_pred_list |
Path to store list of predictions (output of output layers) and corresponding true labels as rds file. |
exact_num_samples |
Exact number of samples to evaluate. If you want to evaluate a number of samples not divisible by batch_size. Useful if you want
to evaluate a data set exactly ones and know the number of samples already. Should be a vector if |
activations |
List containing output formats for output layers ( |
shuffle_file_order |
Logical, whether to go through files randomly or sequentially. |
include_seq |
Whether to store input. Only applies if |
... |
Further generator options. See |
A list of evaluation results. Each list element corresponds to an output layer of the model.
# create dummy data
path_input <- tempfile()
dir.create(path_input)
create_dummy_data(file_path = path_input,
num_files = 3,
seq_length = 11,
num_seq = 5,
vocabulary = c("a", "c", "g", "t"))
# create model
model <- create_model_lstm_cnn(layer_lstm = 8, layer_dense = 4, maxlen = 10, verbose = FALSE)
# evaluate
evaluate_model(path_input = path_input,
model = model,
step = 11,
vocabulary = c("a", "c", "g", "t"),
vocabulary_label = list(c("a", "c", "g", "t")),
mode = "lm",
output_format = "target_right",
evaluate_all_files = TRUE,
verbose = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.