public interface DataSet
Attribute
objects.Modifier and Type | Method and Description |
---|---|
boolean |
add(Instance instance)
Adds a new
Instance to this data set |
<T> List<Attribute<T>> |
attributes()
Returns the list of all attributes (inputs and output) of this data set.
|
DataSet |
filtered(Predicate<Instance> filter)
Returns a data set containing only the instances of this data set which fulfill the passed
filter . |
Iterable<Instance> |
instances()
Returns an
Iterable with this data set as its source. |
boolean |
isEmpty()
Returns true if this data set contains no instances.
|
<T> Attribute<T> |
outputAttribute()
Get the output attribute of the attributes of this
DataSet , i.e. the attribute which predictions shall be learned. |
boolean |
remove(Instance instance)
Removes an
Instance from this data set |
void |
shuffle(Random random)
Randomly permute the entries of this data set using the specified source of randomness.
|
int |
size()
Returns the number of instances in this data set.
|
TrainTestSets |
split(double fraction)
Splits the set of instances into a set for training and a set for testing according to the passed fraction.
|
TrainTestSets |
split(int numFolds,
int testIndex)
Splits the set of instances into a set for training and a set for testing according to the
passed number of folds and the index determining which one shall be used for testing.
|
Stream<Instance> |
stream()
Returns a sequential
Stream with this data set as its source. |
<T> Attribute<T> outputAttribute()
DataSet
, i.e. the attribute which predictions shall be learned.Attribute
representing the output attribute of this data set<T> List<Attribute<T>> attributes()
boolean add(Instance instance)
Instance
to this data setinstance
- the instance to addboolean remove(Instance instance)
Instance
from this data setinstance
- the instance to removeint size()
boolean isEmpty()
Iterable<Instance> instances()
Iterable
with this data set as its source.Iterable
of Instance
sStream<Instance> stream()
Stream
with this data set as its source.Stream
of Instance
svoid shuffle(Random random)
random
- the source of randomness to use to shuffle the entriesTrainTestSets split(double fraction)
fraction
- the fraction for the training set, the rest will be add to the test set.TrainTestSets
of train and test dataTrainTestSets split(int numFolds, int testIndex)
numFolds
- number of folds to apply to data settestIndex
- represents which part is used for testingTrainTestSets
of train and test data.@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.