public class Crossfolder
extends java.lang.Object
Partitions a data set for cross-validation.
The resulting data is placed in an output directory with the following files:
datasets.yaml
- a manifest file listing all the data setspartNN.train.csv
- a CSV file containing the train data for part NNpartNN.train.yaml
- a YAML manifest for the training data for part NNpartNN.test.csv
- a CSV file containing the test data for part NNpartNN.test.yaml
- a YAML manifest for the test data for part NNModifier and Type | Field and Description |
---|---|
static java.lang.String |
ITEM_FILE_NAME |
Constructor and Description |
---|
Crossfolder() |
Crossfolder(java.lang.String n) |
Modifier and Type | Method and Description |
---|---|
void |
execute()
Run the crossfold command.
|
java.util.List<DataSet> |
getDataSets()
Get the train-test splits as data sets.
|
EntityType |
getEntityType()
Get the entity type that this crossfolder will crossfold.
|
CrossfoldMethod |
getMethod()
Get the method to be used for crossfolding.
|
java.lang.String |
getName()
Get the visible name of this crossfold split.
|
java.nio.file.Path |
getOutputDir()
Get the output directory.
|
OutputFormat |
getOutputFormat()
Get the output format for the crossfolder.
|
int |
getPartitionCount()
Get the partition count.
|
StaticDataSource |
getSource()
Get the data source backing this crossfold manager.
|
boolean |
getWriteTimestamps()
Query whether timestamps will be written.
|
void |
setEntityType(EntityType entityType)
Set the entity type that this crossfolder will crossfold.
|
Crossfolder |
setMethod(CrossfoldMethod meth)
Set the method to be used by the crossfolder.
|
Crossfolder |
setName(java.lang.String n)
Set a name for this crossfolder.
|
Crossfolder |
setOutputDir(java.io.File dir)
Set the output directory for this crossfold operation.
|
Crossfolder |
setOutputDir(java.nio.file.Path dir)
Set the output directory for this crossfold operation.
|
Crossfolder |
setOutputDir(java.lang.String dir)
Set the output directory for this crossfold operation.
|
Crossfolder |
setOutputFormat(OutputFormat format)
Set the output format for the crossfolder.
|
Crossfolder |
setPartitionCount(int partition)
Set the number of partitions to generate.
|
Crossfolder |
setSource(StaticDataSource src)
Set the data source.
|
Crossfolder |
setWriteTimestamps(boolean pack)
Configure whether to include timestamps in the output file.
|
java.lang.String |
toString() |
public static final java.lang.String ITEM_FILE_NAME
public Crossfolder()
public Crossfolder(java.lang.String n)
public EntityType getEntityType()
Get the entity type that this crossfolder will crossfold.
public void setEntityType(EntityType entityType)
Set the entity type that this crossfolder will crossfold.
entityType
- The entity type to crossfold.public Crossfolder setPartitionCount(int partition)
Set the number of partitions to generate.
partition
- The number of paritionspublic int getPartitionCount()
Get the partition count.
public Crossfolder setOutputFormat(OutputFormat format)
Set the output format for the crossfolder.
format
- The output format.public OutputFormat getOutputFormat()
Get the output format for the crossfolder.
public Crossfolder setOutputDir(java.nio.file.Path dir)
Set the output directory for this crossfold operation.
dir
- The output directory.public Crossfolder setOutputDir(java.io.File dir)
Set the output directory for this crossfold operation.
dir
- The output directory.public Crossfolder setOutputDir(java.lang.String dir)
Set the output directory for this crossfold operation.
dir
- The output directory.public java.nio.file.Path getOutputDir()
Get the output directory.
public Crossfolder setSource(StaticDataSource src)
Set the data source.
src
- public Crossfolder setMethod(CrossfoldMethod meth)
Set the method to be used by the crossfolder.
meth
- The method to use.public CrossfoldMethod getMethod()
Get the method to be used for crossfolding.
public Crossfolder setWriteTimestamps(boolean pack)
Configure whether to include timestamps in the output file.
pack
- true
to include timestamps (the default), false
otherwise.public boolean getWriteTimestamps()
Query whether timestamps will be written.
true
if output will include timestamps.public java.lang.String getName()
Get the visible name of this crossfold split.
public Crossfolder setName(java.lang.String n)
Set a name for this crossfolder. It will be used to generate the names of individual data sets, for example.
n
- The crossfolder name.public StaticDataSource getSource()
Get the data source backing this crossfold manager.
public void execute() throws java.io.IOException
Run the crossfold command. Write the partition files to the disk by reading in the source file.
java.io.IOException
public java.util.List<DataSet> getDataSets()
Get the train-test splits as data sets.
public java.lang.String toString()
toString
in class java.lang.Object