Browse code

Merge pull request #67 from SydneyBioX/master

presets HTML Article and extraParams Can Remove a Parameter

Dario Strbenac authored on 10/02/2023 04:50:28 • GitHub committed on 10/02/2023 04:50:28
Showing 7 changed files

... ...
@@ -7,4 +7,5 @@ vignettes/introduction.Rmd
7 7
 vignettes/performanceEvaluation.Rmd
8 8
 vignettes/multiViewMethods.Rmd
9 9
 vignettes/incorporateNew.Rmd
10
+vignettes/presets.Rmd
10 11
 ^\.github$
... ...
@@ -3,7 +3,7 @@ Type: Package
3 3
 Title: A framework for cross-validated classification problems, with
4 4
        applications to differential variability and differential
5 5
        distribution testing
6
-Version: 3.3.11
6
+Version: 3.3.12
7 7
 Date: 2023-02-10
8 8
 Authors@R:
9 9
     c(
... ...
@@ -21,7 +21,8 @@
21 21
 #' of survival information, time must be in first column and event status in the second.
22 22
 #' @param extraParams A list of parameters that will be used to overwrite default settings of transformation, selection, or model-building functions or
23 23
 #' parameters which will be passed into the data cleaning function. The names of the list must be one of \code{"prepare"},
24
-#' \code{"select"}, \code{"train"}, \code{"predict"}.
24
+#' \code{"select"}, \code{"train"}, \code{"predict"}. To remove one of the defaults (see the article titled Parameter Tuning Presets for crossValidate and Their Customisation on
25
+#' the website), specify the list element to be \code{NULL}.
25 26
 #' @param nFeatures The number of features to be used for classification. If this is a single number, the same number of features will be used for all comparisons
26 27
 #' or assays. If a numeric vector these will be optimised over using \code{selectionOptimisation}. If a named vector with the same names of multiple assays, 
27 28
 #' a different number of features will be used for each assay. If a named list of vectors, the respective number of features will be optimised over. 
... ...
@@ -622,10 +623,15 @@ generateModellingParams <- function(assayIDs,
622 623
         {
623 624
           if(is.null(classifierParams$trainParams@otherParams)) classifierParams$trainParams@otherParams <- extraParams[["train"]][paramIndex]
624 625
           else classifierParams$trainParams@otherParams[parameterName] <- parameter
625
-        } else {
626
+        } else if(length(parameter) > 1) {
626 627
           if(is.null(classifierParams$trainParams@tuneParams)) classifierParams$trainParams@tuneParams <- extraParams[["train"]][paramIndex]
627 628
           else classifierParams$trainParams@tuneParams[parameterName] <- parameter # Multiple values, so tune them.
628
-        }
629
+        } else { # Remove the parameter
630
+          inOther <- match(parameterName, names(classifierParams$trainParams@otherParams))
631
+          inTune <- match(parameterName, names(classifierParams$trainParams@tuneParams))
632
+          if(!is.na(inOther)) classifierParams$trainParams@otherParams <- classifierParams$trainParams@otherParams[-inOther]
633
+          if(!is.na(inTune)) classifierParams$trainParams@tuneParams <- classifierParams$trainParams@tuneParams[-inTune]
634
+        } 
629 635
       }
630 636
     }
631 637
     if(!is.null(extraParams) && "predict" %in% names(extraParams))
... ...
@@ -638,10 +644,15 @@ generateModellingParams <- function(assayIDs,
638 644
         {
639 645
           if(is.null(classifierParams$predictParams@otherParams)) classifierParams$predictParams@otherParams <- extraParams[["predict"]][paramIndex]
640 646
           else classifierParams$predictParams@otherParams[parameterName] <- parameter
641
-        } else {
647
+        } else if(length(parameter) > 1) {
642 648
           if(is.null(classifierParams$predictParams@tuneParams)) classifierParams$predictParams@tuneParams <- extraParams[["predict"]][paramIndex]
643 649
           else classifierParams$predictParams@tuneParams[parameterName] <- parameter # Multiple values, so tune them.
644
-        }
650
+        } else { # Remove the parameter
651
+          inOther <- match(parameterName, names(classifierParams$predictParams@otherParams))
652
+          inTune <- match(parameterName, names(classifierParams$predictParams@tuneParams))
653
+          if(!is.na(inOther)) classifierParams$predictParams@otherParams <- classifierParams$predictParams@otherParams[-inOther]
654
+          if(!is.na(inTune)) classifierParams$predictParams@tuneParams <- classifierParams$predictParams@tuneParams[-inTune]
655
+        } 
645 656
       }
