[IG-CM-MT-MY_mf850finalproject_ii.R:3:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L3) *style:* **Commented code should be removed.**
```r
#### 12/20/2016
 ^~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:16:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L16) *style:* **Variable and function names should be all lowercase.**
```r
laggedDataFile <- "laggeddata.rds"
^~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:19:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L19) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionFile <- "Linear_Ridge_Lasso.R"
^~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:20:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L20) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestRegressionFile <- "random_forest_reg.R"
^~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:21:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L21) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionFile <- "Logistic_Ridge_Lasso.R"
^~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:22:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L22) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestCatFile <- "random_forest_cat.R"  # Random forest high/low
^~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:23:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L23) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionModelLambdaFile <- "Logistic_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:23:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L23) *style:* **Variable and function names should not be longer than 30 characters.**
```r
LogisticRegressionModelLambdaFile <- "Logistic_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:25:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L25) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionModelFile <- "Linear_Ridge_Lasso_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:26:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L26) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionModelLambdaFile <- "Linear_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:27:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L27) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestRegressionModelFile <- "random_forest_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:27:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L27) *style:* **Variable and function names should not be longer than 30 characters.**
```r
RandomForestRegressionModelFile <- "random_forest_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:28:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L28) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionModelFile <- "Logistic_Ridge_Lasso_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:29:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L29) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestCatModelFile <- "random_forest_cat_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:31:8:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L31) *style:* **Put spaces around all infix operators.**
```r
par(ask=FALSE)
      ~^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:36:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L36) *style:* **Commas should always have a space after.**
```r
  packagestoinstall_split <- strsplit(packagestoinstall,", ")[[1]]
                                                        ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:38:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L38) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(!packagename %in% rownames(installed.packages())){
      ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:42:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L42) *style:* **Commas should always have a space after.**
```r
      print(paste(packagename,"already installed"))
                              ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:44:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L44) *style:* **Put spaces around all infix operators.**
```r
    library(packagename, character.only=TRUE)
                                      ~^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:49:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L49) *style:* **Variable and function names should be all lowercase.**
```r
regressionStockPredictions <- function(df) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:50:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L50) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:55:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L55) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:56:61:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L56) *style:* **Trailing whitespace is superfluous.**
```r
  # Scale data - remove categorical variable and add it back
                                                            ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:62:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L62) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:64:13:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L64) *style:* **Trailing whitespace is superfluous.**
```r
  ### GLMNET
            ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:66:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L66) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:67:48:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L67) *style:* **Trailing whitespace is superfluous.**
```r
  # Import glmnet model and parameter from file
                                               ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:68:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L68) *style:* **Variable and function names should be all lowercase.**
```r
  glm_best <- readRDS(LinearRegrssionModelFile)
                      ^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:68:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L68) *warning:* **no visible binding for global variable ‘LinearRegrssionModelFile’**
```r
  glm_best <- readRDS(LinearRegrssionModelFile)
                      ^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:69:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L69) *style:* **Variable and function names should be all lowercase.**
```r
  bestLambda <- readRDS(LinearRegrssionModelLambdaFile)
  ^~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:69:25:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L69) *style:* **Variable and function names should be all lowercase.**
```r
  bestLambda <- readRDS(LinearRegrssionModelLambdaFile)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:69:25:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L69) *warning:* **no visible binding for global variable ‘LinearRegrssionModelLambdaFile’**
```r
  bestLambda <- readRDS(LinearRegrssionModelLambdaFile)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:70:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L70) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:71:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L71) *style:* **Trailing whitespace is superfluous.**
```r
  # Reformat data for glmnet
                            ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:73:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L73) *style:* **Trailing whitespace is superfluous.**
```r
  # Predict using optimal Linear Regression Coefficients
                                                        ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:74:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L74) *style:* **lines should not be more than 80 characters.**
```r
  predict_glm <- predict.glmnet(glm_best, newx = x_data_lin, type = "response", s = bestLambda)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:74:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L74) *warning:* **no visible global function definition for ‘predict.glmnet’**
```r
  predict_glm <- predict.glmnet(glm_best, newx = x_data_lin, type = "response", s = bestLambda)
                 ^~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:74:85:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L74) *style:* **Variable and function names should be all lowercase.**
```r
  predict_glm <- predict.glmnet(glm_best, newx = x_data_lin, type = "response", s = bestLambda)
                                                                                ^~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:75:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L75) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:77:19:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L77) *style:* **Trailing whitespace is superfluous.**
