Stratifiedcvi: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
(Created page with "===Purpose=== Create a stratified cross-validation index vector for a given method and class set. ===Synopsis=== : cvi = stratifiedcvi(dso,classset,cvinfo) : cvi = stratifi...")
 
 
Line 7: Line 7:
: cvi = stratifiedcvi(dso,classset,cvinfo)
: cvi = stratifiedcvi(dso,classset,cvinfo)
: cvi = stratifiedcvi(dso,1,{'loo'}) using Leave-One out cross-val
: cvi = stratifiedcvi(dso,1,{'loo'}) using Leave-One out cross-val
: cvi = stratifiedcvi(dso,1,{'vet 5 2'}) using venetian blinds cross-val
: cvi = stratifiedcvi(dso,1,{'vet' 5 2}) using venetian blinds cross-val
: cvi = stratifiedcvi(dso,1,{'con 2'}) using contiguous blocks cross-val
: cvi = stratifiedcvi(dso,1,{'con' 2}) using contiguous blocks cross-val
: cvi = stratifiedcvi(dso,1,{'rnd 2'}) using random cross-val
: cvi = stratifiedcvi(dso,1,{'rnd' 2}) using random cross-val


Output (cvi) is a vector containing the group number of each item.
Output (cvi) is a vector containing the group number of each item.

Latest revision as of 11:04, 30 November 2023

Purpose

Create a stratified cross-validation index vector for a given method and class set.

Synopsis

cvi = stratifiedcvi(dso,classset,cvinfo)
cvi = stratifiedcvi(dso,1,{'loo'}) using Leave-One out cross-val
cvi = stratifiedcvi(dso,1,{'vet' 5 2}) using venetian blinds cross-val
cvi = stratifiedcvi(dso,1,{'con' 2}) using contiguous blocks cross-val
cvi = stratifiedcvi(dso,1,{'rnd' 2}) using random cross-val

Output (cvi) is a vector containing the group number of each item.

Description

Create a stratified cross-validation index vector for given class set in a Dataset Object and a given cross-val method. This method will apply the cross-val method on each class at a time and then combine the resulting cross-val index vectors.

Inputs

  • dso = DataSet Object with class information
  • classset = class set to use or vector of numerical class assignments
  • cvinfo = cross-validation information, a cell array which should contain:
    • method: a string defining the cross-validation method defined below, can be any of the following:
      • 'vet'  : Venetian blinds. Every n-th item is grouped together. Optionally allows grouping of more than one sample together using the "blocksize" input.
      • 'con'  : Contiguous blocks. Consecutive items are put into n groups.
      • 'loo'  : Leave one out. Each item is in an individual group, input (n) can be omitted.
      • 'rnd'  : Random. items are randomly split into n equal sized groups.
    • n: the number of subsets to split the data into,
    • blocksize: the number of items to include in each block (NOTE: blocksize for 'vet' method only)

Outputs

  • outputs = vector of integer values giving the group number of each item.

See Also

crossval, cvifromclass