Skip to content

Commit 285a367

Browse files
committed
added: code to save R objects with model tuning and fit results
1 parent 21af1c8 commit 285a367

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

r_scripts/penalised_regression/lasso_upsampling.R

+7-1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,12 @@ preds = final_lasso_fit %>%
178178
cor(preds$.pred, preds$score_intensity)
179179
sqrt(sum((preds$score_intensity-preds$.pred)^2)/nrow(preds))
180180

181-
ggplot(data = preds, aes(.pred, score_intensity)) + geom_point()
181+
ggplot(data = preds, aes(.pred, av_pain_intensity)) + geom_point() |>
182+
ggsave("correlation.png", device = "png")
183+
184+
185+
writeLines(" - saving out model fit results")
186+
to_save = list(lasso_grid, best_ccc, final_lasso, lr_res, final_lasso_fit)
187+
save(to_save, file = outfile)
182188

183189
print("DONE!")

0 commit comments

Comments
 (0)