standardizeFeatures {communication}R Documentation

Title

Description

Title

Usage

standardizeFeatures(Xs, feature_means = NULL, feature_sds = NULL, verbose = 1)

Arguments

Xs

Data

feature_means

Numeric vector corresponding to columns of elements in Xs

feature_sds

Numeric vector corresponding to columns of elements in Xs. If not supplied, will be computed from Xs.

verbose

Verbose printing

Details

feature_means and feature_sds are provided to allow alignment of new datasets. For example, after a model is trained, new data for prediction must be transformed in the same way as the training data to ensure predictions are valid. If either is NULL, both will be computed from Xs and the output will be internally standardized (i.e., columns of do.call(rbind, standardizeFeatures(Xs)) will be have a mean of 0 and a standard deviation of 1).

Value

Standardizes 'data' of objects of class 'preppedAudio'. Maintains structure of original object otherwise. Is used to standardize data where the recording environment systematically shifts audio features.

Examples

data('audio')
audio$data <- standardizeFeatures(
    lapply(audio$data, function(x) na.omit(x))
)


[Package communication version 0.1 Index]