Browse Source

Do not export a list of package-internal functions for model training and evaluation

pull/3/head
Philipp Baumann 7 years ago
parent
commit
0bc82e52bc
  1. 16
      NAMESPACE
  2. 23
      man/control_train.Rd
  3. 23
      man/control_train_loocv_q.Rd
  4. 23
      man/control_train_none_q.Rd
  5. 23
      man/control_train_q.Rd
  6. 23
      man/control_train_rcv_q.Rd
  7. 37
      man/evaluate_model_q.Rd
  8. 27
      man/split_data_q.Rd
  9. 24
      man/train_pls.Rd
  10. 29
      man/train_pls_q.Rd
  11. 29
      man/train_rf_q.Rd

16
NAMESPACE

@ -1,14 +1,6 @@
# Generated by roxygen2: do not edit by hand
export(VIP)
export(average_spc)
export(control_train)
export(control_train_loocv_q)
export(control_train_none_q)
export(control_train_q)
export(control_train_rcv_q)
export(create_vip_rects)
export(evaluate_model_q)
export(extract_pls_vip)
export(fit_pls)
export(fit_rf)
@ -29,15 +21,8 @@ export(read_opus_univ)
export(read_spectra)
export(remove_outliers)
export(resample_spc)
export(se)
export(select_ref_spc)
export(sem_ci)
export(split_data_q)
export(summary_df)
export(train_pls)
export(train_pls_q)
export(train_rf_q)
export(transform_cvpredictions)
import(stats)
importFrom(data.table,":=")
importFrom(data.table,.SD)
@ -45,4 +30,3 @@ importFrom(data.table,data.table)
importFrom(data.table,rbindlist)
importFrom(data.table,setDT)
importFrom(data.table,setkey)
importFrom(magrittr,"%>%")

23
man/control_train.Rd

@ -1,23 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pls-modeling.R
\name{control_train}
\alias{control_train}
\title{Perform model tuning}
\usage{
control_train(x, response, env = parent.frame())
}
\arguments{
\item{x}{list from calibration sampling}
\item{response}{response variable for PLS regression, supplied
as character expression}
\item{env}{Environment where function is evaluated}
\item{validation}{Logical expression weather an independent
validation is performed.}
}
\description{
Uses function from caret to to model tuning
for PLS regression.
}

23
man/control_train_loocv_q.Rd

@ -1,23 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pls-modeling.R
\name{control_train_loocv_q}
\alias{control_train_loocv_q}
\title{Perform model tuning}
\usage{
control_train_loocv_q(x, response, env = parent.frame())
}
\arguments{
\item{x}{list from calibration sampling}
\item{response}{response variable for PLS regression, supplied
as character expression}
\item{env}{Environment where function is evaluated}
\item{validation}{Logical expression weather an independent
validation is performed.}
}
\description{
Uses function from caret to to model tuning
for PLS regression.
}

23
man/control_train_none_q.Rd

@ -1,23 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pls-modeling.R
\name{control_train_none_q}
\alias{control_train_none_q}
\title{Perform model fitting without parameter tuning}
\usage{
control_train_none_q(x, response, env = parent.frame())
}
\arguments{
\item{x}{list from calibration sampling}
\item{response}{response variable for PLS regression, supplied
as character expression}
\item{env}{Environment where function is evaluated}
\item{validation}{Logical expression weather an independent
validation is performed.}
}
\description{
Uses function from caret to set model tuning to none
for PLS regression.
}

23
man/control_train_q.Rd

@ -1,23 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pls-modeling.R
\name{control_train_q}
\alias{control_train_q}
\title{Perform model tuning}
\usage{
control_train_q(x, response, env = parent.frame())
}
\arguments{
\item{x}{list from calibration sampling}
\item{response}{response variable for PLS regression, supplied
as character expression}
\item{env}{Environment where function is evaluated}
\item{validation}{Logical expression weather an independent
validation is performed.}
}
\description{
Uses function from caret to to model tuning
for PLS regression.
}

23
man/control_train_rcv_q.Rd

@ -1,23 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pls-modeling.R
\name{control_train_rcv_q}
\alias{control_train_rcv_q}
\title{Perform model tuning}
\usage{
control_train_rcv_q(x, response, env = parent.frame())
}
\arguments{
\item{x}{list from calibration sampling}
\item{response}{response variable for PLS regression, supplied
as character expression}
\item{env}{Environment where function is evaluated}
\item{validation}{Logical expression weather an independent
validation is performed.}
}
\description{
Uses function from caret to to model tuning
for PLS regression.
}

