Question 7.2

Friedman (1991) introduced several benchmark data sets create by simulation. One of these simulations used the following nonlinear equation to create data:

\[y=10\sin (\pi x_{1}x_{2})+20(x_{3}-0.5)^2+10x_{4}+5x_{5}+N(0,\sigma ^2)\]

where the x values are random variables uniformly distributed between [0, 1] (there are also 5 other non-informative variables also created in the simulation). The package mlbench contains a function called mlbench.friedman1 that simulates these data:

Tune several models on these data. For example:

## k-Nearest Neighbors 
## 
## 200 samples
##  10 predictor
## 
## Pre-processing: centered (10), scaled (10) 
## Resampling: Bootstrapped (25 reps) 
## Summary of sample sizes: 200, 200, 200, 200, 200, 200, ... 
## Resampling results across tuning parameters:
## 
##   k   RMSE      Rsquared   MAE     
##    5  3.654912  0.4779838  2.958475
##    7  3.529432  0.5118581  2.861742
##    9  3.446330  0.5425096  2.780756
##   11  3.378049  0.5723793  2.719410
##   13  3.332339  0.5953773  2.692863
##   15  3.309235  0.6111389  2.663046
##   17  3.317408  0.6201421  2.678898
##   19  3.311667  0.6333800  2.682098
##   21  3.316340  0.6407537  2.688887
##   23  3.326040  0.6491480  2.705915
## 
## RMSE was used to select the optimal model using the smallest value.
## The final value used for the model was k = 15.
##      RMSE  Rsquared       MAE 
## 3.1750657 0.6785946 2.5443169

Which models appear to give the best performance? Does MARS select the informative predictors (those named X1–X5)?

Answer:

SVM-Linear

The final model trained by linear SVM is epsilon = 0.1 cost C = 1 with RMSE 2.7633860 & R2 0.6973384

## Support Vector Machines with Linear Kernel 
## 
## 200 samples
##  10 predictor
## 
## Pre-processing: centered (10), scaled (10) 
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 180, 180, 180, 180, 180, 180, ... 
## Resampling results:
## 
##   RMSE      Rsquared   MAE     
##   2.429138  0.7585222  1.965661
## 
## Tuning parameter 'C' was held constant at a value of 1
## Support Vector Machine object of class "ksvm" 
## 
## SV type: eps-svr  (regression) 
##  parameter : epsilon = 0.1  cost C = 1 
## 
## Linear (vanilla) kernel function. 
## 
## Number of Support Vectors : 172 
## 
## Objective Function Value : -54.9759 
## Training error : 0.216921
##      RMSE  Rsquared       MAE 
## 2.7633860 0.6973384 2.0970616

SVM-Radial

The final model trained by Radial SVM is epsilon = 0.1 cost C = 8, sigma = 0.0629932410345396 with RMSE 2.0541197 & R2 0.8290353

## Support Vector Machines with Radial Basis Function Kernel 
## 
## 200 samples
##  10 predictor
## 
## Pre-processing: centered (10), scaled (10) 
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 180, 180, 180, 180, 180, 180, ... 
## Resampling results across tuning parameters:
## 
##   C        RMSE      Rsquared   MAE     
##      0.25  2.525164  0.7810576  2.010680
##      0.50  2.270567  0.7944850  1.794902
##      1.00  2.099356  0.8155574  1.659376
##      2.00  2.005858  0.8302852  1.578799
##      4.00  1.934650  0.8435677  1.528373
##      8.00  1.915665  0.8475605  1.528648
##     16.00  1.923914  0.8463074  1.535991
##     32.00  1.923914  0.8463074  1.535991
##     64.00  1.923914  0.8463074  1.535991
##    128.00  1.923914  0.8463074  1.535991
##    256.00  1.923914  0.8463074  1.535991
##    512.00  1.923914  0.8463074  1.535991
##   1024.00  1.923914  0.8463074  1.535991
##   2048.00  1.923914  0.8463074  1.535991
## 
## Tuning parameter 'sigma' was held constant at a value of 0.06299324
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were sigma = 0.06299324 and C = 8.
## Support Vector Machine object of class "ksvm" 
## 
## SV type: eps-svr  (regression) 
##  parameter : epsilon = 0.1  cost C = 8 
## 
## Gaussian Radial Basis kernel function. 
##  Hyperparameter : sigma =  0.0629932410345396 
## 
## Number of Support Vectors : 152 
## 
## Objective Function Value : -72.63 
## Training error : 0.009177
##      RMSE  Rsquared       MAE 
## 2.0541197 0.8290353 1.5586411

SVM-Polynomial

The final model trained by Polynomial SVM is epsilon = 0.1 cost C = 0.5, degree = 3 scale = 0.1 offset = 1 with RMSE 2.0564650 & R2 0.8310884

