CRAN Package Check Results for Package healthcareai

Last updated on 2018-02-18 19:46:24 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.2.4 22.83 273.47 296.30 ERROR
r-devel-linux-x86_64-debian-gcc 1.2.4 16.74 212.21 228.95 ERROR
r-devel-linux-x86_64-fedora-clang 1.2.4 244.62 OK
r-devel-linux-x86_64-fedora-gcc 1.2.4 382.34 OK
r-devel-windows-ix86+x86_64 1.2.4 32.00 248.00 280.00 OK
r-patched-linux-x86_64 1.2.4 10.79 286.21 297.00 ERROR
r-patched-solaris-x86 1.2.4 1532.80 OK
r-release-linux-x86_64 1.2.4 10.59 285.71 296.30 ERROR
r-release-windows-ix86+x86_64 1.2.4 25.00 265.00 290.00 OK
r-release-osx-x86_64 1.2.4 OK
r-oldrel-windows-ix86+x86_64 1.2.4 27.00 249.00 276.00 OK
r-oldrel-osx-x86_64 1.2.3 OK

Check Details

Version: 1.2.4
Check: examples
Result: ERROR
    Running examples in ‘healthcareai-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: LassoDeployment
    > ### Title: Deploy a production-ready predictive Lasso model
    > ### Aliases: LassoDeployment
    > ### Keywords: datasets
    >
    > ### ** Examples
    >
    >
    >
    > #### Classification Example using csv data ####
    > ## 1. Loading data and packages.
    > ptm <- proc.time()
    > library(healthcareai)
    > # setwd('C:/Yourscriptlocation/Useforwardslashes') # Uncomment if using csv
    >
    > # Can delete this line in your work
    > csvfile <- system.file("extdata",
    + "HCRDiabetesClinical.csv",
    + package = "healthcareai")
    >
    > # Replace csvfile with 'path/file'
    > df <- read.csv(file = csvfile,
    + header = TRUE,
    + na.strings = c("NULL", "NA", ""))
    >
    > df$PatientID <- NULL # Only one ID column (ie, PatientEncounterID) is needed remove this column
    >
    > # Save a dataframe for validation later on
    > dfDeploy <- df[951:1000,]
    >
    > ## 2. Train and save the model using DEVELOP
    > print('Historical, development data:')
    [1] "Historical, development data:"
    > str(df)
    'data.frame': 1000 obs. of 6 variables:
     $ PatientEncounterID : int 1 2 3 4 5 6 7 8 9 10 ...
     $ SystolicBPNBR : int 167 153 170 187 188 185 189 149 155 160 ...
     $ LDLNBR : int 195 214 191 135 125 178 101 160 144 130 ...
     $ A1CNBR : num 4.2 5 4 4.4 4.3 5 4 5 6.6 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 1 1 1 1 1 1 2 ...
    >
    > set.seed(42)
    > p <- SupervisedModelDevelopmentParams$new()
    > p$df <- df
    > p$type <- "classification"
    > p$impute <- TRUE
    > p$grainCol <- "PatientEncounterID"
    > p$predictedCol <- "ThirtyDayReadmitFLG"
    > p$debug <- FALSE
    > p$cores <- 1
    >
    > # Run Lasso
    > Lasso<- LassoDevelopment$new(p)
    > Lasso$run()
    Area under the ROC curve is: 0.77
    Ideal cutoff is 0.17, yielding TPR of 0.83 and FPR of 0.32
    95% CI AU_ROC: (0.67 , 0.88)
    
    Area under the PR curve is: 0.30
    Ideal cutoff is 0.18, yielding Precision of 0.43 and Recall of 0.60
    
    Grouped Lasso coefficients:
     (Intercept) SystolicBPNBR LDLNBR A1CNBR GenderFLGM
     -3.0095923 0.0000000 0.0000000 0.2102113 0.0000000
    Variables with non-zero coefficients: A1CNBR
    >
    > ## 3. Load saved model and use DEPLOY to generate predictions.
    > print('Fake production data:')
    [1] "Fake production data:"
    > str(dfDeploy)
    'data.frame': 50 obs. of 6 variables:
     $ PatientEncounterID : int 951 952 953 954 955 956 957 958 959 960 ...
     $ SystolicBPNBR : int 125 112 111 166 161 165 176 163 167 161 ...
     $ LDLNBR : int 122 144 145 119 106 118 145 112 123 106 ...
     $ A1CNBR : num 6.4 6 6 8 8 8 8 8 8 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 2 2 2 2 2 2 2 ...
    >
    > p2 <- SupervisedModelDeploymentParams$new()
    > p2$type <- "classification"
    > p2$df <- dfDeploy
    > p2$grainCol <- "PatientEncounterID"
    > p2$predictedCol <- "ThirtyDayReadmitFLG"
    > p2$impute <- TRUE
    > p2$debug <- FALSE
    > p2$cores <- 1
    >
    > dL <- LassoDeployment$new(p2)
    Loading Model Info...
    The modelName parameter was not specified. Using defaults:
    - rmodel_probability_lasso.rda
    - rmodel_info_lasso.rda
    Loading Data...
    > dL$deploy()
    Model metadata written to predictionMetadata_default_2018-02-16_08.09.06.361.txt
    WARNING: **This file may contain PHI.**
    >
    > dfOut <- dL$getOutDf()
    > head(dfOut)
     BindingID BindingNM LastLoadDTS PatientEncounterID PredictedProbNBR
    1 0 R 2018-02-16 08:09:06 951 0.1591936
    2 0 R 2018-02-16 08:09:06 952 0.1482586
    3 0 R 2018-02-16 08:09:06 953 0.1482586
    4 0 R 2018-02-16 08:09:06 954 0.2095066
    5 0 R 2018-02-16 08:09:06 955 0.2095066
    6 0 R 2018-02-16 08:09:06 956 0.2095066
     Factor1TXT Factor2TXT Factor3TXT
    1 A1CNBR SystolicBPNBR GenderFLG.M
    2 A1CNBR SystolicBPNBR GenderFLG.M
    3 A1CNBR SystolicBPNBR GenderFLG.M
    4 A1CNBR SystolicBPNBR GenderFLG.M
    5 A1CNBR SystolicBPNBR GenderFLG.M
    6 A1CNBR SystolicBPNBR GenderFLG.M
    > # Write to CSV (or JSON, MySQL, etc) using plain R syntax
    > # write.csv(dfOut,'path/predictionsfile.csv')
    >
    > print(proc.time() - ptm)
     user system elapsed
     1.032 0.074 1.260
    >
    >
    >
    > #### Classification example pulling from CSV and writing to SQLite ####
    >
    > ## 1. Loading data and packages.
    > ptm <- proc.time()
    > library(healthcareai)
    >
    > # Can delete these system.file lines in your work
    > csvfile <- system.file("extdata",
    + "HCRDiabetesClinical.csv",
    + package = "healthcareai")
    >
    > sqliteFile <- system.file("extdata",
    + "unit-test.sqlite",
    + package = "healthcareai")
    >
    > # Read in CSV; replace csvfile with 'path/file'
    > df <- read.csv(file = csvfile,
    + header = TRUE,
    + na.strings = c("NULL", "NA", ""))
    >
    > df$PatientID <- NULL # Only one ID column (ie, PatientEncounterID) is needed
    >
    > # Save a dataframe for validation later on
    > dfDeploy <- df[951:1000,]
    >
    > ## 2. Train and save the model using DEVELOP
    > print('Historical, development data:')
    [1] "Historical, development data:"
    > str(df)
    'data.frame': 1000 obs. of 6 variables:
     $ PatientEncounterID : int 1 2 3 4 5 6 7 8 9 10 ...
     $ SystolicBPNBR : int 167 153 170 187 188 185 189 149 155 160 ...
     $ LDLNBR : int 195 214 191 135 125 178 101 160 144 130 ...
     $ A1CNBR : num 4.2 5 4 4.4 4.3 5 4 5 6.6 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 1 1 1 1 1 1 2 ...
    >
    > set.seed(42)
    > p <- SupervisedModelDevelopmentParams$new()
    > p$df <- df
    > p$type <- "classification"
    > p$impute <- TRUE
    > p$grainCol <- "PatientEncounterID"
    > p$predictedCol <- "ThirtyDayReadmitFLG"
    > p$debug <- FALSE
    > p$cores <- 1
    >
    > # Run lasso
    > Lasso <- LassoDevelopment$new(p)
    > Lasso$run()
    Area under the ROC curve is: 0.77
    Ideal cutoff is 0.17, yielding TPR of 0.83 and FPR of 0.32
    95% CI AU_ROC: (0.67 , 0.88)
    
    Area under the PR curve is: 0.30
    Ideal cutoff is 0.18, yielding Precision of 0.43 and Recall of 0.60
    
    Grouped Lasso coefficients:
     (Intercept) SystolicBPNBR LDLNBR A1CNBR GenderFLGM
     -3.0095923 0.0000000 0.0000000 0.2102113 0.0000000
    Variables with non-zero coefficients: A1CNBR
    >
    > ## 3. Load saved model and use DEPLOY to generate predictions.
    > print('Fake production data:')
    [1] "Fake production data:"
    > str(dfDeploy)
    'data.frame': 50 obs. of 6 variables:
     $ PatientEncounterID : int 951 952 953 954 955 956 957 958 959 960 ...
     $ SystolicBPNBR : int 125 112 111 166 161 165 176 163 167 161 ...
     $ LDLNBR : int 122 144 145 119 106 118 145 112 123 106 ...
     $ A1CNBR : num 6.4 6 6 8 8 8 8 8 8 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 2 2 2 2 2 2 2 ...
    >
    > p2 <- SupervisedModelDeploymentParams$new()
    > p2$type <- "classification"
    > p2$df <- dfDeploy
    > p2$grainCol <- "PatientEncounterID"
    > p2$predictedCol <- "ThirtyDayReadmitFLG"
    > p2$impute <- TRUE
    > p2$debug <- FALSE
    > p2$cores <- 1
    >
    > dL <- LassoDeployment$new(p2)
    Loading Model Info...
    The modelName parameter was not specified. Using defaults:
    - rmodel_probability_lasso.rda
    - rmodel_info_lasso.rda
    Loading Data...
    > dL$deploy()
    Model metadata written to predictionMetadata_default_2018-02-16_08.09.08.071.txt
    WARNING: **This file may contain PHI.**
    > dfOut <- dL$getOutDf()
    >
    > writeData(SQLiteFileName = sqliteFile,
    + df = dfOut,
    + tableName = 'HCRDeployClassificationBASE')
    Error in rsqlite_bind_rows(rs@ptr, value) :
     attempt to write a readonly database
    Calls: writeData ... .local -> tryCatch -> tryCatchList -> rsqlite_bind_rows
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.2.4
Check: examples
Result: ERROR
    Running examples in ‘healthcareai-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: LassoDeployment
    > ### Title: Deploy a production-ready predictive Lasso model
    > ### Aliases: LassoDeployment
    > ### Keywords: datasets
    >
    > ### ** Examples
    >
    >
    >
    > #### Classification Example using csv data ####
    > ## 1. Loading data and packages.
    > ptm <- proc.time()
    > library(healthcareai)
    > # setwd('C:/Yourscriptlocation/Useforwardslashes') # Uncomment if using csv
    >
    > # Can delete this line in your work
    > csvfile <- system.file("extdata",
    + "HCRDiabetesClinical.csv",
    + package = "healthcareai")
    >
    > # Replace csvfile with 'path/file'
    > df <- read.csv(file = csvfile,
    + header = TRUE,
    + na.strings = c("NULL", "NA", ""))
    >
    > df$PatientID <- NULL # Only one ID column (ie, PatientEncounterID) is needed remove this column
    >
    > # Save a dataframe for validation later on
    > dfDeploy <- df[951:1000,]
    >
    > ## 2. Train and save the model using DEVELOP
    > print('Historical, development data:')
    [1] "Historical, development data:"
    > str(df)
    'data.frame': 1000 obs. of 6 variables:
     $ PatientEncounterID : int 1 2 3 4 5 6 7 8 9 10 ...
     $ SystolicBPNBR : int 167 153 170 187 188 185 189 149 155 160 ...
     $ LDLNBR : int 195 214 191 135 125 178 101 160 144 130 ...
     $ A1CNBR : num 4.2 5 4 4.4 4.3 5 4 5 6.6 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 1 1 1 1 1 1 2 ...
    >
    > set.seed(42)
    > p <- SupervisedModelDevelopmentParams$new()
    > p$df <- df
    > p$type <- "classification"
    > p$impute <- TRUE
    > p$grainCol <- "PatientEncounterID"
    > p$predictedCol <- "ThirtyDayReadmitFLG"
    > p$debug <- FALSE
    > p$cores <- 1
    >
    > # Run Lasso
    > Lasso<- LassoDevelopment$new(p)
    > Lasso$run()
    Area under the ROC curve is: 0.77
    Ideal cutoff is 0.17, yielding TPR of 0.83 and FPR of 0.32
    95% CI AU_ROC: (0.67 , 0.88)
    
    Area under the PR curve is: 0.30
    Ideal cutoff is 0.18, yielding Precision of 0.43 and Recall of 0.60
    
    Grouped Lasso coefficients:
     (Intercept) SystolicBPNBR LDLNBR A1CNBR GenderFLGM
     -3.0095923 0.0000000 0.0000000 0.2102113 0.0000000
    Variables with non-zero coefficients: A1CNBR
    >
    > ## 3. Load saved model and use DEPLOY to generate predictions.
    > print('Fake production data:')
    [1] "Fake production data:"
    > str(dfDeploy)
    'data.frame': 50 obs. of 6 variables:
     $ PatientEncounterID : int 951 952 953 954 955 956 957 958 959 960 ...
     $ SystolicBPNBR : int 125 112 111 166 161 165 176 163 167 161 ...
     $ LDLNBR : int 122 144 145 119 106 118 145 112 123 106 ...
     $ A1CNBR : num 6.4 6 6 8 8 8 8 8 8 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 2 2 2 2 2 2 2 ...
    >
    > p2 <- SupervisedModelDeploymentParams$new()
    > p2$type <- "classification"
    > p2$df <- dfDeploy
    > p2$grainCol <- "PatientEncounterID"
    > p2$predictedCol <- "ThirtyDayReadmitFLG"
    > p2$impute <- TRUE
    > p2$debug <- FALSE
    > p2$cores <- 1
    >
    > dL <- LassoDeployment$new(p2)
    Loading Model Info...
    The modelName parameter was not specified. Using defaults:
    - rmodel_probability_lasso.rda
    - rmodel_info_lasso.rda
    Loading Data...
    > dL$deploy()
    Model metadata written to predictionMetadata_default_2018-02-18_06.47.20.388.txt
    WARNING: **This file may contain PHI.**
    >
    > dfOut <- dL$getOutDf()
    > head(dfOut)
     BindingID BindingNM LastLoadDTS PatientEncounterID PredictedProbNBR
    1 0 R 2018-02-18 06:47:20 951 0.1591936
    2 0 R 2018-02-18 06:47:20 952 0.1482586
    3 0 R 2018-02-18 06:47:20 953 0.1482586
    4 0 R 2018-02-18 06:47:20 954 0.2095066
    5 0 R 2018-02-18 06:47:20 955 0.2095066
    6 0 R 2018-02-18 06:47:20 956 0.2095066
     Factor1TXT Factor2TXT Factor3TXT
    1 A1CNBR SystolicBPNBR GenderFLG.M
    2 A1CNBR SystolicBPNBR GenderFLG.M
    3 A1CNBR SystolicBPNBR GenderFLG.M
    4 A1CNBR SystolicBPNBR GenderFLG.M
    5 A1CNBR SystolicBPNBR GenderFLG.M
    6 A1CNBR SystolicBPNBR GenderFLG.M
    > # Write to CSV (or JSON, MySQL, etc) using plain R syntax
    > # write.csv(dfOut,'path/predictionsfile.csv')
    >
    > print(proc.time() - ptm)
     user system elapsed
     0.809 0.062 1.030
    >
    >
    >
    > #### Classification example pulling from CSV and writing to SQLite ####
    >
    > ## 1. Loading data and packages.
    > ptm <- proc.time()
    > library(healthcareai)
    >
    > # Can delete these system.file lines in your work
    > csvfile <- system.file("extdata",
    + "HCRDiabetesClinical.csv",
    + package = "healthcareai")
    >
    > sqliteFile <- system.file("extdata",
    + "unit-test.sqlite",
    + package = "healthcareai")
    >
    > # Read in CSV; replace csvfile with 'path/file'
    > df <- read.csv(file = csvfile,
    + header = TRUE,
    + na.strings = c("NULL", "NA", ""))
    >
    > df$PatientID <- NULL # Only one ID column (ie, PatientEncounterID) is needed
    >
    > # Save a dataframe for validation later on
    > dfDeploy <- df[951:1000,]
    >
    > ## 2. Train and save the model using DEVELOP
    > print('Historical, development data:')
    [1] "Historical, development data:"
    > str(df)
    'data.frame': 1000 obs. of 6 variables:
     $ PatientEncounterID : int 1 2 3 4 5 6 7 8 9 10 ...
     $ SystolicBPNBR : int 167 153 170 187 188 185 189 149 155 160 ...
     $ LDLNBR : int 195 214 191 135 125 178 101 160 144 130 ...
     $ A1CNBR : num 4.2 5 4 4.4 4.3 5 4 5 6.6 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 1 1 1 1 1 1 2 ...
    >
    > set.seed(42)
    > p <- SupervisedModelDevelopmentParams$new()
    > p$df <- df
    > p$type <- "classification"
    > p$impute <- TRUE
    > p$grainCol <- "PatientEncounterID"
    > p$predictedCol <- "ThirtyDayReadmitFLG"
    > p$debug <- FALSE
    > p$cores <- 1
    >
    > # Run lasso
    > Lasso <- LassoDevelopment$new(p)
    > Lasso$run()
    Area under the ROC curve is: 0.77
    Ideal cutoff is 0.17, yielding TPR of 0.83 and FPR of 0.32
    95% CI AU_ROC: (0.67 , 0.88)
    
    Area under the PR curve is: 0.30
    Ideal cutoff is 0.18, yielding Precision of 0.43 and Recall of 0.60
    
    Grouped Lasso coefficients:
     (Intercept) SystolicBPNBR LDLNBR A1CNBR GenderFLGM
     -3.0095923 0.0000000 0.0000000 0.2102113 0.0000000
    Variables with non-zero coefficients: A1CNBR
    >
    > ## 3. Load saved model and use DEPLOY to generate predictions.
    > print('Fake production data:')
    [1] "Fake production data:"
    > str(dfDeploy)
    'data.frame': 50 obs. of 6 variables:
     $ PatientEncounterID : int 951 952 953 954 955 956 957 958 959 960 ...
     $ SystolicBPNBR : int 125 112 111 166 161 165 176 163 167 161 ...
     $ LDLNBR : int 122 144 145 119 106 118 145 112 123 106 ...
     $ A1CNBR : num 6.4 6 6 8 8 8 8 8 8 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 2 2 2 2 2 2 2 ...
    >
    > p2 <- SupervisedModelDeploymentParams$new()
    > p2$type <- "classification"
    > p2$df <- dfDeploy
    > p2$grainCol <- "PatientEncounterID"
    > p2$predictedCol <- "ThirtyDayReadmitFLG"
    > p2$impute <- TRUE
    > p2$debug <- FALSE
    > p2$cores <- 1
    >
    > dL <- LassoDeployment$new(p2)
    Loading Model Info...
    The modelName parameter was not specified. Using defaults:
    - rmodel_probability_lasso.rda
    - rmodel_info_lasso.rda
    Loading Data...
    > dL$deploy()
    Model metadata written to predictionMetadata_default_2018-02-18_06.47.21.806.txt
    WARNING: **This file may contain PHI.**
    > dfOut <- dL$getOutDf()
    >
    > writeData(SQLiteFileName = sqliteFile,
    + df = dfOut,
    + tableName = 'HCRDeployClassificationBASE')
    Error in rsqlite_bind_rows(rs@ptr, value) :
     attempt to write a readonly database
    Calls: writeData ... .local -> tryCatch -> tryCatchList -> rsqlite_bind_rows
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 1.2.4
Check: examples
Result: ERROR
    Running examples in ‘healthcareai-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: LassoDeployment
    > ### Title: Deploy a production-ready predictive Lasso model
    > ### Aliases: LassoDeployment
    > ### Keywords: datasets
    >
    > ### ** Examples
    >
    >
    >
    > #### Classification Example using csv data ####
    > ## 1. Loading data and packages.
    > ptm <- proc.time()
    > library(healthcareai)
    > # setwd('C:/Yourscriptlocation/Useforwardslashes') # Uncomment if using csv
    >
    > # Can delete this line in your work
    > csvfile <- system.file("extdata",
    + "HCRDiabetesClinical.csv",
    + package = "healthcareai")
    >
    > # Replace csvfile with 'path/file'
    > df <- read.csv(file = csvfile,
    + header = TRUE,
    + na.strings = c("NULL", "NA", ""))
    >
    > df$PatientID <- NULL # Only one ID column (ie, PatientEncounterID) is needed remove this column
    >
    > # Save a dataframe for validation later on
    > dfDeploy <- df[951:1000,]
    >
    > ## 2. Train and save the model using DEVELOP
    > print('Historical, development data:')
    [1] "Historical, development data:"
    > str(df)
    'data.frame': 1000 obs. of 6 variables:
     $ PatientEncounterID : int 1 2 3 4 5 6 7 8 9 10 ...
     $ SystolicBPNBR : int 167 153 170 187 188 185 189 149 155 160 ...
     $ LDLNBR : int 195 214 191 135 125 178 101 160 144 130 ...
     $ A1CNBR : num 4.2 5 4 4.4 4.3 5 4 5 6.6 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 1 1 1 1 1 1 2 ...
    >
    > set.seed(42)
    > p <- SupervisedModelDevelopmentParams$new()
    > p$df <- df
    > p$type <- "classification"
    > p$impute <- TRUE
    > p$grainCol <- "PatientEncounterID"
    > p$predictedCol <- "ThirtyDayReadmitFLG"
    > p$debug <- FALSE
    > p$cores <- 1
    >
    > # Run Lasso
    > Lasso<- LassoDevelopment$new(p)
    > Lasso$run()
    Area under the ROC curve is: 0.77
    Ideal cutoff is 0.17, yielding TPR of 0.83 and FPR of 0.32
    95% CI AU_ROC: (0.67 , 0.88)
    
    Area under the PR curve is: 0.30
    Ideal cutoff is 0.18, yielding Precision of 0.43 and Recall of 0.60
    
    Grouped Lasso coefficients:
     (Intercept) SystolicBPNBR LDLNBR A1CNBR GenderFLGM
     -3.0095923 0.0000000 0.0000000 0.2102113 0.0000000
    Variables with non-zero coefficients: A1CNBR
    >
    > ## 3. Load saved model and use DEPLOY to generate predictions.
    > print('Fake production data:')
    [1] "Fake production data:"
    > str(dfDeploy)
    'data.frame': 50 obs. of 6 variables:
     $ PatientEncounterID : int 951 952 953 954 955 956 957 958 959 960 ...
     $ SystolicBPNBR : int 125 112 111 166 161 165 176 163 167 161 ...
     $ LDLNBR : int 122 144 145 119 106 118 145 112 123 106 ...
     $ A1CNBR : num 6.4 6 6 8 8 8 8 8 8 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 2 2 2 2 2 2 2 ...
    >
    > p2 <- SupervisedModelDeploymentParams$new()
    > p2$type <- "classification"
    > p2$df <- dfDeploy
    > p2$grainCol <- "PatientEncounterID"
    > p2$predictedCol <- "ThirtyDayReadmitFLG"
    > p2$impute <- TRUE
    > p2$debug <- FALSE
    > p2$cores <- 1
    >
    > dL <- LassoDeployment$new(p2)
    Loading Model Info...
    The modelName parameter was not specified. Using defaults:
    - rmodel_probability_lasso.rda
    - rmodel_info_lasso.rda
    Loading Data...
    > dL$deploy()
    Model metadata written to predictionMetadata_default_2018-02-16_20.06.26.907.txt
    WARNING: **This file may contain PHI.**
    >
    > dfOut <- dL$getOutDf()
    > head(dfOut)
     BindingID BindingNM LastLoadDTS PatientEncounterID PredictedProbNBR
    1 0 R 2018-02-16 20:06:26 951 0.1591936
    2 0 R 2018-02-16 20:06:26 952 0.1482586
    3 0 R 2018-02-16 20:06:26 953 0.1482586
    4 0 R 2018-02-16 20:06:26 954 0.2095066
    5 0 R 2018-02-16 20:06:26 955 0.2095066
    6 0 R 2018-02-16 20:06:26 956 0.2095066
     Factor1TXT Factor2TXT Factor3TXT
    1 A1CNBR SystolicBPNBR GenderFLG.M
    2 A1CNBR SystolicBPNBR GenderFLG.M
    3 A1CNBR SystolicBPNBR GenderFLG.M
    4 A1CNBR SystolicBPNBR GenderFLG.M
    5 A1CNBR SystolicBPNBR GenderFLG.M
    6 A1CNBR SystolicBPNBR GenderFLG.M
    > # Write to CSV (or JSON, MySQL, etc) using plain R syntax
    > # write.csv(dfOut,'path/predictionsfile.csv')
    >
    > print(proc.time() - ptm)
     user system elapsed
     3.106 0.052 3.609
    >
    >
    >
    > #### Classification example pulling from CSV and writing to SQLite ####
    >
    > ## 1. Loading data and packages.
    > ptm <- proc.time()
    > library(healthcareai)
    >
    > # Can delete these system.file lines in your work
    > csvfile <- system.file("extdata",
    + "HCRDiabetesClinical.csv",
    + package = "healthcareai")
    >
    > sqliteFile <- system.file("extdata",
    + "unit-test.sqlite",
    + package = "healthcareai")
    >
    > # Read in CSV; replace csvfile with 'path/file'
    > df <- read.csv(file = csvfile,
    + header = TRUE,
    + na.strings = c("NULL", "NA", ""))
    >
    > df$PatientID <- NULL # Only one ID column (ie, PatientEncounterID) is needed
    >
    > # Save a dataframe for validation later on
    > dfDeploy <- df[951:1000,]
    >
    > ## 2. Train and save the model using DEVELOP
    > print('Historical, development data:')
    [1] "Historical, development data:"
    > str(df)
    'data.frame': 1000 obs. of 6 variables:
     $ PatientEncounterID : int 1 2 3 4 5 6 7 8 9 10 ...
     $ SystolicBPNBR : int 167 153 170 187 188 185 189 149 155 160 ...
     $ LDLNBR : int 195 214 191 135 125 178 101 160 144 130 ...
     $ A1CNBR : num 4.2 5 4 4.4 4.3 5 4 5 6.6 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 1 1 1 1 1 1 2 ...
    >
    > set.seed(42)
    > p <- SupervisedModelDevelopmentParams$new()
    > p$df <- df
    > p$type <- "classification"
    > p$impute <- TRUE
    > p$grainCol <- "PatientEncounterID"
    > p$predictedCol <- "ThirtyDayReadmitFLG"
    > p$debug <- FALSE
    > p$cores <- 1
    >
    > # Run lasso
    > Lasso <- LassoDevelopment$new(p)
    > Lasso$run()
    Area under the ROC curve is: 0.77
    Ideal cutoff is 0.17, yielding TPR of 0.83 and FPR of 0.32
    95% CI AU_ROC: (0.67 , 0.88)
    
    Area under the PR curve is: 0.30
    Ideal cutoff is 0.18, yielding Precision of 0.43 and Recall of 0.60
    
    Grouped Lasso coefficients:
     (Intercept) SystolicBPNBR LDLNBR A1CNBR GenderFLGM
     -3.0095923 0.0000000 0.0000000 0.2102113 0.0000000
    Variables with non-zero coefficients: A1CNBR
    >
    > ## 3. Load saved model and use DEPLOY to generate predictions.
    > print('Fake production data:')
    [1] "Fake production data:"
    > str(dfDeploy)
    'data.frame': 50 obs. of 6 variables:
     $ PatientEncounterID : int 951 952 953 954 955 956 957 958 959 960 ...
     $ SystolicBPNBR : int 125 112 111 166 161 165 176 163 167 161 ...
     $ LDLNBR : int 122 144 145 119 106 118 145 112 123 106 ...
     $ A1CNBR : num 6.4 6 6 8 8 8 8 8 8 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 2 2 2 2 2 2 2 ...
    >
    > p2 <- SupervisedModelDeploymentParams$new()
    > p2$type <- "classification"
    > p2$df <- dfDeploy
    > p2$grainCol <- "PatientEncounterID"
    > p2$predictedCol <- "ThirtyDayReadmitFLG"
    > p2$impute <- TRUE
    > p2$debug <- FALSE
    > p2$cores <- 1
    >
    > dL <- LassoDeployment$new(p2)
    Loading Model Info...
    The modelName parameter was not specified. Using defaults:
    - rmodel_probability_lasso.rda
    - rmodel_info_lasso.rda
    Loading Data...
    > dL$deploy()
    Model metadata written to predictionMetadata_default_2018-02-16_20.06.29.648.txt
    WARNING: **This file may contain PHI.**
    > dfOut <- dL$getOutDf()
    >
    > writeData(SQLiteFileName = sqliteFile,
    + df = dfOut,
    + tableName = 'HCRDeployClassificationBASE')
    Error in rsqlite_bind_rows(rs@ptr, value) :
     attempt to write a readonly database
    Calls: writeData ... tryCatch -> tryCatchList -> rsqlite_bind_rows -> .Call
    Execution halted
