Description Usage Arguments Value Examples
Wrapper for putting a single function into a pipeline
1 | pipe_function(train, f, ...)
|
train |
Data frame containing the train data. |
f |
The function to be put into the pipeline. It is important that the function can be applied to new datasets without using any information from the train dataset, e.g. lowercasing column names.
It should take a |
... |
Additional arguments to be provided to |
A list of the transformed train dataset and a .predict function to be used on new data.
1 2 3 4 5 6 7 8 9 10 11 12 | data <- dplyr::data_frame(var = 0, Var = 0, camelCase = 0, good_name = 0,
`0none.` = 0, `bad ` = 0, `j&d` = 0, `spac ed` = 0)
pipe_function(data, standard_column_names)
# You can also use this to append a custom model to the pipeline
data <- dplyr::data_frame(x = 1:10, y = (1:10) + rnorm(10))
model <- lm(y ~ x, data)
self_contained_function <- function(data) predict(model, data)
model_pipe <- pipe_function(data, self_contained_function)
predictions <- invoke(model_pipe$pipe, data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.