## Support Vector Machines with Polynomial Kernel 
## 
## 200 samples
##  10 predictor
## 
## Pre-processing: centered (10), scaled (10) 
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 180, 180, 180, 180, 180, 180, ... 
## Resampling results across tuning parameters:
## 
##   degree  scale  C     RMSE      Rsquared   MAE     
##   1       0.001  0.25  4.763881  0.7366269  3.912571
##   1       0.001  0.50  4.617330  0.7376064  3.787900
##   1       0.001  1.00  4.351479  0.7355789  3.561381
##   1       0.001  2.00  3.867351  0.7401050  3.158700
##   1       0.010  0.25  3.711577  0.7439878  3.037307
##   1       0.010  0.50  3.037734  0.7500121  2.494361
##   1       0.010  1.00  2.606886  0.7554606  2.126507
##   1       0.010  2.00  2.465015  0.7586805  2.018188
##   1       0.100  0.25  2.432377  0.7604321  1.991550
##   1       0.100  0.50  2.419285  0.7591638  1.971433
##   1       0.100  1.00  2.435724  0.7563615  1.973661
##   1       0.100  2.00  2.434895  0.7566897  1.969241
##   1       1.000  0.25  2.435493  0.7567619  1.969113
##   1       1.000  0.50  2.433348  0.7574620  1.967454
##   1       1.000  1.00  2.429940  0.7583999  1.966357
##   1       1.000  2.00  2.432347  0.7581066  1.967671
##   2       0.001  0.25  4.617339  0.7376255  3.787914
##   2       0.001  0.50  4.351486  0.7356099  3.561395
##   2       0.001  1.00  3.867297  0.7400445  3.158577
##   2       0.001  2.00  3.270622  0.7441841  2.694402
##   2       0.010  0.25  3.035230  0.7518007  2.492293
##   2       0.010  0.50  2.590422  0.7587008  2.115071
##   2       0.010  1.00  2.439896  0.7637583  1.997834
##   2       0.010  2.00  2.371906  0.7673980  1.927845
##   2       0.100  0.25  2.069776  0.8155998  1.650388
##   2       0.100  0.50  1.965305  0.8301488  1.550369
##   2       0.100  1.00  1.974104  0.8334526  1.579994
##   2       0.100  2.00  1.997227  0.8345576  1.609912
##   2       1.000  0.25  2.061148  0.8410088  1.688012
##   2       1.000  0.50  2.081844  0.8407738  1.693817
##   2       1.000  1.00  2.087780  0.8403437  1.698219
##   2       1.000  2.00  2.084166  0.8407541  1.694988
##   3       0.001  0.25  4.477852  0.7363407  3.668531
##   3       0.001  0.50  4.107151  0.7334257  3.357893
##   3       0.001  1.00  3.560177  0.7405641  2.923402
##   3       0.001  2.00  2.881611  0.7542154  2.369244
##   3       0.010  0.25  2.723753  0.7588724  2.225310
##   3       0.010  0.50  2.477358  0.7636596  2.023215
##   3       0.010  1.00  2.344012  0.7737494  1.903935
##   3       0.010  2.00  2.301737  0.7783092  1.859257
##   3       0.100  0.25  1.952669  0.8382025  1.543128
##   3       0.100  0.50  1.930412  0.8467547  1.526408
##   3       0.100  1.00  2.026823  0.8395150  1.616447
##   3       0.100  2.00  2.078726  0.8365432  1.687398
##   3       1.000  0.25  3.221462  0.6569500  2.603166
##   3       1.000  0.50  3.221462  0.6569500  2.603166
##   3       1.000  1.00  3.221462  0.6569500  2.603166
##   3       1.000  2.00  3.221462  0.6569500  2.603166
## 
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were degree = 3, scale = 0.1 and C = 0.5.
## Support Vector Machine object of class "ksvm" 
## 
## SV type: eps-svr  (regression) 
##  parameter : epsilon = 0.1  cost C = 0.5 
## 
## Polynomial kernel function. 
##  Hyperparameters : degree =  3  scale =  0.1  offset =  1 
## 
## Number of Support Vectors : 146 
## 
## Objective Function Value : -8.0447 
## Training error : 0.020293
##      RMSE  Rsquared       MAE 
## 2.0564650 0.8310884 1.5544685

MARS

The final MARS model is nprune = 14 and degree = 2, with RMSE 1.1722635 & R2 0.9448890. MARS selected 14 of 18 terms, and 5 of 10 predictors, which are X1, X4, X2, X5 and X3 orded by variable importance.

