et.seed(8818)
## load data
`๐ทs` <- readRDS("labels.rds")
`โนโ๏ธgs_๐
ฐ๏ธrr` <- readRDS("imgs_arr.rds")
`t๐ช๐ธt_๐โs` <- sample(seq_len(nrow(`๐ทs`)), round(nrow(`โนโ๏ธgs_๐
ฐ๏ธrr`) * .2))
`โ_๐` <- `โนโ๏ธgs_๐
ฐ๏ธrr`[-`t๐ช๐ธt_๐โs`, , , ]
`y_๐` <- `๐ทs`[-`t๐ช๐ธt_๐โs`, "Category"]
`โ_t๐ช๐ธt` <- `โนโ๏ธgs_๐
ฐ๏ธrr`[`t๐ช๐ธt_๐โs`, , , ]
`y_t๐ช๐ธt` <- `๐ทs`[`t๐ช๐ธt_๐โs`, "Category"]
dim(`โ_๐`)
head(`y_๐`)
## fit autokeras model
# Create an image classifier, and train for one hour
`๐f` <- model_image_classifier(verbose = TRUE, augment = FALSE) %>%
fit(`โ_๐`, `y_๐`, time_limit = 1 * 60 * 60)
# Evaluate
`๐f` %>% evaluate(`โ_t๐ช๐ธt`, `y_t๐ช๐ธt`)
# Re-train the best trained model with all the available data
`๐f` %>%
final_fit(
`โ_๐`, `y_๐`, `โ_t๐ช๐ธt`, `y_t๐ช๐ธt`,
retrain = TRUE, time_limit = 20 * 60
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.