kfold_ind: Perform kfold cross-validation at the individual level .

View source: R/fcts RSF.R

kfold_indR Documentation

Perform kfold cross-validation at the individual level .

Description

Perform kfold cross-validation at the individual level and return histogram, mean kfold accros individual and min/max value

Usage

kfold_ind(
  m = 1,
  mod_ls,
  ls = ls,
  cutoff = 0,
  k = 5,
  nrepet = 5,
  nbins = 10,
  grph = T
)

Arguments

m

model number (based on number in list of formula provided to rsf_ind)

mod_ls

A list of list of model generated by rsf_ind

cutoff

A cutoff value to exclude individuals with bad fit, default = -1 indicating model that did not converge will be excluded. Values > 0 will exclude based on coefficient

k

number of fold (default = 5)

nrepet

Number of repetitions (default =10)

nbins

Number of bins (default =10)

jitter

Logical, whether to add some random noise to the predictions (useful when the model is fitted on categorica variables, which can produces error in the ranking process).

reproducible

Logical, whether to use a fixed seed for each repetition.

Value

A data frame with the correlations (cor) and the type of value (type).

Examples

data(goats)
ls1<-list()
ls1[[1]]<-as.formula(STATUS~ELEVATION+SLOPE+ET+ASPECT+HLI+TASP)
ls1[[2]]<-as.formula(STATUS~ET+ASPECT+HLI+TASP)
out<-rsf_ind(goats$ID, data=goats, form_ls=ls1)
kfold_ind(m=1, out, ls=ls1)

BastilleRousseau/IndRSA documentation built on Jan. 28, 2024, 2:14 a.m.