Chapter 6 Final notes

6.1 Other learning algorithms

Semi-supervised learning

The idea behind semi-supervised learning is to use labelled observations to guide the determination of relevant structure in the unlabelled data. The figures below described the phenoDisco algorithm described in Breckels et al. (2013).

Semi-supervised learning and novelty detection

Semi-supervised learning and novelty detection

Deep learning in R

This book focuses on introductory material in R. This shouldn’t however give the impression that more modern approaches are not available. R has plenty of activity arounds deep learning such as, for example, the keras package, an interface to Keras, a high-level neural networks API.

See this blog for an introduction.

6.2 Model performance

When investigating multi-class problems, it is good to consider additional performance metrics and to inspect the confusion matrices in more details, to look if some classes suffer from greater mis-classification rates.

Models accuracy can also evaluated using the F1 score, where \(F1 = 2 ~ \frac{precision \times recall}{precision + recall}\), calculated as the harmonic mean of the precision (\(precision = \frac{tp}{tp+fp}\), a measure of exactness – returned output is a relevant result) and recall (\(recall=\frac{tp}{tp+fn}\), a measure of completeness – indicating how much was missed from the output). What we are aiming for are high generalisation accuracy, i.e high \(F1\), indicating that the marker proteins in the test data set are consistently and correctly assigned by the algorithms.

For a multi-class problem, the macro F1 (mean of class F1s) can be used.

6.3 Credit and acknowledgements

Many parts of this course have been influenced by the DataCamp’s Machine Learning with R skill track, in particular the Machine Learning Toolbox (supervised learning chapter) and the Unsupervised Learning in R (unsupervised learning chapter) courses.

Jamie Lendrum has addressed numerous typos in the first version.

The very hands-on approach has also been influenced by the Software and Data Carpentry lessons and teaching styles.

6.4 References and further reading

6.5 Session information

sessionInfo()
## R version 3.6.0 RC (2019-04-21 r76409)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Manjaro Linux
## 
## Matrix products: default
## BLAS:   /usr/lib/libblas.so.3.8.0
## LAPACK: /usr/lib/liblapack.so.3.8.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] Rtsne_0.15          MASS_7.3-51.4       kernlab_0.9-27     
##  [4] impute_1.57.0       randomForest_4.6-14 rpart.plot_3.0.7   
##  [7] rpart_4.1-15        ranger_0.11.2       caTools_1.17.1.2   
## [10] class_7.3-15        knitr_1.22          DT_0.5             
## [13] naivebayes_0.9.5    glmnet_2.0-16       foreach_1.4.4      
## [16] Matrix_1.2-17       caret_6.0-83        lattice_0.20-38    
## [19] C50_0.1.2           mlbench_2.1-1       scales_1.0.0       
## [22] ggplot2_3.1.1       BiocStyle_2.11.0    dplyr_0.8.0.1      
## 
## loaded via a namespace (and not attached):
##  [1] jsonlite_1.6       splines_3.6.0      prodlim_2018.04.18
##  [4] shiny_1.3.2        Formula_1.2-3      assertthat_0.2.1  
##  [7] BiocManager_1.30.4 highr_0.8          stats4_3.6.0      
## [10] yaml_2.2.0         ipred_0.9-8        pillar_1.3.1      
## [13] glue_1.3.1         digest_0.6.18      promises_1.0.1    
## [16] colorspace_1.4-1   recipes_0.1.5      httpuv_1.5.1      
## [19] htmltools_0.3.6    plyr_1.8.4         timeDate_3043.102 
## [22] pkgconfig_2.0.2    bookdown_0.9       xtable_1.8-4      
## [25] purrr_0.3.2        mvtnorm_1.0-10     RANN_2.6.1        
## [28] later_0.8.0        gower_0.2.0        lava_1.6.5        
## [31] Cubist_0.2.2       tibble_2.1.1       generics_0.0.2    
## [34] withr_2.1.2        nnet_7.3-12        lazyeval_0.2.2    
## [37] mime_0.6           survival_2.44-1.1  magrittr_1.5      
## [40] crayon_1.3.4       evaluate_0.13      nlme_3.1-139      
## [43] tools_3.6.0        data.table_1.12.2  stringr_1.4.0     
## [46] munsell_0.5.0      e1071_1.7-1        compiler_3.6.0    
## [49] inum_1.0-0         rlang_0.3.4        grid_3.6.0        
## [52] iterators_1.0.10   rstudioapi_0.10    htmlwidgets_1.3   
## [55] crosstalk_1.0.0    bitops_1.0-6       rmarkdown_1.12    
## [58] partykit_1.2-3     gtable_0.3.0       ModelMetrics_1.2.2
## [61] codetools_0.2-16   reshape2_1.4.3     R6_2.4.0          
## [64] lubridate_1.7.4    libcoin_1.0-4      stringi_1.4.3     
## [67] Rcpp_1.0.1         tidyselect_0.2.5   xfun_0.6