## Loading required package: earth
## Loading required package: Formula
## Loading required package: plotmo
## Loading required package: plotrix
## Loading required package: TeachingDemos
## Multivariate Adaptive Regression Spline 
## 
## 200 samples
##  10 predictor
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 180, 180, 180, 180, 180, 180, ... 
## Resampling results across tuning parameters:
## 
##   degree  nprune  RMSE      Rsquared   MAE     
##   1        2      4.188280  0.3042527  3.460689
##   1        3      3.551182  0.4999832  2.837116
##   1        4      2.653143  0.7167280  2.128222
##   1        5      2.405769  0.7562160  1.948161
##   1        6      2.295006  0.7754603  1.853199
##   1        7      1.771950  0.8611767  1.391357
##   1        8      1.647182  0.8774867  1.299564
##   1        9      1.609816  0.8837307  1.299705
##   1       10      1.635035  0.8798236  1.309436
##   1       11      1.571915  0.8896147  1.260711
##   1       12      1.571561  0.8898750  1.253077
##   1       13      1.567577  0.8906927  1.250795
##   1       14      1.571673  0.8909652  1.245508
##   1       15      1.571673  0.8909652  1.245508
##   1       16      1.571673  0.8909652  1.245508
##   1       17      1.571673  0.8909652  1.245508
##   1       18      1.571673  0.8909652  1.245508
##   1       19      1.571673  0.8909652  1.245508
##   1       20      1.571673  0.8909652  1.245508
##   1       21      1.571673  0.8909652  1.245508
##   1       22      1.571673  0.8909652  1.245508
##   1       23      1.571673  0.8909652  1.245508
##   1       24      1.571673  0.8909652  1.245508
##   1       25      1.571673  0.8909652  1.245508
##   1       26      1.571673  0.8909652  1.245508
##   1       27      1.571673  0.8909652  1.245508
##   1       28      1.571673  0.8909652  1.245508
##   1       29      1.571673  0.8909652  1.245508
##   1       30      1.571673  0.8909652  1.245508
##   1       31      1.571673  0.8909652  1.245508
##   1       32      1.571673  0.8909652  1.245508
##   1       33      1.571673  0.8909652  1.245508
##   1       34      1.571673  0.8909652  1.245508
##   1       35      1.571673  0.8909652  1.245508
##   1       36      1.571673  0.8909652  1.245508
##   1       37      1.571673  0.8909652  1.245508
##   1       38      1.571673  0.8909652  1.245508
##   2        2      4.188280  0.3042527  3.460689
##   2        3      3.551182  0.4999832  2.837116
##   2        4      2.615256  0.7216809  2.128763
##   2        5      2.344223  0.7683855  1.890080
##   2        6      2.275048  0.7762472  1.807779
##   2        7      1.841464  0.8418935  1.457945
##   2        8      1.641647  0.8839822  1.288520
##   2        9      1.535119  0.9002991  1.214772
##   2       10      1.473254  0.9101555  1.158761
##   2       11      1.379476  0.9207735  1.080991
##   2       12      1.285380  0.9283193  1.033426
##   2       13      1.267261  0.9328905  1.014726
##   2       14      1.261797  0.9327541  1.009821
##   2       15      1.266663  0.9320714  1.005751
##   2       16      1.270858  0.9322465  1.009757
##   2       17      1.263778  0.9327687  1.007653
##   2       18      1.263778  0.9327687  1.007653
##   2       19      1.263778  0.9327687  1.007653
##   2       20      1.263778  0.9327687  1.007653
##   2       21      1.263778  0.9327687  1.007653
##   2       22      1.263778  0.9327687  1.007653
##   2       23      1.263778  0.9327687  1.007653
##   2       24      1.263778  0.9327687  1.007653
##   2       25      1.263778  0.9327687  1.007653
##   2       26      1.263778  0.9327687  1.007653
##   2       27      1.263778  0.9327687  1.007653
##   2       28      1.263778  0.9327687  1.007653
##   2       29      1.263778  0.9327687  1.007653
##   2       30      1.263778  0.9327687  1.007653
##   2       31      1.263778  0.9327687  1.007653
##   2       32      1.263778  0.9327687  1.007653
##   2       33      1.263778  0.9327687  1.007653
##   2       34      1.263778  0.9327687  1.007653
##   2       35      1.263778  0.9327687  1.007653
##   2       36      1.263778  0.9327687  1.007653
##   2       37      1.263778  0.9327687  1.007653
##   2       38      1.263778  0.9327687  1.007653
## 
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were nprune = 14 and degree = 2.
## Selected 14 of 18 terms, and 5 of 10 predictors (nprune=14)
## Termination condition: Reached nk 21
## Importance: X1, X4, X2, X5, X3, X6-unused, X7-unused, X8-unused, X9-unused, ...
## Number of terms at each degree of interaction: 1 9 4
## GCV 1.62945    RSS 225.8601    GRSq 0.9338437    RSq 0.953688
##      RMSE  Rsquared       MAE 
## 1.1722635 0.9448890 0.9324923

Neural Networks

The final neural network model is size = 5, decay = 0.07, with RMSE 2.2480475 & R2 0.8031027.

