-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathSaveModel.html
More file actions
420 lines (371 loc) · 23 KB
/
Copy pathSaveModel.html
File metadata and controls
420 lines (371 loc) · 23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<!-- Generated by pkgdown: do not edit by hand -->
<!DOCTYPE html>
<html lang="en">
<head>
<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>Save spectral prediction model and model performance statistics — SaveModel • waves</title>
<!-- favicons -->
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png" />
<link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png" />
<!-- 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="Save spectral prediction model and model performance statistics — SaveModel" />
<meta property="og:description" content="Saves spectral prediction model and model statistics to
model.save.folder as model.name.Rds and
model.name_stats.csv respectively" />
<meta property="og:image" content="/logo.png" />
<!-- 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]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container template-reference-topic">
<header>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">waves</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.1.1.9000</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../index.html">
<span class="fas fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li>
<a href="../news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/GoreLab/waves/">
<span class="fab fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
</header>
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Save spectral prediction model and model performance statistics</h1>
<small class="dont-index">Source: <a href='https://github.com/GoreLab/waves/blob/master/R/SaveModel.R'><code>R/SaveModel.R</code></a></small>
<div class="hidden name"><code>SaveModel.Rd</code></div>
</div>
<div class="ref-description">
<p>Saves spectral prediction model and model statistics to
<code>model.save.folder</code> as <code>model.name.Rds</code> and
<code>model.name_stats.csv</code> respectively</p>
</div>
<pre class="usage"><span class='fu'>SaveModel</span><span class='op'>(</span>
<span class='va'>df</span>,
save.model <span class='op'>=</span> <span class='cn'>TRUE</span>,
autoselect.preprocessing <span class='op'>=</span> <span class='cn'>TRUE</span>,
preprocessing.method <span class='op'>=</span> <span class='cn'>NULL</span>,
model.save.folder <span class='op'>=</span> <span class='cn'>NULL</span>,
model.name <span class='op'>=</span> <span class='st'>"PredictionModel"</span>,
best.model.metric <span class='op'>=</span> <span class='st'>"RMSE"</span>,
tune.length <span class='op'>=</span> <span class='fl'>50</span>,
model.method <span class='op'>=</span> <span class='st'>"pls"</span>,
num.iterations <span class='op'>=</span> <span class='fl'>10</span>,
wavelengths <span class='op'>=</span> <span class='fl'>740</span><span class='op'>:</span><span class='fl'>1070</span>,
stratified.sampling <span class='op'>=</span> <span class='cn'>TRUE</span>,
cv.scheme <span class='op'>=</span> <span class='cn'>NULL</span>,
trial1 <span class='op'>=</span> <span class='cn'>NULL</span>,
trial2 <span class='op'>=</span> <span class='cn'>NULL</span>,
trial3 <span class='op'>=</span> <span class='cn'>NULL</span>,
verbose <span class='op'>=</span> <span class='cn'>TRUE</span>
<span class='op'>)</span></pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>df</th>
<td><p><code>data.frame</code> object. First column contains unique identifiers,
second contains reference values, followed by spectral columns. Include no
other columns to right of spectra! Column names of spectra must start with
"X" and reference column must be named "reference"</p></td>
</tr>
<tr>
<th>save.model</th>
<td><p>If <code>TRUE</code>, the trained model will be saved in .Rds
format to the location specified by <code>model.save.folder</code>. If
<code>FALSE</code>, model will be output by function but will not save to file.
Default is <code>TRUE</code>.</p></td>
</tr>
<tr>
<th>autoselect.preprocessing</th>
<td><p>Boolean that, if <code>TRUE</code>, will choose the
preprocessing method for the saved model using the
<code>best.model.metric</code>. If <code>FALSE</code>, the user must supply the
preprocessing method (1-12, see <code><a href='DoPreprocessing.html'>DoPreprocessing</a>()</code>
documentation for more information) of the saved model. Default is
<code>TRUE</code>.</p></td>
</tr>
<tr>
<th>preprocessing.method</th>
<td><p>Number or list of numbers 1:13 corresponding to
desired pretreatment method(s):</p><ul>
<li><p>1 = raw data (default)</p></li>
<li><p>2 = standard normal variate (SNV)</p></li>
<li><p>3 = SNV and first derivative</p></li>
<li><p>4 = SNV and second derivative</p></li>
<li><p>5 = first derivative</p></li>
<li><p>6 = second derivative</p></li>
<li><p>7 = Savitzky–Golay filter (SG)</p></li>
<li><p>8 = SNV and SG</p></li>
<li><p>9 = gap segment derivative (window size = 11)</p></li>
<li><p>10 = SG and first derivative (window size = 5)</p></li>
<li><p>11 = SG and first derivative (window size = 11)</p></li>
<li><p>12 = SG and second derivative (window size = 5)</p></li>
<li><p>13 = SG and second derivative (window size = 11)</p></li>
</ul></td>
</tr>
<tr>
<th>model.save.folder</th>
<td><p>Path to folder where model will be saved. If not
provided, will save to working directory.</p></td>
</tr>
<tr>
<th>model.name</th>
<td><p>Name that model will be saved as in
<code>model.save.folder</code>. Default is "PredictionModel".</p></td>
</tr>
<tr>
<th>best.model.metric</th>
<td><p>Metric used to decide which model is best. Must be
either "RMSE" or "Rsquared"</p></td>
</tr>
<tr>
<th>tune.length</th>
<td><p>Number delineating search space for tuning of the PLSR
hyperparameter <code>ncomp</code>. Default is 50.</p></td>
</tr>
<tr>
<th>model.method</th>
<td><p>Model type to use for training. Valid options include:</p><ul>
<li><p>"pls": Partial least squares regression (Default)</p></li>
<li><p>"rf": Random forest</p></li>
<li><p>"svmLinear": Support vector machine with linear
kernel</p></li>
<li><p>"svmRadial": Support vector machine with radial kernel</p></li>
</ul></td>
</tr>
<tr>
<th>num.iterations</th>
<td><p>Number of training iterations to perform</p></td>
</tr>
<tr>
<th>wavelengths</th>
<td><p>List of wavelengths represented by each column in
<code>df</code></p></td>
</tr>
<tr>
<th>stratified.sampling</th>
<td><p>If <code>TRUE</code>, training and test sets will be
selected using stratified random sampling. This term is only used if
<code>test.data == NULL</code>. Default is <code>TRUE</code>.</p></td>
</tr>
<tr>
<th>cv.scheme</th>
<td><p>A cross validation (CV) scheme from Jarquín et al., 2017.
Options for cv.scheme include:</p><ul>
<li><p>"CV1": untested lines in tested environments</p></li>
<li><p>"CV2": tested lines in tested environments</p></li>
<li><p>"CV0": tested lines in untested environments</p></li>
<li><p>"CV00": untested lines in untested environments</p></li>
</ul></td>
</tr>
<tr>
<th>trial1</th>
<td><p><code>data.frame</code> object that is for use only when
<code>cv.scheme</code> is provided. Contains the trial to be tested in subsequent
model training functions. The first column contains unique identifiers,
second contains genotypes, third contains reference values, followed by
spectral columns. Include no other columns to right of spectra! Column
names of spectra must start with "X", reference column must be named
"reference", and genotype column must be named "genotype".</p></td>
</tr>
<tr>
<th>trial2</th>
<td><p><code>data.frame</code> object that is for use only when
<code>cv.scheme</code> is provided. This data.frame contains a trial that has
overlapping genotypes with <code>trial1</code> but that were grown in a different
site/year (different environment). Formatting must be consistent with
<code>trial1</code>.</p></td>
</tr>
<tr>
<th>trial3</th>
<td><p><code>data.frame</code> object that is for use only when
<code>cv.scheme</code> is provided. This data.frame contains a trial that may or
may not contain genotypes that overlap with <code>trial1</code>. Formatting must
be consistent with <code>trial1</code>.</p></td>
</tr>
<tr>
<th>verbose</th>
<td><p>If <code>TRUE</code>, the number of rows removed through filtering
will be printed to the console. Default is <code>TRUE</code>.</p></td>
</tr>
</table>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
<p>List of model stats (in <code>data.frame</code>) and trained model object.
Saves both to <code>model.save.folder</code> as well. To use optimally trained
model for predictions, use tuned parameters from <code>$bestTune</code></p>
<h2 class="hasAnchor" id="details"><a class="anchor" href="#details"></a>Details</h2>
<p>Wrapper that uses <code><a href='DoPreprocessing.html'>DoPreprocessing</a></code>,
<code><a href='FormatCV.html'>FormatCV</a></code>, and <code><a href='TrainSpectralModel.html'>TrainSpectralModel</a></code> functions.</p>
<h2 class="hasAnchor" id="author"><a class="anchor" href="#author"></a>Author</h2>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='co'># \donttest{</span>
<span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://magrittr.tidyverse.org'>magrittr</a></span><span class='op'>)</span>
<span class='va'>test.model</span> <span class='op'><-</span> <span class='va'>ikeogu.2017</span> <span class='op'>%>%</span>
<span class='fu'>dplyr</span><span class='fu'>::</span><span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span><span class='op'>(</span><span class='va'>study.name</span> <span class='op'>==</span> <span class='st'>"C16Mcal"</span><span class='op'>)</span> <span class='op'>%>%</span>
<span class='fu'>dplyr</span><span class='fu'>::</span><span class='fu'><a href='https://dplyr.tidyverse.org/reference/rename.html'>rename</a></span><span class='op'>(</span>reference <span class='op'>=</span> <span class='va'>DMC.oven</span><span class='op'>)</span> <span class='op'>%>%</span>
<span class='fu'>dplyr</span><span class='fu'>::</span><span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span><span class='op'>(</span><span class='va'>sample.id</span>, <span class='va'>reference</span>, <span class='fu'>dplyr</span><span class='fu'>::</span><span class='fu'><a href='https://tidyselect.r-lib.org/reference/starts_with.html'>starts_with</a></span><span class='op'>(</span><span class='st'>"X"</span><span class='op'>)</span><span class='op'>)</span> <span class='op'>%>%</span>
<span class='fu'><a href='https://rdrr.io/r/stats/na.fail.html'>na.omit</a></span><span class='op'>(</span><span class='op'>)</span> <span class='op'>%>%</span>
<span class='fu'>SaveModel</span><span class='op'>(</span>df <span class='op'>=</span> <span class='va'>.</span>, save.model <span class='op'>=</span> <span class='cn'>FALSE</span>,
autoselect.preprocessing <span class='op'>=</span> <span class='cn'>TRUE</span>,
model.name <span class='op'>=</span> <span class='st'>"my_prediction_model"</span>,
tune.length <span class='op'>=</span> <span class='fl'>50</span>, num.iterations <span class='op'>=</span> <span class='fl'>10</span>,
wavelengths <span class='op'>=</span> <span class='fl'>350</span><span class='op'>:</span><span class='fl'>2500</span><span class='op'>)</span>
</div><div class='output co'>#> Preprocessing...
#> Training model 1 of 13: (Raw_data).</div><div class='output co'>#> <span class='message'>Loading required package: lattice</span></div><div class='output co'>#> <span class='message'>Loading required package: ggplot2</span></div><div class='output co'>#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 2 of 13: (SNV).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 3 of 13: (SNV1D).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 4 of 13: (SNV2D).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 5 of 13: (D1).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 6 of 13: (D2).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 7 of 13: (SG).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 8 of 13: (SNVSG).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 9 of 13: (SGD1).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 10 of 13: (SG.D1W5).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 11 of 13: (SG.D1W11).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 12 of 13: (SG.D2W5).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#> Training model 13 of 13: (SG.D2W11).
#>
#> Returning model...</div><div class='output co'>#> <span class='warning'>Warning: provided 21 variables to replace 17 variables</span></div><div class='output co'>#>
#> Training Summary:
#> Pretreatment RMSE Rsquared RPD RPIQ CCC Bias
#> 1 Raw_data 1.606611 0.86443860 2.6791213 3.553870 0.9188668 0.14632521
#> 2 SNV 1.617465 0.85747614 2.6517550 3.506820 0.9166633 0.08481619
#> 3 SNV1D 2.769520 0.57447384 1.5595676 2.055783 0.7273762 0.01923099
#> 4 SNV2D 4.734419 0.04473102 0.9087229 1.203707 0.1316837 -0.12981514
#> 5 D1 2.510155 0.64144653 1.7324652 2.283195 0.7704853 0.05677603
#> 6 D2 4.685534 0.05060192 0.9181383 1.216616 0.1396137 -0.06992752
#> 7 SG 1.566773 0.86871326 2.7388477 3.636040 0.9245239 0.12350017
#> 8 SNVSG 1.538586 0.86991804 2.7998941 3.709071 0.9254167 0.10337613
#> 9 SGD1 1.477693 0.88279428 2.9043920 3.874266 0.9354620 0.10573660
#> 10 SG.D1W5 2.105472 0.75857593 2.0360292 2.694982 0.8562363 0.02582945
#> 11 SG.D1W11 1.706059 0.83983349 2.5170849 3.331150 0.9102520 0.02344768
#> 12 SG.D2W5 4.431643 0.06963380 0.9698106 1.289830 0.1933924 -0.18029869
#> 13 SG.D2W11 2.916995 0.53874812 1.4771300 1.958119 0.7068506 0.02368742
#> SEP R2sp RMSE.sd Rsquared.sd RPD.sd RPIQ.sd CCC.sd
#> 1 1.629400 0.9664434 0.9476518 0.86757937 0.1575526 0.03475150 0.34477190
#> 2 1.640408 0.9896866 0.9447618 0.85411469 0.0862863 0.03472313 0.32957567
#> 3 2.808806 0.8121179 0.9413956 0.54684191 0.2349187 0.13583875 0.25190898
#> 4 4.801578 2.4964016 0.5976189 0.04929528 0.3968636 0.05785177 0.11922488
#> 5 2.545762 0.7490173 0.9642992 0.60622791 0.2970020 0.13547279 0.32008852
#> 6 4.751999 2.4705460 0.6040690 0.05249794 0.4040895 0.06489445 0.11811363
#> 7 1.588998 1.0117567 0.9433401 0.86373570 0.1342345 0.03303286 0.29871631
#> 8 1.560411 0.9420298 0.9514194 0.86338127 0.1461339 0.03219045 0.38360471
#> 9 1.498655 0.8614543 0.9591356 0.87171864 0.1658059 0.02143230 0.24267152
#> 10 2.135339 0.8095936 0.9576170 0.72503982 0.1132593 0.05785480 0.24911831
#> 11 1.730260 0.5190804 0.9842840 0.82103605 0.1303047 0.04260078 0.30808034
#> 12 4.494506 2.7170398 0.5332571 0.08598476 0.4683884 0.05746438 0.09927615
#> 13 2.958373 0.9513946 0.9278163 0.47037170 0.2810221 0.12799287 0.19781791
#> Bias.sd SEP.sd R2sp.sd NA
#> 1 0.3619965 0.02553499 0.2646742 0.159787538834462
#> 2 0.1699663 0.02526888 0.2361953 0.0875102752773452
#> 3 0.1645080 0.08983745 0.5019851 0.238250999997268
#> 4 0.1112158 0.10833967 0.8178810 0.402493146506399
#> 5 0.2723527 0.09037000 0.4111572 0.301215046386371
#> 6 0.1137540 0.11576655 0.7917853 0.409821554855555
#> 7 0.3181155 0.01981273 0.2294415 0.136138676308338
#> 8 0.3620474 0.02422825 0.2512978 0.14820677727707
#> 9 0.4507682 0.01170574 0.2032037 0.168157843905494
#> 10 0.1501343 0.04148465 0.3342339 0.114865926652914
#> 11 0.2037924 0.02864509 0.2649881 0.132153066711667
#> 12 0.1367206 0.10513826 0.5955086 0.475032578600728
#> 13 0.2112801 0.09598145 0.4668611 0.285008475908858
#>
#> Best preprocessing technique: SGD1</div><div class='input'><span class='fu'><a href='https://rdrr.io/r/base/summary.html'>summary</a></span><span class='op'>(</span><span class='va'>test.model</span><span class='op'>[</span><span class='fl'>1</span><span class='op'>]</span><span class='op'>)</span>
</div><div class='output co'>#> Length Class Mode
#> [1,] 18 data.frame list</div><div class='input'><span class='va'>test.model</span><span class='op'>[</span><span class='fl'>2</span><span class='op'>]</span>
</div><div class='output co'>#> [[1]]
#> Partial least squares regression , fitted with the kernel algorithm.
#> Call:
#> plsr(formula = reference ~ spectra, ncomp = tune.length, data = df.plsr)
#> </div><div class='input'><span class='co'># }</span>
</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc" class="sticky-top">
<h2 data-toc-skip>Contents</h2>
</nav>
</div>
</div>
<footer>
<div class="copyright">
<p>Developed by Jenna Hershberger, NSF BREAD IOS-1543958.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
</div>
</footer>
</div>
</body>
</html>