```r
  ## Random Forest
                  ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:79:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L79) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:80:58:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L80) *style:* **Trailing whitespace is superfluous.**
```r
  # Import random forest model from file - has 1400 trees
                                                         ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:81:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L81) *style:* **Variable and function names should be all lowercase.**
```r
  rf_reg_model <- readRDS(RandomForestRegressionModelFile)
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:81:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L81) *style:* **Variable and function names should not be longer than 30 characters.**
```r
  rf_reg_model <- readRDS(RandomForestRegressionModelFile)
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:81:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L81) *warning:* **no visible binding for global variable ‘RandomForestRegressionModelFile’**
```r
  rf_reg_model <- readRDS(RandomForestRegressionModelFile)
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:82:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L82) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:85:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L85) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:86:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L86) *style:* **Trailing whitespace is superfluous.**
```r
  # Predict using Random Forest
                               ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:88:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L88) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:92:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L92) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:93:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L93) *warning:* **no visible global function definition for ‘h2o.init’**
```r
  h2o.init(nthreads = -1)
  ^~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:94:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L94) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:95:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L95) *warning:* **no visible global function definition for ‘as.h2o’**
```r
  x_data_h2o.hex <- as.h2o(x_data_lin)
                    ^~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:96:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L96) *style:* **Variable and function names should be all lowercase.**
```r
  dnnModel <- h2o.loadModel("DNNmodel/DNNmodel")
  ^~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:96:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L96) *style:* **Variable and function names should be all lowercase.**
```r
  dnnModel <- h2o.loadModel("DNNmodel/DNNmodel")
              ^~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:96:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L96) *warning:* **no visible global function definition for ‘h2o.loadModel’**
```r
  dnnModel <- h2o.loadModel("DNNmodel/DNNmodel")
              ^~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:97:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L97) *warning:* **no visible global function definition for ‘h2o.predict’**
```r
  predict.reg <- as.data.frame(h2o.predict(dnnModel, x_data_h2o.hex))
                               ^~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:97:44:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L97) *style:* **Variable and function names should be all lowercase.**
```r
  predict.reg <- as.data.frame(h2o.predict(dnnModel, x_data_h2o.hex))
                                           ^~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:98:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L98) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:99:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L99) *warning:* **no visible global function definition for ‘h2o.shutdown’**
```r
  h2o.shutdown(prompt = FALSE)
  ^~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:100:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L100) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:104:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L104) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:106:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L106) *style:* **lines should not be more than 80 characters.**
```r
  predictions <- (weights[1]*predict.reg$predict + weights[2]*predict_rf + weights[3]*predict_glm)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:106:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L106) *style:* **Put spaces around all infix operators.**
```r
  predictions <- (weights[1]*predict.reg$predict + weights[2]*predict_rf + weights[3]*predict_glm)
                           ~^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:106:62:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L106) *style:* **Put spaces around all infix operators.**
```r
  predictions <- (weights[1]*predict.reg$predict + weights[2]*predict_rf + weights[3]*predict_glm)
                                                            ~^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:106:86:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L106) *style:* **Put spaces around all infix operators.**
```r
  predictions <- (weights[1]*predict.reg$predict + weights[2]*predict_rf + weights[3]*predict_glm)
                                                                                ~^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:106:99:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L106) *style:* **Trailing whitespace is superfluous.**
```r
  predictions <- (weights[1]*predict.reg$predict + weights[2]*predict_rf + weights[3]*predict_glm)
                                                                                ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:118:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L118) *style:* **Variable and function names should be all lowercase.**
```r
stockPredictions <- regressionStockPredictions(df)
^~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:118:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L118) *style:* **Variable and function names should be all lowercase.**
```r
stockPredictions <- regressionStockPredictions(df)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:119:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_ii.R#L119) *style:* **Variable and function names should be all lowercase.**
```r
print(stockPredictions)
      ^~~~~~~~~~~~~~~~
```


`return arr.filter(el => el === '.').length;`


[IG-CM-MT-MY_mf850finalproject_iii.R:3:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L3) *style:* **Commented code should be removed.**
```r
#### 12/20/2016
 ^~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:16:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L16) *style:* **Variable and function names should be all lowercase.**