## integer(0)
## Warning: executing %dopar% sequentially: no parallel backend registered
## Model Averaged Neural Network 
## 
## 200 samples
##  10 predictor
## 
## Pre-processing: centered (10), scaled (10) 
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 180, 180, 180, 180, 180, 180, ... 
## Resampling results across tuning parameters:
## 
##   decay  size  RMSE      Rsquared   MAE     
##   0.01    1    2.404567  0.7609557  1.889455
##   0.01    2    2.436960  0.7534744  1.919892
##   0.01    3    2.187507  0.8006263  1.700457
##   0.01    4    2.027172  0.8239211  1.608293
##   0.01    5    2.174956  0.8040747  1.746873
##   0.01    6    2.247179  0.7962598  1.748556
##   0.01    7    2.495552  0.7516917  1.996630
##   0.01    8    2.479849  0.7525438  1.970609
##   0.01    9    2.455646  0.7551865  1.918742
##   0.01   10    2.380386  0.7666502  1.944705
##   0.02    1    2.388957  0.7626569  1.875134
##   0.02    2    2.457544  0.7543633  1.935851
##   0.02    3    2.150727  0.8047792  1.690877
##   0.02    4    2.037427  0.8227565  1.596348
##   0.02    5    2.082575  0.8180478  1.705675
##   0.02    6    2.414145  0.7730944  1.891141
##   0.02    7    2.409065  0.7745675  1.915445
##   0.02    8    2.435317  0.7650026  2.013716
##   0.02    9    2.584975  0.7503707  2.044301
##   0.02   10    2.405229  0.7562320  1.908182
##   0.03    1    2.383746  0.7633527  1.870546
##   0.03    2    2.454290  0.7514461  1.908840
##   0.03    3    2.217704  0.7918645  1.719262
##   0.03    4    2.050625  0.8289918  1.608316
##   0.03    5    2.102705  0.8161141  1.679154
##   0.03    6    2.211142  0.7992296  1.745093
##   0.03    7    2.391308  0.7723404  1.958513
##   0.03    8    2.639188  0.7333796  2.081299
##   0.03    9    2.193183  0.8034147  1.740475
##   0.03   10    2.386450  0.7629278  1.873561
##   0.04    1    2.384438  0.7629684  1.869899
##   0.04    2    2.450467  0.7539379  1.942115
##   0.04    3    2.199523  0.7993416  1.737917
##   0.04    4    2.016975  0.8198140  1.649942
##   0.04    5    2.069597  0.8195621  1.654101
##   0.04    6    2.315627  0.7842001  1.837216
##   0.04    7    2.331788  0.7731338  1.839560
##   0.04    8    2.411618  0.7677358  1.890454
##   0.04    9    2.360925  0.7745422  1.896727
##   0.04   10    2.238863  0.7864714  1.779224
##   0.05    1    2.386109  0.7627911  1.870035
##   0.05    2    2.360599  0.7701985  1.847652
##   0.05    3    2.176532  0.7942336  1.721067
##   0.05    4    1.977518  0.8319675  1.549494
##   0.05    5    2.083588  0.8206270  1.678024
##   0.05    6    2.201673  0.8021564  1.786855
##   0.05    7    2.339674  0.7797736  1.833052
##   0.05    8    2.372672  0.7664515  1.886467
##   0.05    9    2.419643  0.7611444  1.935209
##   0.05   10    2.252022  0.7894785  1.813213
##   0.06    1    2.388128  0.7623863  1.871239
##   0.06    2    2.377274  0.7637839  1.883250
##   0.06    3    2.145231  0.8023846  1.698228
##   0.06    4    2.030444  0.8220632  1.619815
##   0.06    5    2.019334  0.8290427  1.579891
##   0.06    6    2.104081  0.8172304  1.676594
##   0.06    7    2.141941  0.8121311  1.741943
##   0.06    8    2.264920  0.7973905  1.774783
##   0.06    9    2.504734  0.7454076  1.934063
##   0.06   10    2.407879  0.7646765  1.874436
##   0.07    1    2.388737  0.7621763  1.870702
##   0.07    2    2.473526  0.7461275  1.958137
##   0.07    3    2.111039  0.8094795  1.693624
##   0.07    4    2.074931  0.8166422  1.599258
##   0.07    5    1.969976  0.8312649  1.590712
##   0.07    6    2.150874  0.8053445  1.722743
##   0.07    7    2.407378  0.7672085  1.903367
##   0.07    8    2.592483  0.7373282  2.064595
##   0.07    9    2.426241  0.7517220  1.906753
##   0.07   10    2.345099  0.7739126  1.857714
##   0.08    1    2.388303  0.7621290  1.869889
##   0.08    2    2.501862  0.7459779  1.993047
##   0.08    3    2.082786  0.8151120  1.656598
##   0.08    4    1.997009  0.8299575  1.568438
##   0.08    5    2.069612  0.8170014  1.650303
##   0.08    6    2.192552  0.8067040  1.761656
##   0.08    7    2.209919  0.8034384  1.748902
##   0.08    8    2.498832  0.7637999  1.971576
##   0.08    9    2.353432  0.7861735  1.860627
##   0.08   10    2.438012  0.7506400  1.988893
##   0.09    1    2.391093  0.7617087  1.872667
##   0.09    2    2.448119  0.7535060  1.945496
##   0.09    3    2.138156  0.8069623  1.634501
##   0.09    4    2.023500  0.8279610  1.624832
##   0.09    5    2.059881  0.8263668  1.651843
##   0.09    6    2.142091  0.8139378  1.694527
##   0.09    7    2.224850  0.8037135  1.778493
##   0.09    8    2.314672  0.7774339  1.864141
##   0.09    9    2.332838  0.7753480  1.847349
##   0.09   10    2.385689  0.7711283  1.956335
##   0.10    1    2.392297  0.7614530  1.873813
##   0.10    2    2.424834  0.7584952  1.915808
##   0.10    3    2.174391  0.8008953  1.719494
##   0.10    4    2.036973  0.8242977  1.611291
##   0.10    5    1.973613  0.8371935  1.557636
##   0.10    6    2.257253  0.7915989  1.774801
##   0.10    7    2.213409  0.8004569  1.775937
##   0.10    8    2.359574  0.7756999  1.845723
##   0.10    9    2.425894  0.7553730  1.882439
##   0.10   10    2.343082  0.7739852  1.917299
## 
## Tuning parameter 'bag' was held constant at a value of FALSE
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were size = 5, decay = 0.07 and bag = FALSE.
##      RMSE  Rsquared       MAE 
## 2.2480475 0.8031027 1.6938278

Model Comparison

The best model selected by both RMSE & R2 is MARS.

Question 7.5

Exercise 6.3 describes data for a chemical manufacturing process. Use the same data imputation, data splitting, and pre-processing steps as before and train several nonlinear regression models.

Load Data

