K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.public class LocalDatasetBuilder<K,V> extends Object implements DatasetBuilder<K,V>
LocalDataset
. Encapsulate logic of building local dataset such as allocation
required data structures and initialization of context
part of partitions.Constructor and Description |
---|
LocalDatasetBuilder(Map<K,V> upstreamMap,
IgniteBiPredicate<K,V> filter,
int partitions)
Constructs a new instance of local dataset builder that makes
LocalDataset . |
LocalDatasetBuilder(Map<K,V> upstreamMap,
IgniteBiPredicate<K,V> filter,
int partitions,
UpstreamTransformerBuilder upstreamTransformerBuilder)
Constructs a new instance of local dataset builder that makes
LocalDataset . |
LocalDatasetBuilder(Map<K,V> upstreamMap,
int partitions)
Constructs a new instance of local dataset builder that makes
LocalDataset with default predicate that
passes all upstream entries to dataset. |
Modifier and Type | Method and Description |
---|---|
<C extends Serializable,D extends AutoCloseable> |
build(LearningEnvironmentBuilder envBuilder,
PartitionContextBuilder<K,V,C> partCtxBuilder,
PartitionDataBuilder<K,V,C,D> partDataBuilder,
LearningEnvironment learningEnvironment)
Constructs a new instance of
Dataset that includes allocation required data structures and
initialization of context part of partitions. |
DatasetBuilder<K,V> |
withFilter(IgniteBiPredicate<K,V> filterToAdd)
Returns new instance of DatasetBuilder using conjunction of internal filter and
filterToAdd . |
DatasetBuilder<K,V> |
withUpstreamTransformer(UpstreamTransformerBuilder builder)
Returns new instance of
DatasetBuilder with new UpstreamTransformerBuilder added
to chain of upstream transformer builders. |
public LocalDatasetBuilder(Map<K,V> upstreamMap, int partitions)
LocalDataset
with default predicate that
passes all upstream entries to dataset.upstreamMap
- Map
with upstream data.partitions
- Number of partitions.public LocalDatasetBuilder(Map<K,V> upstreamMap, IgniteBiPredicate<K,V> filter, int partitions, UpstreamTransformerBuilder upstreamTransformerBuilder)
LocalDataset
.upstreamMap
- Map
with upstream data.filter
- Filter for upstream
data.partitions
- Number of partitions.upstreamTransformerBuilder
- Builder of upstream transformer.public LocalDatasetBuilder(Map<K,V> upstreamMap, IgniteBiPredicate<K,V> filter, int partitions)
LocalDataset
.upstreamMap
- Map
with upstream data.filter
- Filter for upstream
data.partitions
- Number of partitions.public <C extends Serializable,D extends AutoCloseable> LocalDataset<C,D> build(LearningEnvironmentBuilder envBuilder, PartitionContextBuilder<K,V,C> partCtxBuilder, PartitionDataBuilder<K,V,C,D> partDataBuilder, LearningEnvironment learningEnvironment)
Dataset
that includes allocation required data structures and
initialization of context
part of partitions.build
in interface DatasetBuilder<K,V>
C
- Type of a partition context
.D
- Type of a partition data
.envBuilder
- Learning environment builder.partCtxBuilder
- Partition context
builder.partDataBuilder
- Partition data
builder.learningEnvironment
- Local learning environment.public DatasetBuilder<K,V> withUpstreamTransformer(UpstreamTransformerBuilder builder)
DatasetBuilder
with new UpstreamTransformerBuilder
added
to chain of upstream transformer builders. When needed, each builder in chain first transformed into
UpstreamTransformer
, those are in turn composed together one after another forming
final UpstreamTransformer
.
This transformer is applied to upstream data before it is passed
to PartitionDataBuilder
and PartitionContextBuilder
. This is needed to allow
transformation to upstream data which are agnostic of any changes that happen after.
Such transformations may be used for deriving meta-algorithms such as bagging
(see BaggingUpstreamTransformer
).withUpstreamTransformer
in interface DatasetBuilder<K,V>
DatasetBuilder
with new UpstreamTransformerBuilder
added
to chain of upstream transformer builders.public DatasetBuilder<K,V> withFilter(IgniteBiPredicate<K,V> filterToAdd)
filterToAdd
.withFilter
in interface DatasetBuilder<K,V>
filterToAdd
- Additional filter.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024