646 657
     }    
647 658
     
... ...
@@ -661,9 +672,14 @@ generateModellingParams <- function(assayIDs,
661 672
           {
662 673
             if(is.null(classifierParams$selectParams@otherParams)) classifierParams$selectParams@otherParams <- extraParams[["select"]][paramIndex]
663 674
             else classifierParams$selectParams@otherParams[parameterName] <- parameter
664
-          } else {
675
+          } else if(length(parameter) > 1) {
665 676
             if(is.null(classifierParams$selectParams@tuneParams)) classifierParams$selectParams@tuneParams <- extraParams[["select"]][paramIndex]
666 677
             else classifierParams$selectParams@tuneParams[parameterName] <- parameter # Multiple values, so tune them.
678
+          } else { # Remove the parameter
679
+             inOther <- match(parameterName, names(classifierParams$selectParams@otherParams))
680
+             inTune <- match(parameterName, names(classifierParams$selectParams@tuneParams))
681
+             if(!is.na(inOther)) classifierParams$selectParams@otherParams <- classifierParams$selectParams@otherParams[-inOther]
682
+             if(!is.na(inTune)) classifierParams$selectParams@tuneParams <- classifierParams$selectParams@tuneParams[-inTune]
667 683
           }
668 684
         }
669 685
       }
... ...
@@ -890,7 +906,7 @@ train.data.frame <- function(x, outcomeTrain, ...)
890 906
 #' @method train DataFrame
891 907
 #' @export
892 908
 train.DataFrame <- function(x, outcomeTrain, selectionMethod = "auto", nFeatures = 20, classifier = "auto", performanceType = "auto",
893
-                            multiViewMethod = "none", assayIDs = "all", extraParams = NULL)
909
+                            multiViewMethod = "none", assayIDs = "all", extraParams = NULL, ...)
894 910
                    {
895 911
               prepParams <- list(x, outcomeTrain)
896 912
               if(!is.null(extraParams) && "prepare" %in% names(extraParams))
... ...
@@ -950,9 +966,14 @@ train.DataFrame <- function(x, outcomeTrain, selectionMethod = "auto", nFeatures
950 966
                                         {
951 967
                                           if(is.null(classifierParams$trainParams@otherParams)) classifierParams$trainParams@otherParams <- extraParams[["train"]][paramIndex]
952 968
                                           else classifierParams$trainParams@otherParams[parameterName] <- parameter
953
-                                        } else {
969
+                                        } else if (length(parameter) > 1) {
954 970
                                           if(is.null(classifierParams$trainParams@tuneParams)) classifierParams$trainParams@tuneParams <- extraParams[["train"]][paramIndex]
955 971
                                           else classifierParams$trainParams@tuneParams[parameterName] <- parameter # Multiple values, so tune them.
972
+                                        } else { # Remove the parameter
973
+                                          inOther <- match(parameterName, names(classifierParams$trainParams@otherParams))
974
+                                          inTune <- match(parameterName, names(classifierParams$trainParams@tuneParams))
975
+                                          if(!is.na(inOther)) classifierParams$trainParams@otherParams <- classifierParams$trainParams@otherParams[-inOther]
976
+                                          if(!is.na(inTune)) classifierParams$trainParams@tuneParams <- classifierParams$trainParams@otherParams[-inTune]
956 977
                                         }
957 978
                                       }
958 979
                                     }
