KFold¶
-
class
KFold
(*args)¶ K-fold.
- Available constructors:
KFold()
KFold(k)
- Parameters
- kpositive integer
Number of folds in which the sample is splitted. If not provided, default is .
See also
Notes
KFold inherits from
FittingAlgorithm
.This class is not usable because it has sense only whithin the
FunctionalChaosAlgorithm
.Methods
getClassName
(self)Accessor to the object’s name.
getId
(self)Accessor to the object’s id.
getK
(self)Accessor to the number of folds.
getName
(self)Accessor to the object’s name.
getShadowedId
(self)Accessor to the object’s shadowed id.
getVisibility
(self)Accessor to the object’s visibility state.
hasName
(self)Test if the object is named.
hasVisibleName
(self)Test if the object has a distinguishable name.
run
(self, x, y, weight, basis, indices)Run the algorithm.
setK
(self, p)Accessor to the number of folds.
setName
(self, name)Accessor to the object’s name.
setShadowedId
(self, id)Accessor to the object’s shadowed id.
setVisibility
(self, visible)Accessor to the object’s visibility state.
-
__init__
(self, \*args)¶ Initialize self. See help(type(self)) for accurate signature.
-
getClassName
(self)¶ Accessor to the object’s name.
- Returns
- class_namestr
The object class name (object.__class__.__name__).
-
getId
(self)¶ Accessor to the object’s id.
- Returns
- idint
Internal unique identifier.
-
getK
(self)¶ Accessor to the number of folds.
- Returns
- kinteger
Number of folds in which the sample is splitted.
-
getName
(self)¶ Accessor to the object’s name.
- Returns
- namestr
The name of the object.
-
getShadowedId
(self)¶ Accessor to the object’s shadowed id.
- Returns
- idint
Internal unique identifier.
-
getVisibility
(self)¶ Accessor to the object’s visibility state.
- Returns
- visiblebool
Visibility flag.
-
hasName
(self)¶ Test if the object is named.
- Returns
- hasNamebool
True if the name is not empty.
-
hasVisibleName
(self)¶ Test if the object has a distinguishable name.
- Returns
- hasVisibleNamebool
True if the name is not empty and not the default one.
-
run
(self, x, y, weight, basis, indices)¶ Run the algorithm.
- Parameters
- x2-d sequence of float
Input sample
- y2-d sequence of float
Output sample
- weightsequence of float
Weights associated to the outputs
- psisequence of
Function
Basis
- indicessequence of int
Indices of the basis
- Returns
- measurefloat
Fitting measure
-
setK
(self, p)¶ Accessor to the number of folds.
- Parameters
- kinteger
Number of folds in which the sample is splitted.
-
setName
(self, name)¶ Accessor to the object’s name.
- Parameters
- namestr
The name of the object.
-
setShadowedId
(self, id)¶ Accessor to the object’s shadowed id.
- Parameters
- idint
Internal unique identifier.
-
setVisibility
(self, visible)¶ Accessor to the object’s visibility state.
- Parameters
- visiblebool
Visibility flag.