Browse code

rebuild documentation

- due to changes in struct (removal of unicode)

Gavin Rhys Lloyd authored on 02/02/2024 10:50:50
Showing 1 changed files
... ...
@@ -42,7 +42,7 @@ This object makes use of functionality from the following packages:\itemize{  \i
42 42
 \section{Inheritance}{
43 43
 
44 44
 A \code{PLSDA} object inherits the following \code{struct} classes: \cr\cr
45
-\code{PLSDA()} ⭢ \code{PLSR()} ⭢ \code{model()} ⭢ \code{struct_class()}
45
+\verb{[PLSDA]} >> \verb{[PLSR]} >> \verb{[model]} >> \verb{[struct_class]}
46 46
 }
47 47
 
48 48
 \examples{
Browse code

update documentation

- get_description moved to struct and updated

Gavin Rhys Lloyd authored on 31/01/2024 09:48:31
Showing 1 changed files
... ...
@@ -7,11 +7,11 @@
7 7
 PLSDA(number_components = 2, factor_name, pred_method = "max_prob", ...)
8 8
 }
9 9
 \arguments{
10
-\item{number_components}{(numeric, integer) The number of PLS components. The default is \code{2}.}
10
+\item{number_components}{(numeric, integer) The number of PLS components. The default is \code{2}.\cr}
11 11
 
12 12
 \item{factor_name}{(character) The name of a sample-meta column to use.}
13 13
 
14
-\item{pred_method}{(character) Prediction method. Allowed values are limited to the following: \itemize{\item{\code{"max_yhat"}: The predicted group is selected based on the largest value of y_hat.}\item{\code{"max_prob"}: The predicted group is selected based on the largest probability of group membership.}} The default is \code{"max_prob"}.}
14
+\item{pred_method}{(character) Prediction method. Allowed values are limited to the following: \itemize{ \item{\code{"max_yhat"}: The predicted group is selected based on the largest value of y_hat.}\item{\code{"max_prob"}: The predicted group is selected based on the largest probability of group membership.}} The default is \code{"max_prob"}.}
15 15
 
16 16
 \item{...}{Additional slots and values passed to \code{struct_class}.}
17 17
 }
... ...
@@ -37,14 +37,25 @@ A  \code{PLSDA} object with the following \code{output} slots:
37 37
 PLS is a multivariate regression technique that extracts latent variables maximising covariance between the input data and the response. The Discriminant Analysis variant uses group labels in the response variable. For >2 groups a 1-vs-all approach is used. Group membership can be predicted for test samples based on a probability estimate of group membership, or the estimated y-value.
38 38
 }
39 39
 \details{
40
-This object makes use of functionality from the following packages:\itemize{\item{\code{pls}}}
40
+This object makes use of functionality from the following packages:\itemize{  \item{\code{pls}}}
41 41
 }
42
+\section{Inheritance}{
43
+
44
+A \code{PLSDA} object inherits the following \code{struct} classes: \cr\cr
45
+\code{PLSDA()} ⭢ \code{PLSR()} ⭢ \code{model()} ⭢ \code{struct_class()}
46
+}
47
+
42 48
 \examples{
49
+M = PLSDA(
50
+      number_components = 2,
51
+      factor_name = "V1",
52
+      pred_method = "max_prob")
53
+
43 54
 M = PLSDA('number_components'=2,factor_name='Species')
44 55
 }
45 56
 \references{
46 57
 Liland K, Mevik B, Wehrens R (2023). \emph{pls: Partial Least Squares and
47
-Principal Component Regression}. R package version 2.8-2,
58
+Principal Component Regression}. R package version 2.8-3,
48 59
 \url{https://CRAN.R-project.org/package=pls}.
49 60
 
50 61
 Perez NF, Ferre J, Boque R (2009). "Calculation of the reliability of
Browse code

hotfix PLSDA predicted groups

- predicted group now correctly assigned based on ingroup probability or yhat value

Gavin Rhys Lloyd authored on 05/09/2023 15:04:56
Showing 1 changed files
... ...
@@ -4,13 +4,15 @@
4 4
 \alias{PLSDA}
5 5
 \title{Partial least squares discriminant analysis}
6 6
 \usage{
7
-PLSDA(number_components = 2, factor_name, ...)
7
+PLSDA(number_components = 2, factor_name, pred_method = "max_prob", ...)
8 8
 }
9 9
 \arguments{
10 10
 \item{number_components}{(numeric, integer) The number of PLS components. The default is \code{2}.}
11 11
 
12 12
 \item{factor_name}{(character) The name of a sample-meta column to use.}
13 13
 
14
+\item{pred_method}{(character) Prediction method. Allowed values are limited to the following: \itemize{\item{\code{"max_yhat"}: The predicted group is selected based on the largest value of y_hat.}\item{\code{"max_prob"}: The predicted group is selected based on the largest probability of group membership.}} The default is \code{"max_prob"}.}
15
+
14 16
 \item{...}{Additional slots and values passed to \code{struct_class}.}
15 17
 }
16 18
 \value{
... ...
@@ -32,7 +34,7 @@ A  \code{PLSDA} object with the following \code{output} slots:
32 34
 }
33 35
 }