... ...
@@ -966,10 +987,15 @@ train.DataFrame <- function(x, outcomeTrain, selectionMethod = "auto", nFeatures
966 987
                                         {
967 988
                                           if(is.null(classifierParams$predictParams@otherParams)) classifierParams$predictParams@otherParams <- extraParams[["predict"]][paramIndex]
968 989
                                           else classifierParams$predictParams@otherParams[parameterName] <- parameter
969
-                                        } else {
990
+                                        } else if (length(parameter) > 1) {
970 991
                                           if(is.null(classifierParams$predictParams@tuneParams)) classifierParams$predictParams@tuneParams <- extraParams[["predict"]][paramIndex]
971 992
                                           else classifierParams$predictParams@tuneParams[parameterName] <- parameter # Multiple values, so tune them.
972
-                                        }
993
+                                        } else { # Remove the parameter
994
+                                          inOther <- match(parameterName, names(classifierParams$predictParams@otherParams))
995
+                                          inTune <- match(parameterName, names(classifierParams$predictParams@tuneParams))
996
+                                          if(!is.na(inOther)) classifierParams$predictParams@otherParams <- classifierParams$predictParams@otherParams[-inOther]
997
+                                          if(!is.na(inTune)) classifierParams$predictParams@tuneParams <- classifierParams$predictParams@otherParams[-inTune]
998
+                                        } 
973 999
                                       }
974 1000
                                     }
975 1001
                                   
... ...
@@ -1,77 +1,106 @@
1 1
 <!DOCTYPE html>
2
-<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Articles • ClassifyR</title><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.1.3/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.1.3/bootstrap.bundle.min.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- bootstrap-toc --><script src="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.js"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Articles"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
2
+<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Articles • ClassifyR</title><!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous"><script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css"><script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous"><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet"><script src="../pkgdown.js"></script><meta property="og:title" content="Articles"><!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
3 3
 <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
4 4
 <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
5
-<![endif]--></head><body>
6
-    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>
5
+<![endif]--></head><body data-spy="scroll" data-target="#toc">
7 6
     
8 7
 
9
-    <nav class="navbar fixed-top navbar-dark navbar-expand-lg bg-dark"><div class="container">
10
-    
11
-    <a class="navbar-brand me-2" href="../index.html">ClassifyR</a>
12
-
13
-    <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">3.3.2</small>
14
-
15
-    
16
-    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
17
-      <span class="navbar-toggler-icon"></span>
18
-    </button>
8
+    <div class="container template-article-index">
9
+      <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
10
+  <div class="container">
11
+    <div class="navbar-header">
12
+      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
13
+        <span class="sr-only">Toggle navigation</span>
14
+        <span class="icon-bar"></span>
15
+        <span class="icon-bar"></span>
16
+        <span class="icon-bar"></span>
17
+      </button>
18
+      <span class="navbar-brand">
19
+        <a class="navbar-link" href="../index.html">ClassifyR</a>
20
+        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">3.3.11</span>
21
+      </span>
22
+    </div>
19 23
 
20
-    <div id="navbar" class="collapse navbar-collapse ms-3">
21
-      <ul class="navbar-nav me-auto"><li class="nav-item">
22
-  <a class="nav-link" href="../articles/ClassifyR.html">Get started</a>
23
-</li>
24
-<li class="nav-item">
25
-  <a class="nav-link" href="../reference/index.html">Reference</a>
24
+    <div id="navbar" class="navbar-collapse collapse">
25
+      <ul class="nav navbar-nav"><li>
26
+  <a href="../articles/ClassifyR.html">Get started</a>
26 27
 </li>
27
-<li class="active nav-item">
28
-  <a class="nav-link" href="../articles/index.html">Articles</a>
28
+<li>
29
+  <a href="../reference/index.html">Reference</a>
29 30
 </li>
30
-      </ul><form class="form-inline my-2 my-lg-0" role="search">
31
-        <input type="search" class="form-control me-sm-2" aria-label="Toggle navigation" name="search-input" data-search-index="../search.json" id="search-input" placeholder="Search for" autocomplete="off"></form>
32
-
33
-      <ul class="navbar-nav"></ul></div>
34
-
35
-    
36
-  </div>
37
-</nav><div class="container template-article-index">
38
-<div class="row">
39
-  <main id="main" class="col-md-9"><div class="page-header">
40
-      <img src="" class="logo" alt=""><h1>Articles</h1>
31
+<li class="dropdown">
32
+  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
33
+    Articles
34
+     
35
+    <span class="caret"></span>
36
+  </a>
37
+  <ul class="dropdown-menu" role="menu"><li>
38
+      <a href="../articles/DevelopersGuide.html">**ClassifyR** Developer's Guide</a>
39
+    </li>
40
+    <li>
41
+      <a href="../articles/incorporateNew.html">Creating a Wrapper for New Functionality and Registering It</a>
42
+    </li>
43
+    <li>
44
+      <a href="../articles/introduction.html">Introduction to the Concepts of ClassifyR</a>
45
+    </li>
46
+    <li>
47
+      <a href="../articles/multiViewMethods.html">Multi-view Methods for Modelling of Multiple Data Views</a>
48
+    </li>
49
+    <li>
50
+      <a href="../articles/performanceEvaluation.html">Performance Evaluation of Fitted Models</a>
51
+    </li>
52
+    <li>
53
+      <a href="../articles/presets.html">Parameter Tuning Presets for crossValidate and Their Customisation</a>
54
+    </li>
55
+  </ul></li>
56
+      </ul><ul class="nav navbar-nav navbar-right"></ul></div><!--/.nav-collapse -->
57
+  </div><!--/.container -->
58
+</div><!--/.navbar -->
59
+
60
+      
61
+
62
+      </header><div class="row">
63
+  <div class="col-md-9 contents">
64
+    <div class="page-header">
65
+      <h1>Articles</h1>
41 66
     </div>