37
man/evaluate_model_q.Rd

@ -1,37 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pls-modeling.R
\name{evaluate_model_q}
\alias{evaluate_model_q}
\title{Evaluate PLS performance}
\usage{
evaluate_model_q(x, model, response, evaluation_method, tuning_method,
print = TRUE, env = parent.frame())
}
\arguments{
\item{x}{List that contains calibration and validation data
frame with combined spectral and chemical data}
\item{model}{List with PLS regression model output from
the caret package}
\item{response}{Response variable (e.g. chemical property) to be
modelled (needs to be non-quoted expression). \code{response}
needs to be a column name in the \code{validation} data.frame
(element of \code{x})}
\item{print}{Print observed vs. predicted for calibration
and validation. Default is \code{TRUE}.}
\item{env}{Specifiy the environment in which the function is
called. Default argument of \code{env} is
\code{parent.frame()}}
\item{validation}{Logical expression if independent validation
is performed (split data set into calibration set and
validation set)}
}
\description{
Calculate model performance indices based
on observed and predicted values of validation and calibration
set, and internal cross-validation
}

27
man/split_data_q.Rd

@ -1,27 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pls-modeling.R
\name{split_data_q}
\alias{split_data_q}
\title{Split spectra into calibration and validation sets}
\usage{
split_data_q(spec_chem, evaluation_method, ratio_val, ken_sto_pc,
print = TRUE)
}
\arguments{
\item{spec_chem}{data.frame that contains chemical
and IR spectroscopy data}
\item{ratio_val}{Ratio of number of validation and all samples.}
\item{ken_sto_pc}{Number of principal components (numeric)}
\item{print}{logical expression weather calibration}
\item{validation}{Logical expression weather
calibration sampling is performed
(\code{TRUE} or \code{FALSE}).}
}
\description{
Perform calibration sampling based on
the Kennard-Stones algorithm.
}

24
man/train_pls.Rd

@ -1,24 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pls-modeling.R
\name{train_pls}
\alias{train_pls}
\title{Fit a PLS regression model}
\usage{
train_pls(x, response, evaluation_method = "resampling",
env = parent.frame())
}
\arguments{
\item{x}{List that contains calibration
set, validation set, and model tuning options}
\item{response}{Response variable to be modeled}
\item{env}{Environment where function is evaluated}
\item{validation}{Logical expression weather independent
validation is performed}
}
\description{
Uses the caret package to perform PLS modeling.
Spectra are centered and scaled prior to modeling.
}

29
man/train_pls_q.Rd

@ -1,29 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pls-modeling.R
\name{train_pls_q}
\alias{train_pls_q}
\title{Train a PLS regression model
(quoted version of the function)}
\usage{
train_pls_q(x, evaluation_method = "test_resampling", response, tr_control,
env = parent.frame(), pls_ncomp_max = 20, ncomp_fixed = 5, center,
scale, tuning_method = "resampling")
}
\arguments{
\item{x}{List that contains calibration
set, validation set, and model tuning options}
\item{response}{Response variable to be modeled}
\item{tr_control}{Object that defines controlling parameters
of the desired internal validation framework}
\item{env}{Environment where function is evaluated}
\item{validation}{Logical expression weather independent
validation is performed}
}
\description{
Uses the caret package to perform PLS modeling.
Spectra are centered and scaled prior to modeling.
}

29
man/train_rf_q.Rd

@ -1,29 +0,0 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pls-modeling.R
\name{train_rf_q}
\alias{train_rf_q}
\title{Fit a random forest model
(quoted version of the function)}
\usage{
train_rf_q(x, validation = TRUE, evaluation_method = "resampling", response,
tr_control, ntree_max = 500, env = parent.frame())
}
\arguments{
\item{x}{List that contains calibration
set, validation set, and model tuning options}
\item{validation}{Logical expression weather independent
validation is performed}
\item{response}{Response variable to be modeled}
\item{tr_control}{Object that defines controlling parameters
of the desired internal validation framework}
\item{env}{Environment where function is evaluated}
}
\description{
Uses the caret package to perform random forest
modeling.
Spectra are centered and scaled prior to modeling.
}
Loading…
Cancel
Save