model_name {tidychangepoint} | R Documentation |
Retrieve the name of the model that a segmenter or model used
Description
Retrieve the name of the model that a segmenter or model used
Usage
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 'cga'
model_name(object, ...)
## S3 method for class 'segmented'
model_name(object, ...)
## S3 method for class 'wbs'
model_name(object, ...)
Arguments
object |
A |
... |
currently ignored |
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()
.
Value
A character
vector of length 1.
See Also
Other model-fitting:
fit_arima()
,
fit_lmshift()
,
fit_meanshift()
,
fit_meanvar()
,
fit_nhpp()
,
model_args()
,
new_fun_cpt()
,
whomademe()
Other tidycpt-generics:
as.model()
,
as.segmenter()
,
changepoints()
,
diagnose()
,
fitness()
Examples
# Segment a time series using PELT
x <- segment(CET, method = "pelt")
# Retrieve the name of the model from the segmenter
x |>
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 model
x |>
as.model() |>
model_name()
[Package tidychangepoint version 1.0.1 Index]