42 67
 
43 68
     <div class="section ">
44
-      <h3>Menu</h3>
69
+      <h3>All vignettes</h3>
45 70
       <p class="section-desc"></p>
46 71
 
47
-      <dl><dt><a href="introduction.html">Introduction to the Concepts of ClassifyR</a></dt>
48
-        <dd>
49
-        </dd><dt><a href="performanceEvaluation.html">Performance Evaluation of Fitted Models</a></dt>
72
+      <dl><dt><a href="ClassifyR.html">Getting Started with ClassifyR</a></dt>
50 73
         <dd>
51
-        </dd><dt><a href="multiViewMethods.html">Multi-view Methods for Modelling of Multiple Data Views</a></dt>
74
+        </dd><dt><a href="DevelopersGuide.html">**ClassifyR** Developer's Guide</a></dt>
52 75
         <dd>
53 76
         </dd><dt><a href="incorporateNew.html">Creating a Wrapper for New Functionality and Registering It</a></dt>
54 77
         <dd>
55
-        </dd><dt><a href="ClassifyR.html">An Introduction to **ClassifyR**</a></dt>
78
+        </dd><dt><a href="introduction.html">Introduction to the Concepts of ClassifyR</a></dt>
56 79
         <dd>
57
-        </dd><dt><a href="DevelopersGuide.html">**ClassifyR** Developer's Guide</a></dt>
80
+        </dd><dt><a href="multiViewMethods.html">Multi-view Methods for Modelling of Multiple Data Views</a></dt>
81
+        <dd>
82
+        </dd><dt><a href="performanceEvaluation.html">Performance Evaluation of Fitted Models</a></dt>
83
+        <dd>
84
+        </dd><dt><a href="presets.html">Parameter Tuning Presets for crossValidate and Their Customisation</a></dt>
58 85
         <dd>
59 86
       </dd></dl></div>
60
-  </main></div>
87
+  </div>
88
+</div>
61 89
 
62 90
 
63
-    <footer><div class="pkgdown-footer-left">
91
+      <footer><div class="copyright">
64 92
   <p></p><p>Developed by Dario Strbenac, Ellis Patrick, Sourish Iyengar, Harry Robertson, Andy Tran, John Ormerod, Graham Mann, Jean Yang.</p>
65 93
 </div>
66 94
 
67
-<div class="pkgdown-footer-right">
68
-  <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
95
+<div class="pkgdown">
96
+  <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
69 97
 </div>
70 98
 
71
-    </footer></div>
99
+      </footer></div>
72 100
 
73 101
   
74 102
 
103
+
75 104
   
76 105
 
77 106
   </body></html>
