Here is the code for using discrete wavelet transformation for data preprocessing by decomposing the input vector and use it for linear regression to predict ames housing sale prices
library(wavelets) library(waveslim) library(AmesHousing) ames <- as.data.frame(AmesHousing::make_ames()) x <- subset(ames, select = -Sale_Price) y <- ames$Sale_Price dwt(x)
An error pops up
x <- dwt(x)
Error in dwt(x) : 'list' object cannot be coerced to type 'double'