The matrix processPredictors contains the 57 predictors (12 describing the input biological material and 45 describing the process predictors) for the 176 manufacturing runs. yield contains the percent yield for each run.

Data Imputation

Imputd mssing values using missFroest package.

##   missForest iteration 1 in progress...done!
##   missForest iteration 2 in progress...done!
##   missForest iteration 3 in progress...done!

(a)

Which nonlinear regression model gives the optimal resampling and test set performance?

Answer: The optimal model is radial SVM. See below:

KNN

## k-Nearest Neighbors 
## 
## 132 samples
##  56 predictor
## 
## Pre-processing: centered (56), scaled (56) 
## Resampling: Bootstrapped (25 reps) 
## Summary of sample sizes: 132, 132, 132, 132, 132, 132, ... 
## Resampling results across tuning parameters:
## 
##   k   RMSE      Rsquared   MAE     
##    5  1.551795  0.3241916  1.229662
##    7  1.509729  0.3451176  1.204782
##    9  1.491200  0.3583055  1.203081
##   11  1.466583  0.3820689  1.185985
##   13  1.463003  0.3894212  1.176979
##   15  1.472545  0.3814257  1.192809
##   17  1.479893  0.3784425  1.195397
##   19  1.480769  0.3841633  1.195457
##   21  1.479273  0.3919096  1.200877
##   23  1.483252  0.3992531  1.201789
## 
## RMSE was used to select the optimal model using the smallest value.
## The final value used for the model was k = 13.
##      RMSE  Rsquared       MAE 
## 1.4678782 0.3897311 1.2356481

SVM-Linear

## Support Vector Machines with Linear Kernel 
## 
## 132 samples
##  57 predictor
## 
## Pre-processing: centered (57), scaled (57) 
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 117, 119, 119, 119, 120, 119, ... 
## Resampling results:
## 
##   RMSE      Rsquared  MAE     
##   4.256036  0.400964  1.961182
## 
## Tuning parameter 'C' was held constant at a value of 1
## Support Vector Machine object of class "ksvm" 
## 
## SV type: eps-svr  (regression) 
##  parameter : epsilon = 0.1  cost C = 1 
## 
## Linear (vanilla) kernel function. 
## 
## Number of Support Vectors : 116 
## 
## Objective Function Value : -31.6826 
## Training error : 0.237728
##      RMSE  Rsquared       MAE 
## 2.5920541 0.2407341 1.3461138

SVM-Radial

## Support Vector Machines with Radial Basis Function Kernel 
## 
## 132 samples
##  57 predictor
## 
## Pre-processing: centered (57), scaled (57) 
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 117, 119, 119, 119, 120, 119, ... 
## Resampling results across tuning parameters:
## 
##   C        RMSE      Rsquared   MAE      
##      0.25  1.421498  0.4527061  1.1628997
##      0.50  1.314494  0.5092712  1.0781953
##      1.00  1.239404  0.5479787  1.0061873
##      2.00  1.188196  0.5684967  0.9653448
##      4.00  1.181656  0.5668905  0.9655505
##      8.00  1.173050  0.5699283  0.9611789
##     16.00  1.171625  0.5704403  0.9592864
##     32.00  1.171625  0.5704403  0.9592864
##     64.00  1.171625  0.5704403  0.9592864
##    128.00  1.171625  0.5704403  0.9592864
##    256.00  1.171625  0.5704403  0.9592864
##    512.00  1.171625  0.5704403  0.9592864
##   1024.00  1.171625  0.5704403  0.9592864
##   2048.00  1.171625  0.5704403  0.9592864
## 
## Tuning parameter 'sigma' was held constant at a value of 0.01388288
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were sigma = 0.01388288 and C = 16.
## Support Vector Machine object of class "ksvm" 
## 
## SV type: eps-svr  (regression) 
##  parameter : epsilon = 0.1  cost C = 16 
## 
## Gaussian Radial Basis kernel function. 
##  Hyperparameter : sigma =  0.0138828772878836 
## 
## Number of Support Vectors : 116 
## 
## Objective Function Value : -81.3542 
## Training error : 0.009159
##      RMSE  Rsquared       MAE 
## 1.1957521 0.6021279 0.9150740

SVM-Polynomial

