% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/predict.R
\name{load_prediction}
\alias{load_prediction}
\title{Read states from h5 file}
\usage{
load_prediction(
h5_path,
rows = NULL,
verbose = FALSE,
get_sample_position = FALSE,
get_seq = FALSE
)
}
\arguments{
\item{h5_path}{Path to h5 file.}
\item{rows}{Range of rows to read. If \code{NULL} read everything.}
\item{verbose}{Boolean.}
\item{get_sample_position}{Return position of sample corresponding to state if \code{TRUE}.}
\item{get_seq}{Return nucleotide sequence if \code{TRUE}.}
}
\value{
A list of data frames, containing model predictions and sequence positions.
}
\description{
Reads h5 file created by \code{\link{predict_model}} function.
}
\examples{
\dontshow{if (reticulate::py_module_available("tensorflow")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
# make prediction for single sequence and write to h5 file
model <- create_model_lstm_cnn(maxlen = 20, layer_lstm = 8, layer_dense = 2, verbose = FALSE)
vocabulary <- c("a", "c", "g", "t")
sequence <- paste(sample(vocabulary, 200, replace = TRUE), collapse = "")
output_file <- tempfile(fileext = ".h5")
predict_model(output_format = "one_seq", model = model, step = 10,
sequence = sequence, filename = output_file, mode = "label")
load_prediction(h5_path = output_file)
\dontshow{\}) # examplesIf}
}