Flavor: r-patched-linux-x86_64

Version: 1.2.4
Check: examples
Result: ERROR
    Running examples in ‘healthcareai-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: LassoDeployment
    > ### Title: Deploy a production-ready predictive Lasso model
    > ### Aliases: LassoDeployment
    > ### Keywords: datasets
    >
    > ### ** Examples
    >
    >
    >
    > #### Classification Example using csv data ####
    > ## 1. Loading data and packages.
    > ptm <- proc.time()
    > library(healthcareai)
    > # setwd('C:/Yourscriptlocation/Useforwardslashes') # Uncomment if using csv
    >
    > # Can delete this line in your work
    > csvfile <- system.file("extdata",
    + "HCRDiabetesClinical.csv",
    + package = "healthcareai")
    >
    > # Replace csvfile with 'path/file'
    > df <- read.csv(file = csvfile,
    + header = TRUE,
    + na.strings = c("NULL", "NA", ""))
    >
    > df$PatientID <- NULL # Only one ID column (ie, PatientEncounterID) is needed remove this column
    >
    > # Save a dataframe for validation later on
    > dfDeploy <- df[951:1000,]
    >
    > ## 2. Train and save the model using DEVELOP
    > print('Historical, development data:')
    [1] "Historical, development data:"
    > str(df)
    'data.frame': 1000 obs. of 6 variables:
     $ PatientEncounterID : int 1 2 3 4 5 6 7 8 9 10 ...
     $ SystolicBPNBR : int 167 153 170 187 188 185 189 149 155 160 ...
     $ LDLNBR : int 195 214 191 135 125 178 101 160 144 130 ...
     $ A1CNBR : num 4.2 5 4 4.4 4.3 5 4 5 6.6 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 1 1 1 1 1 1 2 ...
    >
    > set.seed(42)
    > p <- SupervisedModelDevelopmentParams$new()
    > p$df <- df
    > p$type <- "classification"
    > p$impute <- TRUE
    > p$grainCol <- "PatientEncounterID"
    > p$predictedCol <- "ThirtyDayReadmitFLG"
    > p$debug <- FALSE
    > p$cores <- 1
    >
    > # Run Lasso
    > Lasso<- LassoDevelopment$new(p)
    > Lasso$run()
    Area under the ROC curve is: 0.77
    Ideal cutoff is 0.17, yielding TPR of 0.83 and FPR of 0.32
    95% CI AU_ROC: (0.67 , 0.88)
    
    Area under the PR curve is: 0.30
    Ideal cutoff is 0.18, yielding Precision of 0.43 and Recall of 0.60
    
    Grouped Lasso coefficients:
     (Intercept) SystolicBPNBR LDLNBR A1CNBR GenderFLGM
     -3.0095923 0.0000000 0.0000000 0.2102113 0.0000000
    Variables with non-zero coefficients: A1CNBR
    >
    > ## 3. Load saved model and use DEPLOY to generate predictions.
    > print('Fake production data:')
    [1] "Fake production data:"
    > str(dfDeploy)
    'data.frame': 50 obs. of 6 variables:
     $ PatientEncounterID : int 951 952 953 954 955 956 957 958 959 960 ...
     $ SystolicBPNBR : int 125 112 111 166 161 165 176 163 167 161 ...
     $ LDLNBR : int 122 144 145 119 106 118 145 112 123 106 ...
     $ A1CNBR : num 6.4 6 6 8 8 8 8 8 8 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 2 2 2 2 2 2 2 ...
    >
    > p2 <- SupervisedModelDeploymentParams$new()
    > p2$type <- "classification"
    > p2$df <- dfDeploy
    > p2$grainCol <- "PatientEncounterID"
    > p2$predictedCol <- "ThirtyDayReadmitFLG"
    > p2$impute <- TRUE
    > p2$debug <- FALSE
    > p2$cores <- 1
    >
    > dL <- LassoDeployment$new(p2)
    Loading Model Info...
    The modelName parameter was not specified. Using defaults:
    - rmodel_probability_lasso.rda
    - rmodel_info_lasso.rda
    Loading Data...
    > dL$deploy()
    Model metadata written to predictionMetadata_default_2018-02-17_08.08.12.873.txt
    WARNING: **This file may contain PHI.**
    >
    > dfOut <- dL$getOutDf()
    > head(dfOut)
     BindingID BindingNM LastLoadDTS PatientEncounterID PredictedProbNBR
    1 0 R 2018-02-17 08:08:12 951 0.1591936
    2 0 R 2018-02-17 08:08:12 952 0.1482586
    3 0 R 2018-02-17 08:08:12 953 0.1482586
    4 0 R 2018-02-17 08:08:12 954 0.2095066
    5 0 R 2018-02-17 08:08:12 955 0.2095066
    6 0 R 2018-02-17 08:08:12 956 0.2095066
     Factor1TXT Factor2TXT Factor3TXT
    1 A1CNBR SystolicBPNBR GenderFLG.M
    2 A1CNBR SystolicBPNBR GenderFLG.M
    3 A1CNBR SystolicBPNBR GenderFLG.M
    4 A1CNBR SystolicBPNBR GenderFLG.M
    5 A1CNBR SystolicBPNBR GenderFLG.M
    6 A1CNBR SystolicBPNBR GenderFLG.M
    > # Write to CSV (or JSON, MySQL, etc) using plain R syntax
    > # write.csv(dfOut,'path/predictionsfile.csv')
    >
    > print(proc.time() - ptm)
     user system elapsed
     2.901 0.071 3.679
    >
    >
    >
    > #### Classification example pulling from CSV and writing to SQLite ####
    >
    > ## 1. Loading data and packages.
    > ptm <- proc.time()
    > library(healthcareai)
    >
    > # Can delete these system.file lines in your work
    > csvfile <- system.file("extdata",
    + "HCRDiabetesClinical.csv",
    + package = "healthcareai")
    >
    > sqliteFile <- system.file("extdata",
    + "unit-test.sqlite",
    + package = "healthcareai")
    >
    > # Read in CSV; replace csvfile with 'path/file'
    > df <- read.csv(file = csvfile,
    + header = TRUE,
    + na.strings = c("NULL", "NA", ""))
    >
    > df$PatientID <- NULL # Only one ID column (ie, PatientEncounterID) is needed
    >
    > # Save a dataframe for validation later on
    > dfDeploy <- df[951:1000,]
    >
    > ## 2. Train and save the model using DEVELOP
    > print('Historical, development data:')
    [1] "Historical, development data:"
    > str(df)
    'data.frame': 1000 obs. of 6 variables:
     $ PatientEncounterID : int 1 2 3 4 5 6 7 8 9 10 ...
     $ SystolicBPNBR : int 167 153 170 187 188 185 189 149 155 160 ...
     $ LDLNBR : int 195 214 191 135 125 178 101 160 144 130 ...
     $ A1CNBR : num 4.2 5 4 4.4 4.3 5 4 5 6.6 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 1 1 1 1 1 1 2 ...
    >
    > set.seed(42)
    > p <- SupervisedModelDevelopmentParams$new()
    > p$df <- df
    > p$type <- "classification"
    > p$impute <- TRUE
    > p$grainCol <- "PatientEncounterID"
    > p$predictedCol <- "ThirtyDayReadmitFLG"
    > p$debug <- FALSE
    > p$cores <- 1
    >
    > # Run lasso
    > Lasso <- LassoDevelopment$new(p)
    > Lasso$run()
    Area under the ROC curve is: 0.77
    Ideal cutoff is 0.17, yielding TPR of 0.83 and FPR of 0.32
    95% CI AU_ROC: (0.67 , 0.88)
    
    Area under the PR curve is: 0.30
    Ideal cutoff is 0.18, yielding Precision of 0.43 and Recall of 0.60
    
    Grouped Lasso coefficients:
     (Intercept) SystolicBPNBR LDLNBR A1CNBR GenderFLGM
     -3.0095923 0.0000000 0.0000000 0.2102113 0.0000000
    Variables with non-zero coefficients: A1CNBR
    >
    > ## 3. Load saved model and use DEPLOY to generate predictions.
    > print('Fake production data:')
    [1] "Fake production data:"
    > str(dfDeploy)
    'data.frame': 50 obs. of 6 variables:
     $ PatientEncounterID : int 951 952 953 954 955 956 957 958 959 960 ...
     $ SystolicBPNBR : int 125 112 111 166 161 165 176 163 167 161 ...
     $ LDLNBR : int 122 144 145 119 106 118 145 112 123 106 ...
     $ A1CNBR : num 6.4 6 6 8 8 8 8 8 8 8 ...
     $ GenderFLG : Factor w/ 2 levels "F","M": 2 2 2 2 2 2 2 2 2 2 ...
     $ ThirtyDayReadmitFLG: Factor w/ 2 levels "N","Y": 1 1 1 2 2 2 2 2 2 2 ...
    >
    > p2 <- SupervisedModelDeploymentParams$new()
    > p2$type <- "classification"
    > p2$df <- dfDeploy
    > p2$grainCol <- "PatientEncounterID"
    > p2$predictedCol <- "ThirtyDayReadmitFLG"
    > p2$impute <- TRUE
    > p2$debug <- FALSE
    > p2$cores <- 1
    >
    > dL <- LassoDeployment$new(p2)
    Loading Model Info...
    The modelName parameter was not specified. Using defaults:
    - rmodel_probability_lasso.rda
    - rmodel_info_lasso.rda
    Loading Data...
    > dL$deploy()
    Model metadata written to predictionMetadata_default_2018-02-17_08.08.15.456.txt
    WARNING: **This file may contain PHI.**
    > dfOut <- dL$getOutDf()
    >
    > writeData(SQLiteFileName = sqliteFile,
    + df = dfOut,
    + tableName = 'HCRDeployClassificationBASE')
    Error in rsqlite_bind_rows(rs@ptr, value) :
     attempt to write a readonly database
    Calls: writeData ... tryCatch -> tryCatchList -> rsqlite_bind_rows -> .Call
    Execution halted
Flavor: r-release-linux-x86_64