Retrieve the name of the model that a segmenter or model used
Retrieve the name of the model that a segmenter or model used
model_name(object,...)## Default S3 method:model_name(object,...)## S3 method for class 'character'model_name(object,...)## S3 method for class 'mod_cpt'model_name(object,...)## S3 method for class 'seg_basket'model_name(object,...)## S3 method for class 'seg_cpt'model_name(object,...)## S3 method for class 'tidycpt'model_name(object,...)## S3 method for class 'ga'model_name(object,...)## S3 method for class 'cpt'model_name(object,...)## S3 method for class 'wbs'model_name(object,...)
Arguments
object: A segmenter object.
...: currently ignored
Returns
A character vector of length 1.
Details
Every segmenter works by fitting a model to the data. model_name() returns the name of a model that can be passed to whomademe() to retrieve the model fitting function. These functions must begin with the prefix fit_. Note that the model fitting functions exist in tidychangepoint are are not necessarily the actual functions used by the segmenter.
Models also implement model_name().
Examples
# Segment a time series using PELTx <- segment(CET, method ="pelt")# Retrieve the name of the model from the segmenterx |> as.segmenter()|> model_name()# What function created the model? x |> model_name()|> whomademe()model_name(x$segmenter)# Retrieve the name of the model from the modelx |> as.model()|> model_name()
See Also
Other model-fitting: fit_lmshift(), fit_meanshift(), fit_meanvar(), fit_nhpp(), model_args(), new_fun_cpt(), whomademe()
Other tidycpt-generics: as.model(), as.segmenter(), changepoints(), diagnose(), fitness()