|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.ConsoleObject
adams.core.option.AbstractOptionHandler
adams.flow.core.AbstractActor
adams.flow.transformer.AbstractTransformer
adams.flow.transformer.WekaCrossValidationSplit
public class WekaCrossValidationSplit
Generates train/test pairs like during a cross-validation run. It is possible to generate pairs for leave-one-out cross-validation (LOOCV) as well.
It is essential that a class attribute is set. In case of a nominal class attribute, the data gets stratified automatically.
Each of the pairs gets forwarded as a container. The training set can be accessed in the container with 'Train' and the test set with 'Test'.
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-name <java.lang.String> (property: name) The name of the actor. default: CrossValidationSplit
-annotation <adams.core.base.BaseText> (property: annotations) The annotations to attach to this actor. default:
-skip (property: skip) If set to true, transformation is skipped and the input token is just forwarded as it is.
-seed <long> (property: seed) The seed value for the randomization. default: 1
-folds <int> (property: folds) The folds to use; using '-1' will generate folds for leave-one-out cross-validation (LOOCV). default: 10
-relation <java.lang.String> (property: relationName) The placeholders for creating the relation name: @ = original relation name, $T = type (train/test), $N = current fold number. default: @
| Field Summary | |
|---|---|
static String |
BACKUP_ACTUALFOLDS
the key for storing the actual folds in the backup. |
static String |
BACKUP_CURRENTFOLD
the key for storing the current fold in the backup. |
protected int |
m_ActualFolds
the actual number of folds to generate. |
protected int |
m_CurrentFold
the current fold. |
protected weka.core.Instances |
m_Data
the data to work with. |
protected int |
m_Folds
the number of folds to generate. |
protected Random |
m_Random
the random number generator to use for generating the folds. |
protected String |
m_RelationName
the format of the relation names of the generated datasets. |
protected long |
m_Seed
the seed value. |
| Fields inherited from class adams.flow.transformer.AbstractTransformer |
|---|
BACKUP_INPUT, BACKUP_OUTPUT, m_InputToken, m_OutputToken |
| Fields inherited from class adams.flow.core.AbstractActor |
|---|
FILE_EXTENSION, FILE_EXTENSION_GZ, m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_FullName, m_Headless, m_Name, m_Parent, m_Root, m_Self, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated |
| Fields inherited from class adams.core.option.AbstractOptionHandler |
|---|
m_DebugLevel, m_OptionManager |
| Constructor Summary | |
|---|---|
WekaCrossValidationSplit()
|
|
| Method Summary | |
|---|---|
Class[] |
accepts()
Returns the class that the consumer accepts. |
protected Hashtable<String,Object> |
backupState()
Backs up the current state of the actor before update the variables. |
protected String |
createRelationName(boolean train)
Generates a relation name for the current fold. |
void |
defineOptions()
Adds options to the internal list of options. |
protected String |
doExecute()
Executes the flow item. |
String |
foldsTipText()
Returns the tip text for this property. |
Class[] |
generates()
Returns the class of objects that it generates. |
int |
getFolds()
Returns the number of folds to generate. |
String |
getRelationName()
Returns the pattern used for renaming the relation. |
long |
getSeed()
Returns the seed value. |
String |
globalInfo()
Returns a string describing the object. |
boolean |
hasPendingOutput()
Checks whether there is pending output to be collected after executing the flow item. |
Token |
output()
Returns the generated token. |
protected void |
pruneBackup()
Removes entries from the backup. |
String |
relationNameTipText()
Returns the tip text for this property. |
protected void |
reset()
Resets the scheme. |
protected void |
restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated. |
String |
seedTipText()
Returns the tip text for this property. |
void |
setFolds(int value)
Sets the number of folds to use. |
void |
setRelationName(String value)
Sets the pattern to use for renaming the relation. |
void |
setSeed(long value)
Sets the seed value. |
void |
updateProvenance(ProvenanceContainer cont)
Updates the provenance information in the provided container. |
void |
wrapUp()
Cleans up after the execution has finished. |
| Methods inherited from class adams.flow.transformer.AbstractTransformer |
|---|
execute, input, postExecute |
| Methods inherited from class adams.core.option.AbstractOptionHandler |
|---|
cleanUpOptions, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString |
| Methods inherited from class adams.core.ConsoleObject |
|---|
getDebugging, getSystemErr, getSystemOut |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String BACKUP_CURRENTFOLD
public static final String BACKUP_ACTUALFOLDS
protected long m_Seed
protected int m_Folds
protected String m_RelationName
protected int m_CurrentFold
protected int m_ActualFolds
protected weka.core.Instances m_Data
protected Random m_Random
| Constructor Detail |
|---|
public WekaCrossValidationSplit()
| Method Detail |
|---|
public String globalInfo()
globalInfo in class AbstractOptionHandlerpublic void defineOptions()
defineOptions in interface OptionHandlerdefineOptions in class AbstractActorpublic Class[] accepts()
accepts in interface InputConsumerpublic Class[] generates()
generates in interface OutputProducerpublic void setSeed(long value)
setSeed in interface Randomizablevalue - the seedpublic long getSeed()
getSeed in interface Randomizablepublic String seedTipText()
seedTipText in interface Randomizablepublic void setFolds(int value)
value - the folds, use 1 for LOOCVpublic int getFolds()
public String foldsTipText()
public void setRelationName(String value)
value - the patternpublic String getRelationName()
public String relationNameTipText()
protected void pruneBackup()
pruneBackup in class AbstractActorprotected Hashtable<String,Object> backupState()
backupState in class AbstractTransformerprotected void restoreState(Hashtable<String,Object> state)
restoreState in class AbstractTransformerstate - the backup of the state to restore fromprotected void reset()
reset in class AbstractTransformerprotected String doExecute()
doExecute in class AbstractActorpublic boolean hasPendingOutput()
hasPendingOutput in interface OutputProducerhasPendingOutput in class AbstractTransformerprotected String createRelationName(boolean train)
train - whether train or test set
public Token output()
output in interface OutputProduceroutput in class AbstractTransformerpublic void updateProvenance(ProvenanceContainer cont)
updateProvenance in interface ProvenanceSupportercont - the provenance container to updatepublic void wrapUp()
wrapUp in class AbstractTransformer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||