public class DataSet extends Object
A train-test data set.
Constructor and Description |
---|
DataSet(String name,
StaticDataSource train,
StaticDataSource query,
StaticDataSource test,
UUID grp,
Map<String,Object> attrs)
Create a new data set.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(LenskitConfiguration config)
Configure LensKit to have the training data from this data source.
|
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 List<DataSet> |
fromJSON(com.fasterxml.jackson.databind.JsonNode json,
URI base)
Load one or more data sets from JSON data.
|
LongSet |
getAllItems() |
Map<String,Object> |
getAttributes()
Get the data set attributes (used for identification in output).
|
UUID |
getIsolationGroup()
Get the isolation group ID for this data set.
|
String |
getName()
Get the data set name.
|
StaticDataSource |
getQueryData()
Get the query data.
|
StaticDataSource |
getTestData()
Get the training data.
|
StaticDataSource |
getTrainingData()
Get the training data.
|
static List<DataSet> |
load(Path file)
Load one or more data sets from a YAML manifest file.
|
static List<DataSet> |
load(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(String name)
Create a new generic train-test data set builder.
|
String |
toString() |
public DataSet(@Nonnull String name, @Nonnull StaticDataSource train, @Nullable StaticDataSource query, @Nonnull StaticDataSource test, @Nonnull UUID grp, Map<String,Object> attrs)
Create a new data set.
name
- The name.train
- The training source.query
- The query source (if any).test
- The test data source.grp
- The data set isolation group.attrs
- The data set attributes.@Nonnull public String getName()
Get the data set name.
public Map<String,Object> getAttributes()
Get the data set attributes (used for identification in output).
public 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 getQueryData()
Get the query data.
public LongSet getAllItems()
public void configure(LenskitConfiguration config)
Configure LensKit to have the training data from this data source.
config
- A configuration in which the training data for this data set should be configured.public static DataSetBuilder newBuilder()
Create a new generic train-test data set builder.
public static DataSetBuilder newBuilder(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 List<DataSet> fromJSON(com.fasterxml.jackson.databind.JsonNode json, URI base) throws IOException
Load one or more data sets from JSON data.
IOException
public static List<DataSet> load(Path file) throws IOException
Load one or more data sets from a YAML manifest file.
file
- The path to the YAML manifest file.IOException
public static List<DataSet> load(URL url) throws IOException
Load one or more data sets from a YAML manifest file.
url
- The URL of a the YAML manifest file.IOException