public class DataSet
extends java.lang.Object
A train-test data set.
Constructor and Description |
---|
DataSet(java.lang.String name,
StaticDataSource train,
StaticDataSource rt,
StaticDataSource test,
java.util.UUID grp,
java.util.Map<java.lang.String,java.lang.Object> attrs,
java.util.List<EntityType> entityTypes)
Create a new data set.
|
Modifier and Type | Method and Description |
---|---|
DataSetBuilder |
copyBuilder()
Create a new builder initialized with this data set’s values.
|
static DataSetBuilder |
copyBuilder(DataSet data)
Create a new builder initialized with this data set’s values.
|
static java.util.List<DataSet> |
fromJSON(com.fasterxml.jackson.databind.JsonNode json,
java.net.URI base)
Load one or more data sets from JSON data.
|
LongSet |
getAllItems() |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Get the data set attributes (used for identification in output).
|
java.util.List<EntityType> |
getEntityTypes()
Get the entity types registered with this builder so far.
|
LenskitConfiguration |
getExtraConfiguration()
Get extra LensKit configuration required by this data set.
|
java.util.UUID |
getIsolationGroup()
Get the isolation group ID for this data set.
|
java.lang.String |
getName()
Get the data set name.
|
StaticDataSource |
getRuntimeData()
Get the runtime data set.
|
StaticDataSource |
getTestData()
Get the training data.
|
StaticDataSource |
getTrainingData()
Get the training data.
|
static java.util.List<DataSet> |
load(java.nio.file.Path file)
Load one or more data sets from a YAML manifest file.
|
static java.util.List<DataSet> |
load(java.net.URL url)
Load one or more data sets from a YAML manifest file.
|
static DataSetBuilder |
newBuilder()
Create a new generic train-test data set builder.
|
static DataSetBuilder |
newBuilder(java.lang.String name)
Create a new generic train-test data set builder.
|
java.lang.String |
toString() |
public DataSet(@Nonnull java.lang.String name, @Nonnull StaticDataSource train, @Nullable StaticDataSource rt, @Nonnull StaticDataSource test, @Nonnull java.util.UUID grp, java.util.Map<java.lang.String,java.lang.Object> attrs, @Nonnull java.util.List<EntityType> entityTypes)
Create a new data set.
name
- The name.train
- The training source.test
- The test data source.grp
- The data set isolation group.attrs
- The data set attributes.@Nonnull public java.lang.String getName()
Get the data set name.
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Get the data set attributes (used for identification in output).
public java.util.UUID getIsolationGroup()
Get the isolation group ID for this data set. Data sets in the same group will be allowed to run in parallel. This is used to implement data set isolation.
@Nonnull public StaticDataSource getTestData()
Get the training data.
@Nonnull public StaticDataSource getTrainingData()
Get the training data.
@Nullable public StaticDataSource getRuntimeData()
Get the runtime data set. This is the data that should be available when the recommender is run, but not when its model is trained.
public LongSet getAllItems()
@Nonnull public java.util.List<EntityType> getEntityTypes()
Get the entity types registered with this builder so far.
public LenskitConfiguration getExtraConfiguration()
Get extra LensKit configuration required by this data set.
public java.lang.String toString()
toString
in class java.lang.Object
public static DataSetBuilder newBuilder()
Create a new generic train-test data set builder.
public static DataSetBuilder newBuilder(java.lang.String name)
Create a new generic train-test data set builder.
name
- The data set name.public DataSetBuilder copyBuilder()
Create a new builder initialized with this data set’s values.
public static DataSetBuilder copyBuilder(DataSet data)
Create a new builder initialized with this data set’s values.
public static java.util.List<DataSet> fromJSON(com.fasterxml.jackson.databind.JsonNode json, java.net.URI base) throws java.io.IOException
Load one or more data sets from JSON data.
java.io.IOException
public static java.util.List<DataSet> load(java.nio.file.Path file) throws java.io.IOException
Load one or more data sets from a YAML manifest file.
file
- The path to the YAML manifest file.java.io.IOException
public static java.util.List<DataSet> load(java.net.URL url) throws java.io.IOException
Load one or more data sets from a YAML manifest file.
url
- The URL of a the YAML manifest file.java.io.IOException