KFold

class KFold(*args)

K-fold.

Available constructors:

KFold()

KFold(k)

Parameters:
k : positive integer

Number of folds in which the sample is splitted. If not provided, default is k = 10.

Notes

KFold inherits from FittingAlgorithm.

This class is not usable because it has sense only whithin the FunctionalChaosAlgorithm.

Methods

getClassName() Accessor to the object’s name.
getId() Accessor to the object’s id.
getK() Accessor to the number of folds.
getName() Accessor to the object’s name.
getShadowedId() Accessor to the object’s shadowed id.
getVisibility() Accessor to the object’s visibility state.
hasName() Test if the object is named.
hasVisibleName() Test if the object has a distinguishable name.
run(x, y, weight, basis, indices) Run the algorithm.
setK(p) Accessor to the number of folds.
setName(name) Accessor to the object’s name.
setShadowedId(id) Accessor to the object’s shadowed id.
setVisibility(visible) Accessor to the object’s visibility state.
__init__(*args)

Initialize self. See help(type(self)) for accurate signature.

getClassName()

Accessor to the object’s name.

Returns:
class_name : str

The object class name (object.__class__.__name__).

getId()

Accessor to the object’s id.

Returns:
id : int

Internal unique identifier.

getK()

Accessor to the number of folds.

Returns:
k : integer

Number of folds in which the sample is splitted.

getName()

Accessor to the object’s name.

Returns:
name : str

The name of the object.

getShadowedId()

Accessor to the object’s shadowed id.

Returns:
id : int

Internal unique identifier.

getVisibility()

Accessor to the object’s visibility state.

Returns:
visible : bool

Visibility flag.

hasName()

Test if the object is named.

Returns:
hasName : bool

True if the name is not empty.

hasVisibleName()

Test if the object has a distinguishable name.

Returns:
hasVisibleName : bool

True if the name is not empty and not the default one.

run(x, y, weight, basis, indices)

Run the algorithm.

Parameters:
x : 2-d sequence of float

Input sample

y : 2-d sequence of float

Output sample

weight : sequence of float

Weights associated to the outputs

psi : sequence of Function

Basis

indices : sequence of int

Indices of the basis

Returns:
measure : float

Fitting measure

setK(p)

Accessor to the number of folds.

Parameters:
k : integer

Number of folds in which the sample is splitted.

setName(name)

Accessor to the object’s name.

Parameters:
name : str

The name of the object.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:
id : int

Internal unique identifier.

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:
visible : bool

Visibility flag.