Large scale machine learning projects with r suite
-
Upload
wit-jakuczun -
Category
Data & Analytics
-
view
84 -
download
1
Transcript of Large scale machine learning projects with r suite
![Page 2: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/2.jpg)
![Page 4: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/4.jpg)
![Page 5: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/5.jpg)
![Page 6: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/6.jpg)
![Page 7: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/7.jpg)
![Page 8: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/8.jpg)
![Page 9: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/9.jpg)
![Page 10: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/10.jpg)
![Page 12: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/12.jpg)
![Page 13: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/13.jpg)
![Page 14: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/14.jpg)
![Page 15: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/15.jpg)
![Page 16: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/16.jpg)
![Page 17: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/17.jpg)
Rscript R/master.R \--port=7137
![Page 18: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/18.jpg)
![Page 19: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/19.jpg)
![Page 20: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/20.jpg)
![Page 21: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/21.jpg)
![Page 22: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/22.jpg)
●
○○
![Page 23: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/23.jpg)
![Page 24: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/24.jpg)
![Page 25: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/25.jpg)
![Page 26: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/26.jpg)
![Page 27: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/27.jpg)
![Page 31: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/31.jpg)
> rsuite install Detecting repositories ... Will use repositories: CRAN.CRAN = https://mran.microsoft.com/snapshot/2017-10-15 CRAN.CRANextra = http://www.stats.ox.ac.uk/pub/RWin Other = http://wlog-rsuite.s3.amazonaws.com Installing RSuite(v0.17x) package ... installing the source package 'RSuite' All done.
![Page 33: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/33.jpg)
> rsuite proj start -n spmf
![Page 34: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/34.jpg)
Commands: update Checks if newest version of RSuite CLI is installed. If not installer for newest version is downloaded and installation is initiated. install Install RSuite with all the dependencies. proj Use it to manage project, its dependencies, and build project packages. repo Use to manage repositories. e.g. upload packages. pkgzip Use to create PKGZIP packages to fillup remove repository. version Show RSuite CLI version. help Show this message and exit. Call 'rsuite [command] help' to get information on acceptable [args].
![Page 35: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/35.jpg)
![Page 36: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/36.jpg)
![Page 37: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/37.jpg)
![Page 38: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/38.jpg)
![Page 39: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/39.jpg)
![Page 40: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/40.jpg)
![Page 41: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/41.jpg)
![Page 42: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/42.jpg)
![Page 43: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/43.jpg)
![Page 44: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/44.jpg)
![Page 45: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/45.jpg)
![Page 46: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/46.jpg)
![Page 47: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/47.jpg)
![Page 48: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/48.jpg)
![Page 49: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/49.jpg)
logs/.gitignore
![Page 50: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/50.jpg)
![Page 51: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/51.jpg)
![Page 52: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/52.jpg)
![Page 53: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/53.jpg)
![Page 54: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/54.jpg)
![Page 55: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/55.jpg)
![Page 56: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/56.jpg)
![Page 57: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/57.jpg)
PARAMETERS
●
●●
○○○○
●
![Page 58: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/58.jpg)
●●●
LogLevel: INFON_days: 365solver_max_iterations: 10solver_opt_horizon: 8
![Page 59: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/59.jpg)
![Page 60: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/60.jpg)
●●
○ main○ if __name__ == "__main__":
![Page 61: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/61.jpg)
![Page 62: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/62.jpg)
![Page 63: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/63.jpg)
![Page 64: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/64.jpg)
![Page 65: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/65.jpg)
![Page 66: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/66.jpg)
predmodel
![Page 67: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/67.jpg)
![Page 68: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/68.jpg)
● ==● >=● <=
●
![Page 69: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/69.jpg)
master.R
![Page 70: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/70.jpg)
![Page 71: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/71.jpg)
spmf/libs
![Page 72: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/72.jpg)
packages_import.R
![Page 73: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/73.jpg)
master.R
![Page 74: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/74.jpg)
![Page 75: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/75.jpg)
![Page 76: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/76.jpg)
![Page 77: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/77.jpg)
import_training.R (I)
● import/<session_id>/● work/<session_id>/
library(predmodel)
import_path <- file.path(script_path, "../import")work_path <- file.path(script_path, "../work")
# requiredsession_id <- args$get(name = "session_id", default = "201711122000", required = FALSE)
loginfo("--> Session id:%s", session_id)
session_work <- file.path(work_path, session_id)
if(!dir.exists(session_work)) { dir.create(session_work)}
import_training_data(file.path(import_path, session_id), session_work)
![Page 78: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/78.jpg)
import_training.R (II)
![Page 79: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/79.jpg)
![Page 80: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/80.jpg)
devtools
![Page 81: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/81.jpg)
import_training_data
#' @exportimport_training_data <- function(import_path, work_path) { pkg_loginfo("Importing from %s into %s", import_path, work_path)
n <- 10000 dt <- data.table(feature1 = rnorm(n), feature2 = rnorm(n)) m <- round(n*0.3) dt[, resp := c(rep(1, m), rep(0, n - m))] fwrite(x = dt, file = file.path(work_path, "training.csv"), sep = ";")}
![Page 82: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/82.jpg)
![Page 83: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/83.jpg)
![Page 84: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/84.jpg)
estimate_model.R (I)
●●library(predmodel)
work_path <- file.path(script_path, "../work")# requiredsession_id <- args$get(name = "session_id", required = FALSE, default = "201710111655")loginfo("--> Session id:%s", session_id)session_work <- file.path(work_path, session_id)
h2o.init(max_mem_size = "4g", nthreads = 2)
logdebug("---> H2O started")
train_file <- file.path(session_work, "training.csv")
stopifnot(file.exists(train_file))
train_file %>% transform_training() %>% estimate_model(session_id) %>% save_model(session_work)
![Page 85: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/85.jpg)
transform_training
#' @exporttransform_training <- function(train_file) { dt <- h2o.importFile(path = train_file, destination_frame = "train_dt", parse = TRUE, header = TRUE, sep = ";") dt$resp <- as.factor(dt$resp) dt <- h2o.assign(data=dt, key = "train_dt")
return(dt)}
![Page 86: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/86.jpg)
estimate_model
#'@exportestimate_model <- function(dt, session_id) { model <- h2o.gbm(x = colnames(dt), y = "resp", training_frame = dt, model_id = sprintf("gbm_%s", session_id), ntrees = 10, learn_rate = 0.1)}
![Page 87: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/87.jpg)
save_model
#' @exportsave_model <- function(model, session_work) { h2o.saveModel(model, path = session_work, force =TRUE)}
![Page 88: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/88.jpg)
![Page 89: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/89.jpg)
![Page 90: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/90.jpg)
import_test.R (I)
● import/<session_id>/● work/<session_id>/
library(predmodel)
import_path <- file.path(script_path, "../import")work_path <- file.path(script_path, "../work")
# requiredsession_id <- args$get(name = "session_id", default = "201711122000", required = FALSE)
loginfo("--> Session id:%s", session_id)
session_work <- file.path(work_path, session_id)
if(!dir.exists(session_work)) { dir.create(session_work)}
import_test_data(file.path(import_path, session_id), session_work)
![Page 91: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/91.jpg)
import_test_data
#' @exportimport_test_data <- function(import_path, work_path) { pkg_loginfo("Importing from %s into %s", import_path, work_path)
n <- 1000 dt <- data.table(feature1 = rnorm(n), feature2 = rnorm(n)) fwrite(x = dt, file = file.path(work_path, "test.csv"), sep = ";")}
![Page 92: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/92.jpg)
![Page 93: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/93.jpg)
![Page 94: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/94.jpg)
score_model.R (I)
● work/<score_session_id>● work/<train_session_id>● export/<score_session_id>
![Page 95: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/95.jpg)
score_model.R (II)
library(h2o)library(magrittr)library(predmodel)
work_path <- file.path(script_path, "../work")export_path <- file.path(script_path, "../export")
# requiredtrain_session_id <- args$get(name = "train_session_id", required = FALSE, default = "201710111655")score_session_id <- args$get(name = "score_session_id", required = FALSE, default = "201710111655")
loginfo("--> train session id:%s", train_session_id)loginfo("--> score session id:%s", score_session_id)
score_session_export <- export_pathtrain_session_work <- file.path(work_path, train_session_id)score_session_work <- file.path(work_path, score_session_id)
h2o.init(max_mem_size = "4g", nthreads = 2)
logdebug("---> H2O started")
test_file <- file.path(score_session_work, "test.csv")model_file <- file.path(train_session_work, sprintf("gbm_%s", train_session_id))
stopifnot(file.exists(test_file))stopifnot(file.exists(model_file))
test_dt <- test_file %>% transform_test()
score_model(test_dt = test_dt, model_path = model_file) %>% export_score(export_path = export_path, score_session_id = score_session_id)
![Page 96: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/96.jpg)
transform_test
#' @exporttransform_test <- function(test_file) { h2o.importFile(path = test_file, destination_frame = "test_dt", parse = TRUE, header = TRUE, sep = ";")}
![Page 97: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/97.jpg)
score_model
#' @exportscore_model <- function(test_dt, model_path) { model <- h2o.loadModel(model_path) pred_dt <- h2o.predict(model, test_dt) pred_dt}
![Page 98: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/98.jpg)
export_score
#' @exportexport_score <- function(score_dt, score_session_id, export_path) { score_dt <- as.data.table(score_dt) score_dt[, score_session_id := score_session_id] fwrite(x = score_dt, file = file.path(export_path, "score.csv"), sep = ";", append = TRUE)}
![Page 99: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/99.jpg)
![Page 100: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/100.jpg)
![Page 101: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/101.jpg)
![Page 102: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/102.jpg)
![Page 103: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/103.jpg)
![Page 104: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/104.jpg)
![Page 105: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/105.jpg)
Productionspmf_0.1_001.zipProduction/spmf import export
work
![Page 106: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/106.jpg)
Production/spmf/R
a. Rscript import_training.Rb. Rscript estimate_model.Rc. Rscript import_test.Rd. Rscript score_model.R
Production/spmf/export
![Page 107: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/107.jpg)
![Page 108: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/108.jpg)
![Page 109: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/109.jpg)
![Page 110: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/110.jpg)
loginfo("Phase 1 passed")
logdebug("Iter %d done", i)
logtrace("Iter %d done", i)
logwarning("Are you sure?")
logerror("I failed :(")
Packages
pkg_loginfo("Phase 1 passed")
pkg_logdebug("Iter %d done", i)
pkg_logtrace("Iter %d done", i)
pkg_logwarning("Are you sure?")
pkg_logerror("I failed :(")
![Page 111: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/111.jpg)
2017-11-13 13:47:03 INFO::--> Session id:201711122000
2017-11-13 13:47:03 INFO:predmodel:Importing from C:/Workplace/Sandbox/Production/spmf/R/../import/201711122000 into C:/Workplace/Sandbox/Production/spmf/R/../work/201711122000
2017-11-13 13:47:14 INFO::--> Session id:201711122000
2017-11-13 13:47:51 INFO::--> Session id:201711131000
2017-11-13 13:47:51 INFO:predmodel:Importing from C:/Workplace/Sandbox/Production/spmf/R/../import/201711131000 into C:/Workplace/Sandbox/Production/spmf/R/../work/201711131000
2017-11-13 13:47:57 INFO::--> train session id:201711122000
2017-11-13 13:47:57 INFO::--> score session id:201711131000
![Page 112: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/112.jpg)
LogLevel: INFO
LogLevel: DEBUG
LogLevel: TRACE
![Page 113: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/113.jpg)
import_training.R
![Page 114: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/114.jpg)
![Page 115: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/115.jpg)
![Page 116: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/116.jpg)
tests/test_spmf.R
library(predmodel)library(testthat)
context("Testing context")
test_that(desc = "Test", code = { expect_true(5 > 3) expect_true(pi < 3) })
![Page 117: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/117.jpg)
![Page 118: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/118.jpg)
![Page 119: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/119.jpg)
![Page 120: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/120.jpg)
![Page 121: Large scale machine learning projects with r suite](https://reader031.fdocuments.us/reader031/viewer/2022022415/5a65052b7f8b9abb218b4969/html5/thumbnails/121.jpg)