find_optimal_comp_by_groups: Uses the firstMin and firstPlateau methods for the...

find_optimal_comp_by_groupsR Documentation

Uses the firstMin and firstPlateau methods for the determination of the optimal number of PLSR model components, by group (i.e. optimal selection by stratification)

Description

Uses the firstMin and firstPlateau methods for the determination of the optimal number of PLSR model components, by group (i.e. optimal selection by stratification)

Usage

find_optimal_comp_by_groups(
  dataset = NULL,
  targetVariable = NULL,
  method = "firstPlateau",
  maxComps = 20,
  iterations = 20,
  prop = 0.7,
  random_seed = 123456789,
  group_variables = NULL
)

Arguments

dataset

input full PLSR dataset. Usually just the calibration dataset

targetVariable

What object or variable to use as the Y (predictand) in the PLSR model? Usually the "inVar" variable set at the beginning of a PLS script

method

Which approach to use to find optimal components. Options: firstPlateau, firstMin

maxComps

maximum number of components to consider

iterations

how many different permutations to run

prop

proportion of data to preserve for each permutation

random_seed

random seed to use for splitting data

group_variables

group_variables character vector of the form c("var1", "var2"..."varn") providing the factors used for stratified sampling.

Value

nComps the optimal number of PLSR components

Author(s)

asierrl, Shawn P. Serbin


TESTgroup-BNL/PLSR_for_plant_trait_prediction documentation built on Feb. 15, 2025, 2:08 p.m.