## Support Vector Machines with Polynomial Kernel 
## 
## 132 samples
##  57 predictor
## 
## Pre-processing: centered (57), scaled (57) 
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 117, 119, 119, 119, 120, 119, ... 
## Resampling results across tuning parameters:
## 
##   degree  scale  C     RMSE        Rsquared   MAE      
##   1       0.001  0.25    1.683264  0.3746725   1.377157
##   1       0.001  0.50    1.606614  0.3957547   1.318496
##   1       0.001  1.00    1.524060  0.4172733   1.243002
##   1       0.001  2.00    1.498827  0.4607211   1.179196
##   1       0.010  0.25    1.522099  0.4699540   1.169305
##   1       0.010  0.50    1.620679  0.4926258   1.179766
##   1       0.010  1.00    1.634714  0.5093664   1.138212
##   1       0.010  2.00    1.696997  0.4897924   1.152637
##   1       0.100  0.25    1.687421  0.4733905   1.154785
##   1       0.100  0.50    1.948745  0.4478448   1.242430
##   1       0.100  1.00    2.083795  0.4357293   1.280166
##   1       0.100  2.00    2.136063  0.4324949   1.284946
##   1       1.000  0.25    2.464643  0.4262428   1.387340
##   1       1.000  0.50    3.215053  0.4162814   1.630072
##   1       1.000  1.00    4.255734  0.4009670   1.961093
##   1       1.000  2.00    4.963163  0.3818179   2.189860
##   2       0.001  0.25    1.601207  0.4001036   1.314176
##   2       0.001  0.50    1.537789  0.4144653   1.248557
##   2       0.001  1.00    1.579477  0.4570835   1.203609
##   2       0.001  2.00    1.756289  0.4775600   1.226604
##   2       0.010  0.25    1.876932  0.4684323   1.243554
##   2       0.010  0.50    1.354650  0.5075909   1.052072
##   2       0.010  1.00    1.416567  0.4917575   1.060609
##   2       0.010  2.00    2.479736  0.4385817   1.356142
##   2       0.100  0.25    9.815126  0.4219278   3.438655
##   2       0.100  0.50   10.098146  0.4156893   3.512786
##   2       0.100  1.00   10.098146  0.4156893   3.512786
##   2       0.100  2.00   10.098146  0.4156893   3.512786
##   2       1.000  0.25   27.407013  0.2765334   8.469170
##   2       1.000  0.50   27.407013  0.2765334   8.469170
##   2       1.000  1.00   27.407013  0.2765334   8.469170
##   2       1.000  2.00   27.407013  0.2765334   8.469170
##   3       0.001  0.25    1.590442  0.3987141   1.285375
##   3       0.001  0.50    1.638400  0.4372220   1.251221
##   3       0.001  1.00    1.980782  0.4577857   1.304568
##   3       0.001  2.00    2.348464  0.4862026   1.379246
##   3       0.010  0.25   15.427151  0.4710504   4.968457
##   3       0.010  0.50   17.930107  0.4836357   5.635979
##   3       0.010  1.00   33.242438  0.4295094   9.890216
##   3       0.010  2.00   51.109826  0.4180338  14.852286
##   3       0.100  0.25  185.532776  0.4399172  52.180195
##   3       0.100  0.50  185.532776  0.4399172  52.180195
##   3       0.100  1.00  185.532776  0.4399172  52.180195
##   3       0.100  2.00  185.532776  0.4399172  52.180195
##   3       1.000  0.25  180.203946  0.3697730  50.768973
##   3       1.000  0.50  180.203946  0.3697730  50.768973
##   3       1.000  1.00  180.203946  0.3697730  50.768973
##   3       1.000  2.00  180.203946  0.3697730  50.768973
## 
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were degree = 2, scale = 0.01 and C = 0.5.
## Support Vector Machine object of class "ksvm" 
## 
## SV type: eps-svr  (regression) 
##  parameter : epsilon = 0.1  cost C = 0.5 
## 
## Polynomial kernel function. 
##  Hyperparameters : degree =  2  scale =  0.01  offset =  1 
## 
## Number of Support Vectors : 120 
## 
## Objective Function Value : -23.7109 
## Training error : 0.251737
##       RMSE   Rsquared        MAE 
## 4.71511318 0.02416611 1.56883546

MARS

