% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pipeline.R
\name{tl_get_best_model}
\alias{tl_get_best_model}
\title{Get the best model from a pipeline}
\usage{
tl_get_best_model(pipeline)
}
\arguments{
\item{pipeline}{A tidylearn pipeline object with results}
}
\value{
The best \code{tidylearn_model} object from the pipeline,
selected by the metric specified in \code{evaluation$best_metric}.
}
\description{
Get the best model from a pipeline
}
\examples{
\donttest{
pipe <- tl_pipeline(iris, Species ~ .,
  models = list(tree = list(method = "tree")),
  evaluation = list(metrics = "accuracy", validation = "cv",
    cv_folds = 2, best_metric = "accuracy"))
pipe <- tl_run_pipeline(pipe, verbose = FALSE)
best <- tl_get_best_model(pipe)
}
}
