kitchen_sink | R Documentation |
This function projects data with Convolutional Kitchen Sinks. It matrix multiplies data with a normal matrix that must be provided, clamping the negative results to 0, and then averaging across windows. Feature count and window size are determined by the column and row numbers of the provided normal matrix respectively.
kitchen_sink(
data,
norm,
FUN = clamp,
ncores = 1,
write_progress = FALSE,
which_rows = NULL,
...
)
data |
The data to be projected. Should not include the variable to be modeled by the kitchen sink. |
norm |
A normal matrix of dimensions c(window size, feature count).
Can be generated using |
FUN |
A function to be used for nonlinearization of the normalized data.
The default, |
ncores |
How many cores to use for the kitchen sink. Allows for parallelization in large datasets. |
write_progress |
Write files for each row calculated. May be helpful for breaking up large calculations. |
which_rows |
Specify rows to calculate for. Along with write_progress, may be helpful for breaking up large calculations. |
... |
Arguments to be passed to FUN, like a bias term. |
Returns a matrix of nonlinearized counterparts to the original rows of the provided data. Column length is equal to the number of features, as determined by the provided normal matrix. #'
Avery Kruger
make_norms
()
clamp
x <- matrix(sample(1:10,500,TRUE),100,5)
y <- x[,1]*x[,2]^2-0.5*x[,3]*x[,4]+x[,5]*x[,1]
mynorm <- make_norms(64,5)[[1]][[1]]
nonlinx <- kitchen_sink(x, mynorm, bias=0.1)
summary(lm(y ~ nonlinx))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.