Encodemethod: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Donal
(Created page with "===Purpose=== Create a cross-validation index vector for a given method.. ===Synopsis=== :cvi = encodemethod(items,method,n,blocksize) Output (cvi) is a vector containing ...")
 
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===


Create a cross-validation index vector for a given method..
Create a cross-validation index vector for a given method.


===Synopsis===
===Synopsis===
Line 26: Line 26:
:  'loo'  : Leave one out. Each item is in an individual group, input (n) can be omitted.
:  '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.
:  'rnd'  : Random. items are randomly split into n equal sized groups.
====Outputs====
* '''outputs''' =  vector of integer values giving the group number of each item.


===Examples===
===Examples===
Line 36: Line 40:
===See Also===
===See Also===


[[crossval]]
[[crossval]], [[cvifromclass]]

Latest revision as of 08:07, 20 November 2023

Purpose

Create a cross-validation index vector for a given method.

Synopsis

cvi = encodemethod(items,method,n,blocksize)

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

Description

Inputs

  • items = number of items to sort into sets [e.g., size(x,1) for x a data array].
  • method = string defining the cross-validation method defined below.
  • n = number of subsets to split the data into
  • blocksize = number of items to include in each block (NOTE: blocksize for 'vet' method only)

The input parameter method 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 "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.

Outputs

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

Examples

cvi = encodemethod(20,'con',4);
cvi = encodemethod(20,'vet',5,2);

See Also

crossval, cvifromclass