read_best | R Documentation |
This function reads the contents of the the ‘BestParameterSet.txt’ output file, which stores the best parameter set and its corresponding goodness-of-fit value found during the optimisation
read_best(file="BestParameterSet.txt", verbose=TRUE)
file |
character, name (including path) of the output file with the best parameter set and its corresponding best fitness value found during the optimisation |
verbose |
logical, if TRUE, progress messages are printed |
Mauricio Zambrano-Bigiarini, mzb.devel@gmail.com
read_results
, plot_results
## Not run:
# Setting the user home directory as working directory
setwd("~")
# Number of dimensions to be optimised
D <- 4
# Boundaries of the search space (Sphere test function)
lower <- rep(-100, D)
upper <- rep(100, D)
# Setting the seed
set.seed(100)
# Runing PSO with the 'Sphere' test function, writting the results to text files
hydroPSO(fn=sphere, lower=lower, upper=upper,
control=list(maxit=100, write2disk=TRUE, plot=TRUE) )
# Reading the best parameter set and its corresponsing gof found by hydroPSO
setwd("PSO.out")
read_best()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.