Learn R Programming

uwot (version 0.1.2)

save_uwot: Save or Load a Model

Description

Functions to write a UMAP model to a file, and to restore.

Usage

save_uwot(model, file)

Arguments

model

a UMAP model create by umap.

file

name of the file where the model is to be saved or read from.

Examples

Run this code
# NOT RUN {
# create model
model <- umap(iris[1:100, ], ret_model = TRUE)

# save
model_file <- tempfile("iris_umap")
save_uwot(model, file = model_file)

# restore
model2 <- load_uwot(file = model_file)

identical(model, model2)

unlink(model_file)
# }

Run the code above in your browser using DataLab