Skip to contents

# Compute features on an input time series dataset

Source: `R/calculate_features.R`
`calculate_features.Rd`

Compute features on an input time series dataset

## Usage

    calculate_features(
      data,
      id_var = NULL,
      time_var = NULL,
      values_var = NULL,
      group_var = NULL,
      feature_set = c("catch22", "feasts", "tsfeatures", "Kats", "tsfresh", "TSFEL"),
      catch24 = FALSE,
      tsfresh_cleanup = FALSE,
      seed = 123
    )

## Arguments

data

  a dataframe with at least 4 columns: id variable, group variable, time variable, value variable

id_var

  a string specifying the ID variable to identify each time series. Defaults to `NULL`

time_var

  a string specifying the time index variable. Defaults to `NULL`

values_var

  a string specifying the values variable. Defaults to `NULL`

group_var

  a string specifying the grouping variable that each unique series sits under (if one exists). Defaults to `NULL`

feature_set

  the set of time-series features to calculate. Defaults to `catch22`

catch24

  a Boolean specifying whether to compute `catch24` in addition to `catch22` if `catch22` is one of the feature sets selected. Defaults to `FALSE`

tsfresh_cleanup

  a Boolean specifying whether to use the in-built `tsfresh` relevant feature filter or not. Defaults to `FALSE`

seed

  fixed number for R's random number generator to ensure reproducibility

## Value

object of class dataframe that contains the summary statistics for each feature

## Author

Trent Henderson

## Examples

    featMat <- calculate_features(data = simData,
      id_var = "id",
      time_var = "timepoint",
      values_var = "values",
      group_var = "process",
      feature_set = "catch22",
      seed = 123)
    #> No IDs removed. All value vectors good for feature extraction.
    #> Running computations for catch22...
    #> Warning: As of 0.1.14 the feature 'CO_f1ecac' returns a double instead of int
    #> This warning is displayed once per session.
    #>
    #> Calculations completed for catch22.