## Multivariate Adaptive Regression Spline 
## 
## 132 samples
##  57 predictor
## 
## No pre-processing
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 117, 119, 119, 119, 120, 119, ... 
## Resampling results across tuning parameters:
## 
##   degree  nprune  RMSE      Rsquared   MAE      
##   1        2      1.375678  0.4502209  1.0968022
##   1        3      1.164807  0.5986966  0.9562711
##   1        4      1.163736  0.6264452  0.9468020
##   1        5      1.202425  0.5978173  0.9740852
##   1        6      1.189325  0.6083079  0.9544333
##   1        7      1.211895  0.5680295  0.9813838
##   1        8      1.181037  0.6154397  0.9635183
##   1        9      1.177400  0.6205997  0.9780710
##   1       10      1.207724  0.6024369  0.9701158
##   1       11      1.161506  0.6284988  0.9467581
##   1       12      1.158087  0.6209042  0.9402577
##   1       13      1.176768  0.6264094  0.9489019
##   1       14      1.190565  0.6103812  0.9586550
##   1       15      1.196750  0.6090927  0.9658895
##   1       16      1.196750  0.6090927  0.9658895
##   1       17      1.196750  0.6090927  0.9658895
##   1       18      1.196750  0.6090927  0.9658895
##   1       19      1.196750  0.6090927  0.9658895
##   1       20      1.196750  0.6090927  0.9658895
##   1       21      1.196750  0.6090927  0.9658895
##   1       22      1.196750  0.6090927  0.9658895
##   1       23      1.196750  0.6090927  0.9658895
##   1       24      1.196750  0.6090927  0.9658895
##   1       25      1.196750  0.6090927  0.9658895
##   1       26      1.196750  0.6090927  0.9658895
##   1       27      1.196750  0.6090927  0.9658895
##   1       28      1.196750  0.6090927  0.9658895
##   1       29      1.196750  0.6090927  0.9658895
##   1       30      1.196750  0.6090927  0.9658895
##   1       31      1.196750  0.6090927  0.9658895
##   1       32      1.196750  0.6090927  0.9658895
##   1       33      1.196750  0.6090927  0.9658895
##   1       34      1.196750  0.6090927  0.9658895
##   1       35      1.196750  0.6090927  0.9658895
##   1       36      1.196750  0.6090927  0.9658895
##   1       37      1.196750  0.6090927  0.9658895
##   1       38      1.196750  0.6090927  0.9658895
##   2        2      1.375678  0.4502209  1.0968022
##   2        3      1.282556  0.5430144  1.0304046
##   2        4      1.255658  0.5621046  1.0258003
##   2        5      1.276373  0.5279753  1.0307734
##   2        6      1.298958  0.5221774  1.0388639
##   2        7      1.283178  0.5500904  1.0179494
##   2        8      1.266318  0.5656429  0.9990201
##   2        9      1.246332  0.5835004  0.9978897
##   2       10      1.252962  0.5779382  1.0082517
##   2       11      1.308158  0.5420952  1.0459230
##   2       12      1.340706  0.5404366  1.0720183
##   2       13      3.517883  0.4704572  1.7114485
##   2       14      3.563824  0.4414633  1.7368568
##   2       15      3.637768  0.4160540  1.7820021
##   2       16      3.665263  0.4209541  1.7956450
##   2       17      3.668593  0.4168348  1.8078235
##   2       18      3.665984  0.4211707  1.8020251
##   2       19      3.670239  0.4189316  1.8017304
##   2       20      3.671178  0.4187977  1.8032385
##   2       21      3.671178  0.4187977  1.8032385
##   2       22      3.671178  0.4187977  1.8032385
##   2       23      3.671178  0.4187977  1.8032385
##   2       24      3.671178  0.4187977  1.8032385
##   2       25      3.671178  0.4187977  1.8032385
##   2       26      3.671178  0.4187977  1.8032385
##   2       27      3.671178  0.4187977  1.8032385
##   2       28      3.671178  0.4187977  1.8032385
##   2       29      3.671178  0.4187977  1.8032385
##   2       30      3.671178  0.4187977  1.8032385
##   2       31      3.671178  0.4187977  1.8032385
##   2       32      3.671178  0.4187977  1.8032385
##   2       33      3.671178  0.4187977  1.8032385
##   2       34      3.671178  0.4187977  1.8032385
##   2       35      3.671178  0.4187977  1.8032385
##   2       36      3.671178  0.4187977  1.8032385
##   2       37      3.671178  0.4187977  1.8032385
##   2       38      3.671178  0.4187977  1.8032385
## 
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were nprune = 12 and degree = 1.
## Selected 11 of 22 terms, and 8 of 57 predictors (nprune=12)
## Termination condition: RSq changed by less than 0.001 at 22 terms
## Importance: ManufacturingProcess32, ManufacturingProcess09, ...
## Number of terms at each degree of interaction: 1 10 (additive model)
## GCV 0.9907559    RSS 92.47805    GRSq 0.7100006    RSq 0.7917905
##      RMSE  Rsquared       MAE 
## 1.4430421 0.4781265 1.0992813

Neural Networks