34 36
 \description{
35
-PLS is a multivariate regression technique that extracts latent variables maximising covariance between the input data and the response. The Discriminant Analysis variant uses group labels in the response variable and applies a threshold to the predicted values in order to predict group membership for new samples.
37
+PLS is a multivariate regression technique that extracts latent variables maximising covariance between the input data and the response. The Discriminant Analysis variant uses group labels in the response variable. For >2 groups a 1-vs-all approach is used. Group membership can be predicted for test samples based on a probability estimate of group membership, or the estimated y-value.
36 38
 }
37 39
 \details{
38 40
 This object makes use of functionality from the following packages:\itemize{\item{\code{pls}}}
Browse code

fix documentation

due to roxygen no longer needing % to be escaped.
- add markdown flag to description file
- use text format for citations (includes markdown)
- remove % from descriptions (doesnt work with current implementation)

Gavin Rhys Lloyd authored on 06/07/2023 15:19:12
Showing 1 changed files
... ...
@@ -41,15 +41,15 @@ This object makes use of functionality from the following packages:\itemize{\ite
41 41
 M = PLSDA('number_components'=2,factor_name='Species')
42 42
 }
43 43
 \references{
44
-Liland K, Mevik B, Wehrens R (2022).
45
-\emph{pls: Partial Least Squares and Principal Component Regression}.
46
-R package version 2.8-1, \url{https://CRAN.R-project.org/package=pls}.
44
+Liland K, Mevik B, Wehrens R (2023). \emph{pls: Partial Least Squares and
45
+Principal Component Regression}. R package version 2.8-2,
46
+\url{https://CRAN.R-project.org/package=pls}.
47 47
 
48
-Perez NF, Ferre J, Boque R (2009).
49
-``Calculation of the reliability of classification in discriminant partial least-squares binary classification.''
50
-\emph{Chemometrics and Intelligent Laboratory Systems}, \bold{95}(2), 122-128.
48
+Perez NF, Ferre J, Boque R (2009). "Calculation of the reliability of
49
+classification in discriminant partial least-squares binary
50
+classification." \emph{Chemometrics and Intelligent Laboratory Systems},
51
+\emph{95}(2), 122-128.
51 52
 
52
-Barker M, Rayens W (2003).
53
-``Partial least squares for discrimination.''
54
-\emph{Journal of Chemometrics}, \bold{17}(3), 166-173.
53
+Barker M, Rayens W (2003). "Partial least squares for discrimination."
54
+\emph{Journal of Chemometrics}, \emph{17}(3), 166-173.
55 55
 }
Browse code

update documentation

Gavin Rhys Lloyd authored on 23/01/2023 10:57:52
Showing 1 changed files
... ...
@@ -41,9 +41,9 @@ This object makes use of functionality from the following packages:\itemize{\ite
41 41
 M = PLSDA('number_components'=2,factor_name='Species')
42 42
 }
43 43
 \references{
44
-Liland K, Mevik B, Wehrens R (2021).
44
+Liland K, Mevik B, Wehrens R (2022).
45 45
 \emph{pls: Partial Least Squares and Principal Component Regression}.
46
-R package version 2.8-0, \url{https://CRAN.R-project.org/package=pls}.
46
+R package version 2.8-1, \url{https://CRAN.R-project.org/package=pls}.
47 47
 
48 48
 Perez NF, Ferre J, Boque R (2009).
49 49
 ``Calculation of the reliability of classification in discriminant partial least-squares binary classification.''
Browse code

PLS updates (#64)

* add selectivity ratio

* replace vip_summary with feature_importance
renamed and now allows vip, sr and sr_pvalues to be plotted

* add equal_split model
random subsets so generate training sets with equal group numbers

* plot 1 - p-value
to conform with the "best" feature being a maximum value

* add resample iterator
subsample at random over a number of iterations. Option to use
different kinds of splitting methods. Corresponding chart.

* allow use of list() for factor_name

* force apply not to simplify output to guarantee returning a list

* update example

* add correct parameter
collect will collect the requested model output over all iterations in a list WORK IN PROGRESS

* add collection of multiple outputs of model sequence

* plot reg coeff on rhs

* match outputs of xval for use with grid search etc

* specify levels when converting predictions to factor

* change PLSDA to inherit from PLSR
rename some charts to be compatible with both PLSR and PLSDA

* allow y-block column selection

* re-assign y output after PLSR with factor

* update vignettes wrt PLS changes

* update documentation

* update R version to 4.1

* update documentation

* update documentation

* update scatter plot

- new scatter chart object
- used by PCA scores, PLSR/PLSDA scores
- other charts updated to reflect changes in scores plots where necessary
- added ycol param to plots for when y-block is a matrix

* add url to github

* add plsda scores alias

- plsda_scores_plot and pls_scores_plot do that same thing
Included for backwards compatability
- added components back as parameter for scores plots for backwards compatibility

* fix broken example

* fix broken tests

- scores is now returned as a DatasetExperiment object not a data.frame

* Update data_analysis_omics_using_the_structtoolbox.Rmd

- wrt changes in scores plots

* update documentation

* fix colnames for Y matrix

Gavin Rhys Lloyd authored on 28/02/2022 12:38:08 • GitHub committed on 28/02/2022 12:38:08
Showing 1 changed files
... ...
@@ -16,7 +16,7 @@ PLSDA(number_components = 2, factor_name, ...)
16 16
 \value{
17 17
 A  \code{PLSDA} object with the following \code{output} slots:
18 18
 \tabular{ll}{
19
-\code{scores} \tab          (data.frame)  \cr
19
+\code{scores} \tab          (DatasetExperiment)  \cr
20 20
 \code{loadings} \tab          (data.frame)  \cr
21 21
 \code{yhat} \tab          (data.frame)  \cr
22 22
 \code{design_matrix} \tab          (data.frame)  \cr
... ...
@@ -27,6 +27,8 @@ A  \code{PLSDA} object with the following \code{output} slots:
27 27
 \code{pls_model} \tab          (list)  \cr
28 28
 \code{pred} \tab          (data.frame)  \cr
29 29
 \code{threshold} \tab          (numeric)  \cr
30
+\code{sr} \tab          (data.frame) Selectivity ratio for a variable represents a measure of a variable's importance in the PLS model. The output data.frame contains a column of selectivity ratios, a column of p-values based on an F-distribution and a column indicating significance at p < 0.05. \cr
31
+\code{sr_pvalue} \tab          (data.frame) A p-value computed from the Selectivity Ratio based on an F-distribution. \cr
30 32
 }
31 33
 }
32 34
 \description{
Browse code

update documentation

Gavin Rhys Lloyd authored on 01/10/2021 16:52:55
Showing 1 changed files
... ...
@@ -39,9 +39,9 @@ This object makes use of functionality from the following packages:\itemize{\ite
39 39
 M = PLSDA('number_components'=2,factor_name='Species')
40 40
 }
41 41
 \references{
42
-Mevik B, Wehrens R, Liland K (2020).
42
+Liland K, Mevik B, Wehrens R (2021).
43 43
 \emph{pls: Partial Least Squares and Principal Component Regression}.
44
-R package version 2.7-3, \url{https://CRAN.R-project.org/package=pls}.
44
+R package version 2.8-0, \url{https://CRAN.R-project.org/package=pls}.
45 45
 
46 46
 Perez NF, Ferre J, Boque R (2009).
47 47
 ``Calculation of the reliability of classification in discriminant partial least-squares binary classification.''
Browse code

add outputs to auto generated documentation (#58)

Gavin Rhys Lloyd authored on 07/07/2021 09:37:19 • GitHub committed on 07/07/2021 09:37:19
Showing 1 changed files
... ...
@@ -14,7 +14,20 @@ PLSDA(number_components = 2, factor_name, ...)
14 14
 \item{...}{Additional slots and values passed to \code{struct_class}.}
15 15
 }
16 16
 \value{
17
-A  \code{PLSDA} object.
17
+A  \code{PLSDA} object with the following \code{output} slots:
18
+\tabular{ll}{
19
+\code{scores} \tab          (data.frame)  \cr
20
+\code{loadings} \tab          (data.frame)  \cr
21
+\code{yhat} \tab          (data.frame)  \cr
22
+\code{design_matrix} \tab          (data.frame)  \cr
23
+\code{y} \tab          (data.frame)  \cr
24
+\code{reg_coeff} \tab          (data.frame)  \cr
25
+\code{probability} \tab          (data.frame)  \cr
26
+\code{vip} \tab          (data.frame)  \cr
27
+\code{pls_model} \tab          (list)  \cr
28
+\code{pred} \tab          (data.frame)  \cr
29
+\code{threshold} \tab          (numeric)  \cr
30
+}
18 31
 }
19 32
 \description{
20 33
 PLS is a multivariate regression technique that extracts latent variables maximising covariance between the input data and the response. The Discriminant Analysis variant uses group labels in the response variable and applies a threshold to the predicted values in order to predict group membership for new samples.
Browse code

Release 3 12 candidate (#32)

* fix base=10 regardless of input (see #15)

class constructor was always setting base to 10 instead of the input value

* merge bug fix 1.01 into dev (#19)

* bug fix issue #7

Correctly re-order the sample_meta column for colouring samples in the dendrogram plot

* version bump

bug fix issue #7

* fix for https://github.com/computational-metabolomics/structToolbox/issues/18 (#20)

correctly reorder the factor labels so that the control group always ends up in the denominator for the fold change calculation.

* fix for https://github.com/computational-metabolomics/structToolbox/issues/18

fixed incorrect length check on matching class labels.

* Issue 17 ttest factor (#21)

* convert to factor if not one already

fix for issue #17

* update roxygen version

* fix for issue #9 (#22)

changed from lapply to vapply and used drop=FALSE to ensure compatibility with a single factor.

* allow user to set lambda (#24)

- lambda changed to input parameter. NULL = uses pmp optimisation
- model_predict now uses the set value of lambda, or lambda_opt if used.
- documentation updated

* Feature non parametric fold change (#26)

* add "median" method

based on DOI: 10.1080/00949650212140 can now calcuate fold changes equivalent to using medians and corresponding confidence intervals

* update documentation

* update median method

now correctly calculates ratio of medians

* use wilcox for paired median intervals

make use of wilcox.test to estimate intervals for the median when using median for paired samples

* Issue 23 filter by name (#27)

* fix for #23

moved all model_apply functionality to model_predict so that model_train and model_predict can be used as well as model_apply

* update documentation

* Update mean_of_medians.R (#29)

fix for #28
- correctly loop over all levels in the named factor

* Feature documentation 3 12 (#31)

* update documentation

Description and inputs now pulled from the object definitions for consistency.

* fix definition of label_features

allows NULL and description updated

* replace non ascii characters

* export mixed_effect object

* use correct object name to generate documentation

* export mixed_effect object

* remove non ascii characters

* update tests with new object name

* add import for capture.output

* add import for capture.output

* use pca_biplot in tests

chart was renamed

* add utils import

* update struct dependency version

* update documentation

* update news, version bump

Gavin Rhys Lloyd authored on 25/10/2020 08:50:13 • GitHub committed on 25/10/2020 08:50:13
Showing 1 changed files
... ...
@@ -2,23 +2,39 @@
2 2
 % Please edit documentation in R/PLSDA_class.R
3 3
 \name{PLSDA}
4 4
 \alias{PLSDA}
5
-\title{PLSDA model class}
5
+\title{Partial least squares discriminant analysis}
6 6
 \usage{
7 7
 PLSDA(number_components = 2, factor_name, ...)
8 8
 }
9 9
 \arguments{
10
-\item{number_components}{The number of PLS components to calculate.}
10
+\item{number_components}{(numeric, integer) The number of PLS components. The default is \code{2}.}
11 11
 
12
-\item{factor_name}{The sample-meta column name to use.}
12
+\item{factor_name}{(character) The name of a sample-meta column to use.}
13 13
 
14
-\item{...}{additional slots and values passed to struct_class}
14
+\item{...}{Additional slots and values passed to \code{struct_class}.}
15 15
 }
16 16
 \value{
17
-struct object
17
+A  \code{PLSDA} object.
18 18
 }
19 19
 \description{
20
-Partial least squares (PLS) discriminant analysis (DA) model class. This object can be used to train/apply PLS models.
20
+PLS is a multivariate regression technique that extracts latent variables maximising covariance between the input data and the response. The Discriminant Analysis variant uses group labels in the response variable and applies a threshold to the predicted values in order to predict group membership for new samples.
21
+}
22
+\details{
23
+This object makes use of functionality from the following packages:\itemize{\item{\code{pls}}}
21 24
 }
22 25
 \examples{
23 26
 M = PLSDA('number_components'=2,factor_name='Species')
24 27
 }
28
+\references{
29
+Mevik B, Wehrens R, Liland K (2020).
30
+\emph{pls: Partial Least Squares and Principal Component Regression}.
31
+R package version 2.7-3, \url{https://CRAN.R-project.org/package=pls}.
32
+
33
+Perez NF, Ferre J, Boque R (2009).
34
+``Calculation of the reliability of classification in discriminant partial least-squares binary classification.''
35
+\emph{Chemometrics and Intelligent Laboratory Systems}, \bold{95}(2), 122-128.
36
+
37
+Barker M, Rayens W (2003).
38
+``Partial least squares for discrimination.''
39
+\emph{Journal of Chemometrics}, \bold{17}(3), 166-173.
40
+}
Browse code

update to use new struct class constructors

Gavin Rhys Lloyd authored on 06/02/2020 13:51:52
Showing 1 changed files
... ...
@@ -4,9 +4,13 @@
4 4
 \alias{PLSDA}
5 5
 \title{PLSDA model class}
6 6
 \usage{
7
-PLSDA(...)
7
+PLSDA(number_components = 2, factor_name, ...)
8 8
 }
9 9
 \arguments{
10
+\item{number_components}{The number of PLS components to calculate.}
11
+
12
+\item{factor_name}{The sample-meta column name to use.}
13
+
10 14
 \item{...}{additional slots and values passed to struct_class}
11 15
 }
12 16
 \value{
... ...
@@ -16,5 +20,5 @@ struct object
16 20
 Partial least squares (PLS) discriminant analysis (DA) model class. This object can be used to train/apply PLS models.
17 21
 }
18 22
 \examples{
19
-M = PLSDA()
23
+M = PLSDA('number_components'=2,factor_name='Species')
20 24
 }
Browse code

incremental changes to use struct class constructors

Gavin Rhys Lloyd authored on 04/02/2020 17:18:11
Showing 1 changed files
... ...
@@ -7,7 +7,7 @@
7 7
 PLSDA(...)
8 8
 }
9 9
 \arguments{
10
-\item{...}{slots and values for the new object}
10
+\item{...}{additional slots and values passed to struct_class}
11 11
 }
12 12
 \value{
13 13
 struct object
Browse code

add @return to documentation

Gavin Rhys Lloyd authored on 19/12/2019 15:14:02
Showing 1 changed files
... ...
@@ -9,6 +9,9 @@ PLSDA(...)
9 9
 \arguments{
10 10
 \item{...}{slots and values for the new object}
11 11
 }
12
+\value{
13
+struct object
14
+}
12 15
 \description{
13 16
 Partial least squares (PLS) discriminant analysis (DA) model class. This object can be used to train/apply PLS models.
14 17
 }
Browse code

fix broken tests and...

...update some documentation

Gavin Rhys Lloyd authored on 17/12/2019 17:24:38
Showing 1 changed files
... ...
@@ -6,6 +6,9 @@
6 6
 \usage{
7 7
 PLSDA(...)
8 8
 }
9
+\arguments{
10
+\item{...}{slots and values for the new object}
11
+}
9 12
 \description{
10 13
 Partial least squares (PLS) discriminant analysis (DA) model class. This object can be used to train/apply PLS models.
11 14
 }
Browse code

use class contructors and...

...rename all function with dot to underscore
replace dataset with DatasetExperiment

Gavin Rhys Lloyd authored on 17/12/2019 15:48:01
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,14 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/PLSDA_class.R
3
+\name{PLSDA}
4
+\alias{PLSDA}
5
+\title{PLSDA model class}
6
+\usage{
7
+PLSDA(...)
8
+}
9
+\description{
10
+Partial least squares (PLS) discriminant analysis (DA) model class. This object can be used to train/apply PLS models.
11
+}
12
+\examples{
13
+M = PLSDA()
14
+}