Learn R Programming

tidychangepoint (version 1.0.0)

model_name: 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, ...)

# S3 method for default model_name(object, ...)

# S3 method for character model_name(object, ...)

# S3 method for mod_cpt model_name(object, ...)

# S3 method for seg_basket model_name(object, ...)

# S3 method for seg_cpt model_name(object, ...)

# S3 method for tidycpt model_name(object, ...)

# S3 method for ga model_name(object, ...)

# S3 method for cpt model_name(object, ...)

# S3 method for wbs model_name(object, ...)

Value

A character vector of length 1.

Arguments

object

A segmenter object.

...

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().

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()

Examples

Run this code
# 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()
  

Run the code above in your browser using DataLab