compute_features2: Compute Features for SVM

View source: R/artifact_detection.R

compute_features2R Documentation

Compute Features for SVM

Description

This function computes features for support vector machines (SVM) analysis. It processes input data, applies wavelet coefficients computation, and aggregates various statistical measures over defined time chunks. The function is designed to work with data frames containing electrodermal activity (EDA) data, filtered EDA, and timestamps.

Usage

compute_features2(data)

Arguments

data

A data frame with columns for electrodermal activity (eda), filtered electrodermal activity (filtered eda), and timestamps (DateTime). It is assumed that the data frame has already been preprocessed appropriately for feature computation.

Details

The function internally computes wavelet coefficients and then divides the data into chunks of specified durations (1 second, 0.5 seconds, and a custom duration based on amplitude features). For each chunk, it calculates various statistical measures. The resulting data frame includes timestamps and the computed features, which can be used for further analysis or as input to machine learning models like SVM.

Value

A data frame with computed features. Each row corresponds to a time chunk, and columns include statistical measures (like maximum, mean, standard deviation, median, and sum of positive values) of wavelet coefficients computed over different intervals (1 second, 0.5 seconds, and based on amplitude features).

Examples

## Not run: 
# Assuming 'my_data' is a preprocessed data frame with the necessary columns
features <- compute_features2(my_data)

## End(Not run)

PCdLf/wearables documentation built on Nov. 19, 2024, 5:57 p.m.