```r
laggedDataFile <- "laggeddata.rds"
^~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:19:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L19) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionFile <- "Linear_Ridge_Lasso.R"
^~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:20:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L20) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestRegressionFile <- "random_forest_reg.R"
^~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:21:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L21) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionFile <- "Logistic_Ridge_Lasso.R"
^~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:22:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L22) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestCatFile <- "random_forest_cat.R"
^~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:23:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L23) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionModelLambdaFile <- "Logistic_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:23:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L23) *style:* **Variable and function names should not be longer than 30 characters.**
```r
LogisticRegressionModelLambdaFile <- "Logistic_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:25:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L25) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionModelFile <- "Linear_Ridge_Lasso_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:26:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L26) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionModelLambdaFile <- "Linear_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:27:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L27) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestRegressionModelFile <- "random_forest_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:27:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L27) *style:* **Variable and function names should not be longer than 30 characters.**
```r
RandomForestRegressionModelFile <- "random_forest_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:28:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L28) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionModelFile <- "Logistic_Ridge_Lasso_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:29:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L29) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestCatModelFile <- "random_forest_cat_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:31:8:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L31) *style:* **Put spaces around all infix operators.**
```r
par(ask=FALSE)
      ~^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:36:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L36) *style:* **Commas should always have a space after.**
```r
  packagestoinstall_split <- strsplit(packagestoinstall,", ")[[1]]
                                                        ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:38:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L38) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(!packagename %in% rownames(installed.packages())){
      ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:42:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L42) *style:* **Commas should always have a space after.**
```r
      print(paste(packagename,"already installed"))
                              ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:44:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L44) *style:* **Put spaces around all infix operators.**
```r
    library(packagename, character.only=TRUE)
                                      ~^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:50:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L50) *style:* **Variable and function names should be all lowercase.**
```r
categoricalStockPredictions <- function(df) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:55:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L55) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:56:61:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L56) *style:* **Trailing whitespace is superfluous.**
```r
  # Scale data - remove categorical variable and add it back
                                                            ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:62:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L62) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:64:4:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L64) *style:* **Commented code should be removed.**
```r
  ### GLMNET - LOGISITIC
   ^~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:64:25:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L64) *style:* **Trailing whitespace is superfluous.**
```r
  ### GLMNET - LOGISITIC
                        ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:66:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L66) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:67:48:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L67) *style:* **Trailing whitespace is superfluous.**
```r
  # Import glmnet model and parameter from file
                                               ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:68:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L68) *style:* **Variable and function names should be all lowercase.**
```r
  glm_best <- readRDS(LogisticRegressionModelFile)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:68:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L68) *warning:* **no visible binding for global variable ‘LogisticRegressionModelFile’**
```r
  glm_best <- readRDS(LogisticRegressionModelFile)
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:69:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L69) *style:* **Variable and function names should be all lowercase.**
```r
  bestLambda <- readRDS(LogisticRegressionModelLambdaFile)
  ^~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:69:25:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L69) *style:* **Variable and function names should be all lowercase.**
```r
  bestLambda <- readRDS(LogisticRegressionModelLambdaFile)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:69:25:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L69) *style:* **Variable and function names should not be longer than 30 characters.**
```r
  bestLambda <- readRDS(LogisticRegressionModelLambdaFile)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:69:25:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L69) *warning:* **no visible binding for global variable ‘LogisticRegressionModelLambdaFile’**
```r
  bestLambda <- readRDS(LogisticRegressionModelLambdaFile)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:70:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L70) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:71:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L71) *style:* **Trailing whitespace is superfluous.**
```r
  # Reformat data for glmnet
                            ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:73:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L73) *style:* **Trailing whitespace is superfluous.**
```r
  # Predict using optimal Linear Regression Coefficients
                                                        ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:74:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L74) *style:* **lines should not be more than 80 characters.**
```r
  predict_glm <- predict.glmnet(glm_best, newx = x_data_lin, type = "response", s = bestLambda)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:74:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L74) *warning:* **no visible global function definition for ‘predict.glmnet’**
```r
  predict_glm <- predict.glmnet(glm_best, newx = x_data_lin, type = "response", s = bestLambda)
                 ^~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:74:85:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L74) *style:* **Variable and function names should be all lowercase.**
```r
  predict_glm <- predict.glmnet(glm_best, newx = x_data_lin, type = "response", s = bestLambda)
                                                                                ^~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:75:45:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L75) *style:* **Trailing whitespace is superfluous.**
```r
  # Change log odds to categorical variables
                                            ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:76:46:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L76) *style:* **Do not place spaces around code in parentheses or square brackets.**
```r
  predictions <- ifelse(predictions > 0, 1, 0 )
                                             ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:77:50:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L77) *style:* **Trailing whitespace is superfluous.**
```r
  # Ensure data types are the same int -> factors
                                                 ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:79:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L79) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:81:19:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L81) *style:* **Trailing whitespace is superfluous.**
