ml_write_to_bundle_transformed | R Documentation |
This functions serializes a Spark pipeline model into an MLeap bundle.
ml_write_to_bundle_transformed(x, transformed_dataset, path, overwrite = FALSE)
x |
A Spark ML Pipeline Model object. |
transformed_dataset |
A Spark data frame created by the ML Pipeline Model ( |
path |
Where to save the bundle. |
overwrite |
Whether to overwrite an existing file, defaults to |
## Not run: library(sparklyr) sc <- spark_connect(master = "local") mtcars_tbl <- copy_to(sc, mtcars, overwrite = TRUE) pipeline <- ml_pipeline(sc) %>% ft_binarizer("hp", "big_hp", threshold = 100) %>% ft_vector_assembler(c("big_hp", "wt", "qsec"), "features") %>% ml_gbt_regressor(label_col = "mpg") pipeline_model <- ml_fit(pipeline, mtcars_tbl) preds <- ml_transform(pipeline_model, mtcars_tbl) model_path <- file.path(tempdir(), "mtcars_model.zip") ml_write_bundle( x = pipeline_model, transformed_dataset = preds, path = model_path, overwrite = TRUE ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.