fitness | R Documentation |
Retrieve the optimal fitness (or objective function) value used by an algorithm
fitness(object, ...)
## S3 method for class 'seg_basket'
fitness(object, ...)
## S3 method for class 'seg_cpt'
fitness(object, ...)
## S3 method for class 'tidycpt'
fitness(object, ...)
## S3 method for class 'ga'
fitness(object, ...)
## S3 method for class 'cpt'
fitness(object, ...)
## S3 method for class 'wbs'
fitness(object, ...)
object |
A |
... |
currently ignored |
Segmenting algorithms use a fitness metric, typically through the use of a penalized objective function, to determine which changepoint sets are more or less optimal. This function returns the value of that metric for the changepoint set implied by the object provided.
A named double
vector with the fitness value.
Other tidycpt-generics:
as.model()
,
as.segmenter()
,
changepoints()
,
diagnose()
,
model_name()
Other segmenter-functions:
as.segmenter()
,
model_args()
,
seg_params()
# Segment a times series using a genetic algorithm
x <- segment(DataCPSim, method = "ga", maxiter = 10)
# Retrieve its fitness value
fitness(x)
# Segment a time series using Wild Binary Segmentation
x <- segment(DataCPSim, method = "wbs")
# Retrive its fitness
fitness(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.