```r
  ## Random Forest
                  ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:83:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L83) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:84:58:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L84) *style:* **Trailing whitespace is superfluous.**
```r
  # Import random forest model from file - has 1400 trees
                                                         ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:85:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L85) *style:* **Variable and function names should be all lowercase.**
```r
  rf_cat_model <- readRDS(RandomForestCatModelFile)
                          ^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:85:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L85) *warning:* **no visible binding for global variable ‘RandomForestCatModelFile’**
```r
  rf_cat_model <- readRDS(RandomForestCatModelFile)
                          ^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:86:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L86) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:89:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L89) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:90:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L90) *style:* **Trailing whitespace is superfluous.**
```r
  # Predict using Random Forest
                               ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:92:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L92) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:96:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L96) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:97:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L97) *warning:* **no visible global function definition for ‘h2o.init’**
```r
  h2o.init(nthreads = -1)
  ^~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:98:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L98) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:99:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L99) *warning:* **no visible global function definition for ‘as.h2o’**
```r
  x_data_h2o.hex <- as.h2o(x_data_lin)
                    ^~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:100:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L100) *style:* **Variable and function names should be all lowercase.**
```r
  dnnModel <- h2o.loadModel("DNNmodel_cat/DNNmodel_cat")
  ^~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:100:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L100) *style:* **Variable and function names should be all lowercase.**
```r
  dnnModel <- h2o.loadModel("DNNmodel_cat/DNNmodel_cat")
              ^~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:100:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L100) *warning:* **no visible global function definition for ‘h2o.loadModel’**
```r
  dnnModel <- h2o.loadModel("DNNmodel_cat/DNNmodel_cat")
              ^~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:101:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L101) *warning:* **no visible global function definition for ‘h2o.predict’**
```r
  predict.reg <- as.data.frame(h2o.predict(dnnModel, x_data_h2o.hex))
                               ^~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:101:44:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L101) *style:* **Variable and function names should be all lowercase.**
```r
  predict.reg <- as.data.frame(h2o.predict(dnnModel, x_data_h2o.hex))
                                           ^~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:102:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L102) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:103:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L103) *warning:* **no visible global function definition for ‘h2o.shutdown’**
```r
  h2o.shutdown(prompt = FALSE)
  ^~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:104:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L104) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:105:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L105) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:107:17:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L107) *style:* **Trailing whitespace is superfluous.**
```r
  ## Predictions
                ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:109:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L109) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:111:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L111) *style:* **Trailing whitespace is superfluous.**
```r
  # Order is DNN, RF, GLM
                         ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:112:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L112) *style:* **Commas should never have a space before.**
```r
  Accuracy <- c(.8, 0.356  ,0.6317)
                         ~~^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:112:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L112) *style:* **Commas should always have a space after.**
```r
  Accuracy <- c(.8, 0.356  ,0.6317)
                            ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:113:24:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L113) *style:* **Put spaces around all infix operators.**
```r
  weights <- (Accuracy)/sum(Accuracy)
                      ~^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:114:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L114) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:115:73:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L115) *style:* **Trailing whitespace is superfluous.**
```r
  # Turn predictions from factors into integers for combining at the end
                                                                        ^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:116:4:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L116) *style:* **Commented code should be removed.**
```r
  #predict.reg <- as.integer(predict.reg)
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:120:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L120) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:122:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L122) *style:* **lines should not be more than 80 characters.**
```r
  predictions <- (weights[1]*predict_dnn + weights[2]*predict_rf + weights[3]*predict_glm)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:122:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L122) *style:* **Put spaces around all infix operators.**
```r
  predictions <- (weights[1]*predict_dnn + weights[2]*predict_rf + weights[3]*predict_glm)
                           ~^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:122:54:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L122) *style:* **Put spaces around all infix operators.**
```r
  predictions <- (weights[1]*predict_dnn + weights[2]*predict_rf + weights[3]*predict_glm)
                                                    ~^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:122:78:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L122) *style:* **Put spaces around all infix operators.**
```r
  predictions <- (weights[1]*predict_dnn + weights[2]*predict_rf + weights[3]*predict_glm)
                                                                            ~^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:123:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L123) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:124:28:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L124) *style:* **Trailing whitespace is superfluous.**