78 107
new file mode 100644
... ...
@@ -0,0 +1,234 @@
1
+<!DOCTYPE html>
2
+<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
3
+<head>
4
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+<meta charset="utf-8">
6
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
7
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
8
+<title>Parameter Tuning Presets for crossValidate and Their Customisation • ClassifyR</title>
9
+<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous">
10
+<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css">
11
+<script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
12
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
13
+<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
14
+<script src="../pkgdown.js"></script><meta property="og:title" content="Parameter Tuning Presets for crossValidate and Their Customisation">
15
+<meta property="og:description" content="ClassifyR">
16
+<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
17
+<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
18
+<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
19
+<![endif]-->
20
+</head>
21
+<body data-spy="scroll" data-target="#toc">
22
+    
23
+
24
+    <div class="container template-article">
25
+      <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
26
+  <div class="container">
27
+    <div class="navbar-header">
28
+      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
29
+        <span class="sr-only">Toggle navigation</span>
30
+        <span class="icon-bar"></span>
31
+        <span class="icon-bar"></span>
32
+        <span class="icon-bar"></span>
33
+      </button>
34
+      <span class="navbar-brand">
35
+        <a class="navbar-link" href="../index.html">ClassifyR</a>
36
+        <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="">3.3.12</span>
37
+      </span>
38
+    </div>
39
+
40
+    <div id="navbar" class="navbar-collapse collapse">
41
+      <ul class="nav navbar-nav">
42
+<li>
43
+  <a href="../articles/ClassifyR.html">Get started</a>
44
+</li>
45
+<li>
46
+  <a href="../reference/index.html">Reference</a>
47
+</li>
48
+<li class="dropdown">
49
+  <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
50
+    Articles
51
+     
52
+    <span class="caret"></span>
53
+  </a>
54
+  <ul class="dropdown-menu" role="menu">
55
+<li>
56
+      <a href="../articles/DevelopersGuide.html">**ClassifyR** Developer's Guide</a>
57
+    </li>
58
+    <li>
59
+      <a href="../articles/incorporateNew.html">Creating a Wrapper for New Functionality and Registering It</a>
60
+    </li>
61
+    <li>
62
+      <a href="../articles/introduction.html">Introduction to the Concepts of ClassifyR</a>
63
+    </li>
64
+    <li>
65
+      <a href="../articles/multiViewMethods.html">Multi-view Methods for Modelling of Multiple Data Views</a>
66
+    </li>
67
+    <li>
68
+      <a href="../articles/performanceEvaluation.html">Performance Evaluation of Fitted Models</a>
69
+    </li>
70
+    <li>
71
+      <a href="../articles/presets.html">Parameter Tuning Presets for crossValidate and Their Customisation</a>
72
+    </li>
73
+  </ul>
74
+</li>
75
+      </ul>
76
+<ul class="nav navbar-nav navbar-right"></ul>
77
+</div>
78
+<!--/.nav-collapse -->
79
+  </div>
80
+<!--/.container -->
81
+</div>
82
+<!--/.navbar -->
83
+
84
+      
85
+
86
+      </header><div class="row">
87
+  <div class="col-md-9 contents">
88
+    <div class="page-header toc-ignore">
89
+      <h1 data-toc-skip>Parameter Tuning Presets for crossValidate and
90
+Their Customisation</h1>
91
+                        <h4 data-toc-skip class="author">Dario Strbenac
92
+<br> The University of Sydney, Australia.</h4>
93
+            
94
+      
95
+      
96
+      <div class="hidden name"><code>presets.Rmd</code></div>
97
+
98
+    </div>
99
+
100
+    
101
+    
102
+<p>When a choice about a model to use is made and specified to
103
+<code>crossValidate</code>, performance tuning of a range of typical
104
+values is automatically made. These values can be changed or removed.
105
+Below is a table of models and their default values, which can be
106
+changed by specifying the <code>extraParams</code> parameter. It is a
107
+list with named elements. Each element must be named one of
108
+<code>"select"</code>, <code>"train"</code> or <code>"predict"</code>
109
+(as well as <code>"prepare"</code> for data preparation which is not a
110
+parameter tuning operation, so is not discussed here), to identify which
111
+modelling the parameter corresponds to.</p>
112
+<table class="table">
113
+<colgroup>
114
+<col width="18%">
115
+<col width="27%">
116
+<col width="27%">
117
+<col width="27%">
118
+</colgroup>
119
+<thead><tr class="header">
120
+<th>Model</th>
121
+<th align="center">Keyword</th>
122
+<th align="center">Default Parameters</th>
123
+<th align="center">Other Parameters</th>
124
+</tr></thead>
125
+<tbody>
126
+<tr class="odd">
127
+<td>Random Forest</td>
128
+<td align="center"><code>"randomForest"</code></td>
129
+<td align="center">
130
+<code>mTryProportion = c(0.25, 0.33, 0.50, 0.66, 0.75, 1.00)</code>
131
+and <code>num.trees = c(10, seq(100, 500, 100)</code>
132
+</td>
133
+<td align="center">See <code><a href="https://rdrr.io/pkg/ranger/man/ranger.html" class="external-link">?ranger::ranger</a></code>
134
+</td>
135
+</tr>
136
+<tr class="even">
137
+<td>Random Survival Forest</td>
138
+<td align="center"><code>"randomSurvivalForest"</code></td>
139
+<td align="center">
140
+<code>mTryProportion = c(0.25, 0.33, 0.50, 0.66, 0.75, 1.00)</code>
141
+and <code>num.trees = c(10, seq(100, 500, 100)</code>
142
+</td>
143
+<td align="center">See <code><a href="https://www.randomforestsrc.org//reference/rfsrc.html" class="external-link">?randomForestSRC::rfsrc</a></code>
144
+</td>
145
+</tr>
146
+<tr class="odd">
147
+<td>Extreme Gradient Boosting</td>
148
+<td align="center"><code>"XGB"</code></td>
149
+<td align="center">
150
+<code>mTryProportion = c(0.25, 0.33, 0.50, 0.66, 0.75, 1.00)</code>
151
+and <code>nrounds = c(5, 10, 15)</code>
152
+</td>
153
+<td align="center">See <code><a href="https://rdrr.io/pkg/xgboost/man/xgb.train.html" class="external-link">?xgboost::xgboost</a></code>
154
+</td>
155
+</tr>
156
+<tr class="even">
157
+<td>k Nearest Neighbours</td>
158
+<td align="center"><code>"kNN"</code></td>
159
+<td align="center"><code>k = 1:5</code></td>
160
+<td align="center">See <code><a href="https://rdrr.io/pkg/class/man/knn.html" class="external-link">?class::knn</a></code>
161
+</td>
162
+</tr>
163
+<tr class="odd">
164
+<td>Support Vector Machine</td>
165
+<td align="center"><code>"SVM"</code></td>
166
+<td align="center">
167
+<code>kernel = c("linear", "polynomial", "radial", "sigmoid")</code>
168
+and <code>cost = 10^(-3:3))</code>
169
+</td>
170
+<td align="center">See <code><a href="https://rdrr.io/pkg/e1071/man/svm.html" class="external-link">?e1071::svm</a></code>
171
+</td>
172
+</tr>
173
+<tr class="even">
174
+<td>naive Bayes Kernel</td>
175
+<td align="center"><code>"naiveBayes"</code></td>
176
+<td align="center"><code>difference = c("unweighted", "weighted")</code></td>
177
+<td align="center">
178
+<code>weighting = c("height difference", "crossover distance")</code>
179
+and <code>minDifference</code>, a number 0 or higher.</td>
180
+</tr>
181
+<tr class="odd">
182
+<td>Mixtures of Normals</td>
183
+<td align="center"><code>"mixturesNormals"</code></td>
184
+<td align="center"><code>nbCluster = 1:2</code></td>
185
+<td align="center">
186
+<code>difference = c("unweighted", "weighted")</code>
187
+and
188
+<code>weighting = c("height difference", "crossover distance")</code>
189
+and <code>minDifference</code>, a number 0 or higher.</td>
190
+</tr>
191
+</tbody>
192
+</table>
193
+<p>Note that the last two models are not wrappers but custom
194
+implementations in this package. The weighting parameter specifies how
195
+the differences between classes are calculated. Either the height
196
+difference of a class’s fitted density to another class’s nearest
197
+density is used or the horizontal distance from the measurement value to
198
+the nearest position where the density of that class crosses any other
199
+class. The distances are only used if <code>difference</code> is
200
+<code>weighted</code>. <code>minDifference</code> specifies the minimum
201
+distance between densities for a feature to have a vote for a particular
202
+class. The default of 0 means that every feature votes for the class
203
+which has the highest density at that point, regardless how close the
204
+density of any other class is to it.</p>
205
+  </div>
206
+
207
+  <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
208
+
209
+      </div>
210
+
211
+</div>
212
+
213
+
214
+
215
+      <footer><div class="copyright">
216
+  <p></p>
217
+<p>Developed by Dario Strbenac, Ellis Patrick, Sourish Iyengar, Harry Robertson, Andy Tran, John Ormerod, Graham Mann, Jean Yang.</p>
218
+</div>
219
+
220
+<div class="pkgdown">
221
+  <p></p>
222
+<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
223
+</div>
224
+
225
+      </footer>
226
+</div>
227
+
228
+  
229
+
230
+
231
+  
232
+
233
+  </body>
234
+</html>
... ...
@@ -116,7 +116,8 @@ crossValidate(measurements, outcome, ...)
116 116
   performanceType = "auto",
117 117
   multiViewMethod = "none",
118 118
   assayIDs = "all",
119
-  extraParams = NULL
119
+  extraParams = NULL,
120
+  ...
120 121
 )