## Model Averaged Neural Network 
## 
## 132 samples
##  34 predictor
## 
## Pre-processing: centered (34), scaled (34) 
## Resampling: Cross-Validated (10 fold) 
## Summary of sample sizes: 117, 119, 119, 119, 120, 119, ... 
## Resampling results across tuning parameters:
## 
##   decay  size  RMSE      Rsquared   MAE     
##   0.01    1    1.427451  0.3887460  1.130936
##   0.01    2    1.620553  0.3115423  1.273391
##   0.01    3    1.853994  0.3336499  1.392409
##   0.01    4    2.051651  0.2761899  1.630915
##   0.01    5    1.942580  0.3168311  1.601149
##   0.01    6    1.732200  0.3285281  1.411282
##   0.01    7    2.083488  0.2152749  1.640340
##   0.01    8    2.468403  0.2522522  1.839822
##   0.01    9    2.767764  0.2937365  2.088256
##   0.01   10    4.280530  0.1917860  2.858685
##   0.02    1    1.458798  0.3932435  1.155685
##   0.02    2    1.807918  0.3606960  1.359665
##   0.02    3    1.868123  0.3139632  1.450237
##   0.02    4    2.012758  0.3266285  1.583753
##   0.02    5    1.985378  0.3310082  1.528892
##   0.02    6    1.991248  0.2337125  1.560010
##   0.02    7    1.973326  0.3729903  1.524827
##   0.02    8    2.374413  0.2662972  1.840226
##   0.02    9    2.775930  0.2388662  2.006360
##   0.02   10    3.335813  0.2025044  2.431955
##   0.03    1    1.585242  0.3755848  1.227608
##   0.03    2    1.476757  0.4260359  1.174995
##   0.03    3    1.754745  0.2935537  1.349305
##   0.03    4    1.741521  0.3285667  1.313340
##   0.03    5    1.957692  0.3043973  1.494413
##   0.03    6    1.826346  0.3608158  1.490702
##   0.03    7    1.929869  0.3252210  1.505998
##   0.03    8    2.637620  0.3372921  1.978753
##   0.03    9    3.060518  0.1620072  2.362720
##   0.03   10    3.444545  0.2101038  2.405551
##   0.04    1    1.353552  0.4628707  1.076860
##   0.04    2    1.380306  0.4613384  1.087277
##   0.04    3    1.783514  0.3094794  1.458493
##   0.04    4    2.235161  0.2559330  1.661532
##   0.04    5    1.736656  0.3246556  1.494199
##   0.04    6    1.716645  0.3638087  1.441975
##   0.04    7    1.841973  0.3574257  1.492535
##   0.04    8    2.249882  0.2919924  1.753178
##   0.04    9    3.427715  0.2450564  2.382084
##   0.04   10    3.924570  0.2698836  2.694337
##   0.05    1    1.420437  0.4155736  1.118680
##   0.05    2    1.430306  0.4258002  1.142858
##   0.05    3    1.637061  0.3830650  1.330358
##   0.05    4    1.970178  0.3346820  1.585407
##   0.05    5    1.980557  0.3214543  1.591256
##   0.05    6    1.789672  0.3592004  1.464016
##   0.05    7    1.721217  0.3919702  1.431492
##   0.05    8    2.368348  0.2823875  1.906301
##   0.05    9    3.026458  0.2189595  2.285271
##   0.05   10    3.731834  0.2576779  2.408524
##   0.06    1    1.411942  0.4275929  1.141417
##   0.06    2    1.539923  0.3857977  1.220320
##   0.06    3    1.607675  0.3650410  1.236290
##   0.06    4    1.978821  0.2765915  1.565986
##   0.06    5    1.595173  0.4233449  1.285335
##   0.06    6    1.908092  0.2671835  1.533573
##   0.06    7    1.997003  0.2810350  1.614707
##   0.06    8    2.239182  0.2804457  1.782907
##   0.06    9    3.323601  0.1700343  2.358865
##   0.06   10    3.581164  0.2102110  2.659024
##   0.07    1    1.368715  0.4580374  1.102102
##   0.07    2    1.411459  0.4672564  1.136610
##   0.07    3    1.643834  0.3728565  1.327541
##   0.07    4    2.084341  0.2980537  1.565960
##   0.07    5    1.881413  0.3267361  1.520333
##   0.07    6    1.607724  0.3758301  1.274806
##   0.07    7    1.989687  0.3775952  1.547057
##   0.07    8    2.268318  0.2719314  1.768904
##   0.07    9    3.123147  0.2661343  2.110991
##   0.07   10    3.519479  0.2090979  2.466776
##   0.08    1    1.430320  0.4252740  1.177936
##   0.08    2    1.469452  0.4249909  1.201104
##   0.08    3    1.548482  0.3915762  1.178563
##   0.08    4    1.837766  0.2933293  1.433302
##   0.08    5    1.958125  0.2778207  1.557876
##   0.08    6    1.708796  0.3720530  1.344469
##   0.08    7    1.982597  0.3160837  1.541975
##   0.08    8    2.584283  0.2153725  2.136519
##   0.08    9    3.254148  0.1979960  2.223982
##   0.08   10    3.690224  0.2249961  2.357296
##   0.09    1    1.443055  0.4039372  1.169081
##   0.09    2    1.626104  0.3488965  1.262790
##   0.09    3    1.777321  0.3268011  1.339624
##   0.09    4    2.068568  0.2584575  1.690297
##   0.09    5    1.866494  0.3021558  1.456848
##   0.09    6    1.841506  0.2957539  1.521895
##   0.09    7    1.833741  0.3178940  1.460764
##   0.09    8    2.105591  0.3485138  1.628470
##   0.09    9    2.792763  0.2567766  2.040789
##   0.09   10    3.720309  0.2148692  2.518638
##   0.10    1    1.388405  0.4456244  1.137111
##   0.10    2    1.497681  0.4079854  1.210880
##   0.10    3    1.775107  0.3515419  1.395480
##   0.10    4    1.838054  0.3112919  1.452439
##   0.10    5    1.791878  0.2910324  1.473367
##   0.10    6    1.767500  0.3594731  1.397193
##   0.10    7    1.849339  0.3735993  1.456400
##   0.10    8    2.223509  0.3214700  1.662424
##   0.10    9    2.868613  0.3067745  2.076558
##   0.10   10    3.553018  0.2153736  2.439118
## 
## Tuning parameter 'bag' was held constant at a value of FALSE
## RMSE was used to select the optimal model using the smallest value.
## The final values used for the model were size = 1, decay = 0.04 and bag = FALSE.
##      RMSE  Rsquared       MAE 
## 1.2317267 0.5703354 0.9433186

Model Comparison

The best model selected by both RMSE & R2 is Radial SVM.

(b)

Which predictors are most important in the optimal nonlinear regression model? Do either the biological or process variables dominate the list? How do the top ten important predictors compare to the top ten predictors from the optimal linear model??

Top Impoartant Predictors

Anwer: 1) The tap 10 most important of the optimal nonlinear model (here the radial SVM model).

  1. Manufacturing Process variables domiate the list.

  2. The top 10 important predoctors selected by the radial SVM and Elastic Net model are the same.

Optimal linear model in #6.3

Comparison

(c)

Explore the relationships between the top predictors and the response for the predictors that are unique to the optimal nonlinear regression model. Do these plots reveal intuition about the biological or process predictors and their relationship with yield?

Answer: As observed from the correlation plot, all biological material (BM) predictors have postive correlationship with the response variable Yield, while the manufacturing process (MP) predictors are overallly have overall smaller positive correlation with Yield than those of BMs, or have negative correslation with Yield. In future runs of manufacturing process, those individual MP predictors with small absolute value of correlation values can be further analysed and improvement actions can be taken to such MP steps in order to increase the yield so as to boost revenue.