```r
  # Make predictions 0 or 1
                           ^
```
[IG-CM-MT-MY_mf850finalproject_iii.R:138:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L138) *style:* **Variable and function names should be all lowercase.**
```r
stockPredictions <- categoricalStockPredictions(df)
^~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:138:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L138) *style:* **Variable and function names should be all lowercase.**
```r
stockPredictions <- categoricalStockPredictions(df)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_iii.R:139:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/717faff5a744bb464bc207018330089956bc53d7/IG-CM-MT-MY_mf850finalproject_iii.R#L139) *style:* **Variable and function names should be all lowercase.**
```r
print(stockPredictions)
      ^~~~~~~~~~~~~~~~
```


the intel instruction reference I have doesn't show movq supporting xmm,reg notation.
Only *mm,address and *mm,*mm notation


Always use `map` for 1-to-1 mapping


in user table username was unique slo every time a user signup with an already existing name then it shows the duplicasy error , so iremoved the duplicasy of the username, from the user table,(all done in the sugnup page)


 import play.api.http.HttpErrorHandlerExceptions;
  import play.api.routing.Router;
  import play.http.DefaultHttpErrorHandler;
 -import play.libs.F;
  import play.mvc.Http;
  import play.mvc.Result;
  import play.mvc.Results;

  import javax.inject.Inject;
  import javax.inject.Provider;
 +import java.util.concurrent.CompletableFuture;
 +import java.util.concurrent.CompletionStage;

  /**
   * Error handler for the Play Framework.
 @@ -45,7 +46,7 @@ public HoneybadgerErrorHandler(Configuration configuration,
      }

      @Override
 -    public F.Promise<Result> onServerError(Http.RequestHeader request, Throwable exception) {
 +    public CompletionStage<Result> onServerError(Http.RequestHeader request, Throwable exception) {

          NoticeReportResult errorResult = reporter.reportError(exception, request);

 @@ -72,7 +73,7 @@ public HoneybadgerErrorHandler(Configuration configuration,
              }
          } catch (Exception e) {
              Logger.error("Error while handling error", e);
 -            return F.Promise.<Result>pure(Results.internalServerError());
 +            return CompletableFuture.completedFuture(Results.internalServerError());
          }
      }


Is it a GPL v2 license compatible?
I am a code developer used to work with phpBB.
In order to get my code validated the license must be GPL v 2.

`GNU GENERAL PUBLIC LICENSE Version 2, June 1991`

Thanks for your hard work, appreciated.


No, we would compute the value for the next attempt.


Why not `$src[1] = rtrim(sprintf('%.3F', $resizedImage->getDimensions()->getSize()->getWidth() / $width1x), '.0').'x';`?


我就是个大蒟蒻


[test_train_split.R:44:19:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/test_train_split.R#L44) *style:* **Place a space before left parenthesis, except in a function call.**
```r
MSE_test1 <- mean((y_test - mean(y_train)) ^ 2)
                  ^
```


[MF850Utilities.R:1:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L1) *style:* **Variable and function names should be all lowercase.**
```r
laggedDataFile <- "laggeddata.rds"
^~~~~~~~~~~~~~
```
[MF850Utilities.R:5:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L5) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionFile <- "Linear_Ridge_Lasso.R"
^~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:6:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L6) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestRegressionFile <- "random_forest_reg.R"
^~~~~~~~~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:7:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L7) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionFile <- "Logistic_Ridge_Lasso.R"
^~~~~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:8:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L8) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestCatFile <- "random_forest_cat.R"  # Random forest high/low
^~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:9:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L9) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionModelLambdaFile <- "Logistic_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:9:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L9) *style:* **Variable and function names should not be longer than 30 characters.**
```r
LogisticRegressionModelLambdaFile <- "Logistic_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:12:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L12) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionModelFile <- "Linear_Ridge_Lasso_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:13:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L13) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionModelLambdaFile <- "Linear_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:14:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L14) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestRegressionModelFile <- "random_forest_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:14:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L14) *style:* **Variable and function names should not be longer than 30 characters.**
```r
RandomForestRegressionModelFile <- "random_forest_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:15:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L15) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionModelFile <- "Logistic_Ridge_Lasso_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:16:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L16) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestCatModelFile <- "random_forest_cat_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:18:8:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L18) *style:* **Put spaces around all infix operators.**
```r
par(ask=FALSE)
      ~^~
```
[MF850Utilities.R:25:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L25) *style:* **Variable and function names should be all lowercase.**
```r
loadLaggedDataSet <- function() {
^~~~~~~~~~~~~~~~~
```
[MF850Utilities.R:26:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L26) *style:* **Variable and function names should be all lowercase.**
```r
  mynewdataframe <- readRDS(file = laggedDataFile)
                                   ^~~~~~~~~~~~~~
```
[MF850Utilities.R:26:36:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L26) *warning:* **no visible binding for global variable ‘laggedDataFile’**
```r
  mynewdataframe <- readRDS(file = laggedDataFile)
                                   ^~~~~~~~~~~~~~
```
[MF850Utilities.R:31:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L31) *style:* **Commas should always have a space after.**
```r
  packagestoinstall_split <- strsplit(packagestoinstall,", ")[[1]]
                                                        ^
```
[MF850Utilities.R:33:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L33) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(!packagename %in% rownames(installed.packages())){
      ^
```
[MF850Utilities.R:37:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L37) *style:* **Commas should always have a space after.**
```r
      print(paste(packagename,"already installed"))
                              ^
```
[MF850Utilities.R:39:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L39) *style:* **Put spaces around all infix operators.**
```r
    library(packagename, character.only=TRUE)
                                      ~^~
```
[MF850Utilities.R:43:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L43) *style:* **Variable and function names should be all lowercase.**
```r
lagStockData <- function(stockdata) {
^~~~~~~~~~~~
```
[MF850Utilities.R:47:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L47) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  for(company in companies)
     ^
```
[MF850Utilities.R:48:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L48) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[MF850Utilities.R:50:51:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L50) *style:* **Commas should always have a space after.**
```r
    futurereturns <- c(returns[2:length(returns)],NA)
                                                  ^
```
[MF850Utilities.R:51:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L51) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
    if (1 == NROW(returns)) {futurereturns <- c(NA)}
                            ^
```
[MF850Utilities.R:51:52:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L51) *style:* **Closing curly-braces should always be on their own line, unless it's followed by an else.**
```r
    if (1 == NROW(returns)) {futurereturns <- c(NA)}
                                                   ^
```
[MF850Utilities.R:52:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L52) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[MF850Utilities.R:54:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L54) *style:* **Use <-, not =, for assignment.**
```r
    newdataset = rbind(newdataset, company)
               ^
```
[MF850Utilities.R:56:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L56) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(i %% 500 == 0) print(i)
      ^
```
[MF850Utilities.R:58:30:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L58) *style:* **Variable and function names should be all lowercase.**
```r
  saveRDS(newdataset, file = laggedDataFile)
                             ^~~~~~~~~~~~~~
```
[MF850Utilities.R:58:30:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L58) *warning:* **no visible binding for global variable ‘laggedDataFile’**
```r
  saveRDS(newdataset, file = laggedDataFile)
                             ^~~~~~~~~~~~~~
```
[MF850Utilities.R:62:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L62) *style:* **Variable and function names should be all lowercase.**
```r
removeLastMonth <- function(stockdata) {
^~~~~~~~~~~~~~~
```
[MF850Utilities.R:66:6:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L66) *style:* **Place a space before left parenthesis, except in a function call.**
```r
  for(company in companies)
     ^
```
[MF850Utilities.R:67:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L67) *style:* **Opening curly braces should never go on their own line and should always be followed by a new line.**
```r
  {
  ^
```
[MF850Utilities.R:68:13:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L68) *style:* **Use <-, not =, for assignment.**
```r
    company = company[-1,]
            ^
```
[MF850Utilities.R:68:26:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L68) *style:* **Commas should always have a space after.**
```r
    company = company[-1,]
                         ^
```
[MF850Utilities.R:69:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L69) *style:* **Trailing whitespace is superfluous.**
```r

^~~~
```
[MF850Utilities.R:70:16:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L70) *style:* **Use <-, not =, for assignment.**
```r
    newdataset = rbind(newdataset, company)
               ^
```
[MF850Utilities.R:72:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L72) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(i %% 500 == 0) print(i)
      ^
```
[MF850Utilities.R:76:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/MF850Utilities.R#L76) *style:* **Trailing blank lines are superfluous.**
```r

^
```


[IG-CM-MT-MY_mf850finalproject_ii.R:3:2:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L3) *style:* **Commented code should be removed.**
```r
#### 12/20/2016
 ^~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:16:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L16) *style:* **Variable and function names should be all lowercase.**
```r
laggedDataFile <- "laggeddata.rds"
^~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:19:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L19) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionFile <- "Linear_Ridge_Lasso.R"
^~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:20:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L20) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestRegressionFile <- "random_forest_reg.R"
^~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:21:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L21) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionFile <- "Logistic_Ridge_Lasso.R"
^~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:22:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L22) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestCatFile <- "random_forest_cat.R"  # Random forest high/low
^~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:23:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L23) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionModelLambdaFile <- "Logistic_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:23:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L23) *style:* **Variable and function names should not be longer than 30 characters.**
```r
LogisticRegressionModelLambdaFile <- "Logistic_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:25:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L25) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionModelFile <- "Linear_Ridge_Lasso_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:26:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L26) *style:* **Variable and function names should be all lowercase.**
```r
LinearRegrssionModelLambdaFile <- "Linear_Ridge_Lasso_model_lambda.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:27:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L27) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestRegressionModelFile <- "random_forest_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:27:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L27) *style:* **Variable and function names should not be longer than 30 characters.**
```r
RandomForestRegressionModelFile <- "random_forest_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:28:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L28) *style:* **Variable and function names should be all lowercase.**
```r
LogisticRegressionModelFile <- "Logistic_Ridge_Lasso_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:29:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L29) *style:* **Variable and function names should be all lowercase.**
```r
RandomForestCatModelFile <- "random_forest_cat_model.rds"
^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:31:8:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L31) *style:* **Put spaces around all infix operators.**
```r
par(ask=FALSE)
      ~^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:36:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L36) *style:* **Commas should always have a space after.**
```r
  packagestoinstall_split <- strsplit(packagestoinstall,", ")[[1]]
                                                        ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:38:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L38) *style:* **Place a space before left parenthesis, except in a function call.**
```r
    if(!packagename %in% rownames(installed.packages())){
      ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:42:31:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L42) *style:* **Commas should always have a space after.**
```r
      print(paste(packagename,"already installed"))
                              ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:44:40:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L44) *style:* **Put spaces around all infix operators.**
```r
    library(packagename, character.only=TRUE)
                                      ~^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:49:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L49) *style:* **Variable and function names should be all lowercase.**
```r
regressionStockPredictions <- function(df) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:50:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L50) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:55:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L55) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:56:61:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L56) *style:* **Trailing whitespace is superfluous.**
```r
  # Scale data - remove categorical variable and add it back
                                                            ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:62:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L62) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:64:13:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L64) *style:* **Trailing whitespace is superfluous.**
```r
  ### GLMNET
            ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:66:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L66) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:67:48:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L67) *style:* **Trailing whitespace is superfluous.**
```r
  # Import glmnet model and parameter from file
                                               ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:68:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L68) *style:* **Variable and function names should be all lowercase.**
```r
  glm_best <- readRDS(LinearRegrssionModelFile)
                      ^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:68:23:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L68) *warning:* **no visible binding for global variable ‘LinearRegrssionModelFile’**
```r
  glm_best <- readRDS(LinearRegrssionModelFile)
                      ^~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:69:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L69) *style:* **Variable and function names should be all lowercase.**
```r
  bestLambda <- readRDS(LinearRegrssionModelLambdaFile)
  ^~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:69:25:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L69) *style:* **Variable and function names should be all lowercase.**
```r
  bestLambda <- readRDS(LinearRegrssionModelLambdaFile)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:69:25:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L69) *warning:* **no visible binding for global variable ‘LinearRegrssionModelLambdaFile’**
```r
  bestLambda <- readRDS(LinearRegrssionModelLambdaFile)
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:70:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L70) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:71:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L71) *style:* **Trailing whitespace is superfluous.**
```r
  # Reformat data for glmnet
                            ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:73:57:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L73) *style:* **Trailing whitespace is superfluous.**
```r
  # Predict using optimal Linear Regression Coefficients
                                                        ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:74:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L74) *style:* **lines should not be more than 80 characters.**
```r
  predict_glm <- predict.glmnet(glm_best, newx = x_data_lin, type = "response", s = bestLambda)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:74:18:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L74) *warning:* **no visible global function definition for ‘predict.glmnet’**
```r
  predict_glm <- predict.glmnet(glm_best, newx = x_data_lin, type = "response", s = bestLambda)
                 ^~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:74:85:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L74) *style:* **Variable and function names should be all lowercase.**
```r
  predict_glm <- predict.glmnet(glm_best, newx = x_data_lin, type = "response", s = bestLambda)
                                                                                ^~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:75:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L75) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:77:19:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L77) *style:* **Trailing whitespace is superfluous.**
```r
  ## Random Forest
                  ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:79:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L79) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:80:58:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L80) *style:* **Trailing whitespace is superfluous.**
```r
  # Import random forest model from file - has 1400 trees
                                                         ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:81:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L81) *style:* **Variable and function names should be all lowercase.**
```r
  rf_reg_model <- readRDS(RandomForestRegressionModelFile)
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:81:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L81) *style:* **Variable and function names should not be longer than 30 characters.**
```r
  rf_reg_model <- readRDS(RandomForestRegressionModelFile)
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:81:27:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L81) *warning:* **no visible binding for global variable ‘RandomForestRegressionModelFile’**
```r
  rf_reg_model <- readRDS(RandomForestRegressionModelFile)
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:82:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L82) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:85:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L85) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:86:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L86) *style:* **Trailing whitespace is superfluous.**
```r
  # Predict using Random Forest
                               ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:88:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L88) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:92:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L92) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:93:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L93) *warning:* **no visible global function definition for ‘h2o.init’**
```r
  h2o.init(nthreads = -1)
  ^~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:94:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L94) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:95:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L95) *warning:* **no visible global function definition for ‘as.h2o’**
```r
  x_data_h2o.hex <- as.h2o(x_data_lin)
                    ^~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:96:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L96) *style:* **Variable and function names should be all lowercase.**
```r
  dnnModel <- h2o.loadModel("DNNmodel/DNNmodel")
  ^~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:96:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L96) *style:* **Variable and function names should be all lowercase.**
```r
  dnnModel <- h2o.loadModel("DNNmodel/DNNmodel")
              ^~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:96:15:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L96) *warning:* **no visible global function definition for ‘h2o.loadModel’**
```r
  dnnModel <- h2o.loadModel("DNNmodel/DNNmodel")
              ^~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:97:32:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L97) *warning:* **no visible global function definition for ‘h2o.predict’**
```r
  predict.reg <- as.data.frame(h2o.predict(dnnModel, x_data_h2o.hex))
                               ^~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:97:44:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L97) *style:* **Variable and function names should be all lowercase.**
```r
  predict.reg <- as.data.frame(h2o.predict(dnnModel, x_data_h2o.hex))
                                           ^~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:98:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L98) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:99:3:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L99) *warning:* **no visible global function definition for ‘h2o.shutdown’**
```r
  h2o.shutdown(prompt = FALSE)
  ^~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:100:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L100) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:104:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L104) *style:* **Trailing whitespace is superfluous.**
```r

^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:106:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L106) *style:* **lines should not be more than 80 characters.**
```r
  predictions <- (weights[1]*predict.reg$predict + weights[2]*predict_rf + weights[3]*predict_glm)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:106:29:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L106) *style:* **Put spaces around all infix operators.**
```r
  predictions <- (weights[1]*predict.reg$predict + weights[2]*predict_rf + weights[3]*predict_glm)
                           ~^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:106:62:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L106) *style:* **Put spaces around all infix operators.**
```r
  predictions <- (weights[1]*predict.reg$predict + weights[2]*predict_rf + weights[3]*predict_glm)
                                                            ~^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:106:86:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L106) *style:* **Put spaces around all infix operators.**
```r
  predictions <- (weights[1]*predict.reg$predict + weights[2]*predict_rf + weights[3]*predict_glm)
                                                                                ~^~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:106:99:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L106) *style:* **Trailing whitespace is superfluous.**
```r
  predictions <- (weights[1]*predict.reg$predict + weights[2]*predict_rf + weights[3]*predict_glm)
                                                                                ^
```
[IG-CM-MT-MY_mf850finalproject_ii.R:118:1:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L118) *style:* **Variable and function names should be all lowercase.**
```r
stockPredictions <- regressionStockPredictions(df)
^~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:118:21:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L118) *style:* **Variable and function names should be all lowercase.**
```r
stockPredictions <- regressionStockPredictions(df)
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
```
[IG-CM-MT-MY_mf850finalproject_ii.R:119:7:](https://github.com/myellen/MF850_Computational_Finance_Final/blob/f0ee900ab68c4f7dccd5090b9d72dcc58efe3b49/IG-CM-MT-MY_mf850finalproject_ii.R#L119) *style:* **Variable and function names should be all lowercase.**
```r
print(stockPredictions)
      ^~~~~~~~~~~~~~~~
```


Sure.

At a high level:

* Take the lock manually line 84 (simulate another request currently having that lock, e.g. competing completion call)
* Verify `processNotification` finishes without exception and verify the effective date of the next attempt


created a genereal function for removing the duplicasy either it is username, or email , anything from any database and any table---(some error in the PDO variable it says undefined variable $db, dont know why)"