121 122
 
122 123
 \method{train}{list}(x, outcomeTrain, ...)
... ...
@@ -170,7 +171,8 @@ with each element being a vector of assays to combine. Special value \code{"all"
170 171
 
171 172
 \item{extraParams}{A list of parameters that will be used to overwrite default settings of transformation, selection, or model-building functions or
172 173
 parameters which will be passed into the data cleaning function. The names of the list must be one of \code{"prepare"},
173
-\code{"select"}, \code{"train"}, \code{"predict"}.}
174
+\code{"select"}, \code{"train"}, \code{"predict"}. To remove one of the defaults (see the article titled Parameter Tuning Presets for crossValidate and Their Customisation on
175
+the website), specify the list element to be \code{NULL}.}
174 176
 
175 177
 \item{x}{Same as \code{measurements} but only training samples.}
176 178
 
177 179
new file mode 100644
... ...
@@ -0,0 +1,23 @@
1
+---
2
+title: "Parameter Tuning Presets for crossValidate and Their Customisation"
3
+author: Dario Strbenac <br>
4
+        The University of Sydney, Australia.
5
+output: 
6
+    BiocStyle::html_document:
7
+        css: style.css
8
+        toc: false
9
+---
10
+
11
+When a choice about a model to use is made and specified to `crossValidate`, performance tuning of a range of typical values is automatically made. These values can be changed or removed. Below is a table of models and their default values, which can be changed by specifying the `extraParams` parameter. It is a list with named elements. Each element must be named one of `"select"`, `"train"` or `"predict"` (as well as `"prepare"` for data preparation which is not a parameter tuning operation, so is not discussed here), to identify which modelling the parameter corresponds to.
12
+
13
+Model | Keyword | Default Parameters | Other Parameters
14
+----|:----:|:----:|:----:
15
+Random Forest | `"randomForest"` | `mTryProportion = c(0.25, 0.33, 0.50, 0.66, 0.75, 1.00)` and `num.trees = c(10, seq(100, 500, 100)` | See `?ranger::ranger` 
16
+Random Survival Forest | `"randomSurvivalForest"` | `mTryProportion = c(0.25, 0.33, 0.50, 0.66, 0.75, 1.00)` and `num.trees = c(10, seq(100, 500, 100)` | See `?randomForestSRC::rfsrc`
17
+Extreme Gradient Boosting | `"XGB"` | `mTryProportion = c(0.25, 0.33, 0.50, 0.66, 0.75, 1.00)` and `nrounds = c(5, 10, 15)` | See `?xgboost::xgboost`
18
+k Nearest Neighbours | `"kNN"` | `k = 1:5` | See `?class::knn`
19
+Support Vector Machine | `"SVM"` | `kernel = c("linear", "polynomial", "radial", "sigmoid")` and  `cost = 10^(-3:3))` | See `?e1071::svm`
20
+naive Bayes Kernel | `"naiveBayes"` | `difference = c("unweighted", "weighted")` | `weighting = c("height difference", "crossover distance")` and `minDifference`, a number 0 or higher.
21
+Mixtures of Normals | `"mixturesNormals"` | `nbCluster = 1:2` | `difference = c("unweighted", "weighted")` and `weighting = c("height difference", "crossover distance")` and `minDifference`, a number 0 or higher.
22
+
23
+Note that the last two models are not wrappers but custom implementations in this package. The weighting parameter specifies how the differences between classes are calculated. Either the height difference of a class's fitted density to another class's nearest density is used or the horizontal distance from the measurement value to the nearest position where the density of that class crosses any other class. The distances are only used if `difference` is `weighted`. `minDifference` specifies the minimum distance between densities for a feature to have a vote for a particular class. The default of 0 means that every feature votes for the class which has the highest density at that point, regardless how close the density of any other class is to it.
0 24
\ No newline at end of file