M
- Type of a produced model.L
- Type of a label.public abstract class DatasetTrainer<M extends IgniteModel,L> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DatasetTrainer.EmptyDatasetException
EmptyDataset exception.
|
Modifier and Type | Field and Description |
---|---|
protected LearningEnvironmentBuilder |
envBuilder
Learning environment builder.
|
protected LearningEnvironment |
environment
Learning Environment.
|
Constructor and Description |
---|
DatasetTrainer() |
Modifier and Type | Method and Description |
---|---|
<K,V> M |
fit(DatasetBuilder<K,V> datasetBuilder,
Preprocessor<K,V> preprocessor)
Trains model based on the specified data.
|
<K,V> M |
fit(DatasetBuilder<K,V> datasetBuilder,
Preprocessor<K,V> preprocessor,
LearningEnvironment learningEnvironment)
Trains model based on the specified data.
|
<K,V> M |
fit(Ignite ignite,
IgniteCache<K,V> cache,
IgniteBiPredicate<K,V> filter,
Preprocessor<K,V> preprocessor)
Trains model based on the specified data.
|
<K,V> M |
fit(Ignite ignite,
IgniteCache<K,V> cache,
Preprocessor<K,V> preprocessor)
Trains model based on the specified data.
|
<K,V> M |
fit(Map<K,V> data,
IgniteBiPredicate<K,V> filter,
int parts,
Preprocessor<K,V> preprocessor)
Trains model based on the specified data.
|
<K,V> M |
fit(Map<K,V> data,
int parts,
Preprocessor<K,V> preprocessor)
Trains model based on the specified data.
|
protected abstract <K,V> M |
fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder,
Preprocessor<K,V> preprocessor)
Trains model based on the specified data.
|
protected M |
getLastTrainedModelOrThrowEmptyDatasetException(M lastTrainedMdl)
Used on update phase when given dataset is empty.
|
static <I,L> DatasetTrainer<IgniteModel<I,I>,L> |
identityTrainer()
Returns the trainer which returns identity model.
|
abstract boolean |
isUpdateable(M mdl) |
LearningEnvironment |
learningEnvironment()
Get learning environment.
|
<K,V> M |
update(M mdl,
DatasetBuilder<K,V> datasetBuilder,
Preprocessor<K,V> preprocessor)
Gets state of model in arguments, compare it with training parameters of trainer and if they are fit then trainer
updates model in according to new data and return new model.
|
<K,V> M |
update(M mdl,
Ignite ignite,
IgniteCache<K,V> cache,
IgniteBiPredicate<K,V> filter,
Preprocessor<K,V> preprocessor)
Gets state of model in arguments, update in according to new data and return new model.
|
<K,V> M |
update(M mdl,
Ignite ignite,
IgniteCache<K,V> cache,
Preprocessor<K,V> preprocessor)
Gets state of model in arguments, update in according to new data and return new model.
|
<K,V> M |
update(M mdl,
Map<K,V> data,
IgniteBiPredicate<K,V> filter,
int parts,
Preprocessor<K,V> preprocessor)
Gets state of model in arguments, update in according to new data and return new model.
|
<K,V> M |
update(M mdl,
Map<K,V> data,
int parts,
Preprocessor<K,V> preprocessor)
Gets state of model in arguments, update in according to new data and return new model.
|
protected abstract <K,V> M |
updateModel(M mdl,
DatasetBuilder<K,V> datasetBuilder,
Preprocessor<K,V> preprocessor)
Trains new model taken previous one as a first approximation.
|
<L1> DatasetTrainer<M,L1> |
withConvertedLabels(IgniteFunction<L1,L> new2Old)
Creates
DatasetTrainer with same training logic, but able to accept labels of given new type of labels. |
DatasetTrainer<M,L> |
withEnvironmentBuilder(LearningEnvironmentBuilder envBuilder)
Changes learning Environment.
|
protected LearningEnvironmentBuilder envBuilder
protected LearningEnvironment environment
public static <I,L> DatasetTrainer<IgniteModel<I,I>,L> identityTrainer()
I
- Type of model input.L
- Type of labels in dataset.public <K,V> M fit(DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.datasetBuilder
- Dataset builder.preprocessor
- Extractor of UpstreamEntry
into LabeledVector
.public <K,V> M fit(DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor, LearningEnvironment learningEnvironment)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.datasetBuilder
- Dataset builder.preprocessor
- Extractor of UpstreamEntry
into LabeledVector
.learningEnvironment
- Local learning environment.protected abstract <K,V> M fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.datasetBuilder
- Dataset builder.preprocessor
- Extractor of UpstreamEntry
into LabeledVector
.public <K,V> M update(M mdl, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.mdl
- Learned model.datasetBuilder
- Dataset builder.preprocessor
- Extractor of UpstreamEntry
into LabeledVector
.public abstract boolean isUpdateable(M mdl)
mdl
- Model.@NotNull protected M getLastTrainedModelOrThrowEmptyDatasetException(M lastTrainedMdl)
lastTrainedMdl
- Model.public <K,V> M fit(Ignite ignite, IgniteCache<K,V> cache, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.ignite
- Ignite instance.cache
- Ignite cache.preprocessor
- Upstream preprocessor.public <K,V> M update(M mdl, Ignite ignite, IgniteCache<K,V> cache, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.mdl
- Learned model.ignite
- Ignite instance.cache
- Ignite cache.preprocessor
- Upstream preprocessor.public <K,V> M fit(Ignite ignite, IgniteCache<K,V> cache, IgniteBiPredicate<K,V> filter, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.ignite
- Ignite instance.cache
- Ignite cache.filter
- Filter for upstream
data.preprocessor
- Upstream preprocessor.public <K,V> M update(M mdl, Ignite ignite, IgniteCache<K,V> cache, IgniteBiPredicate<K,V> filter, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.mdl
- Learned model.ignite
- Ignite instance.cache
- Ignite cache.filter
- Filter for upstream
data.preprocessor
- Upstream preprocessor.public <K,V> M fit(Map<K,V> data, int parts, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.data
- Data.parts
- Number of partitions.preprocessor
- Upstream preprocessor.public <K,V> M update(M mdl, Map<K,V> data, int parts, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.mdl
- Learned model.data
- Data.parts
- Number of partitions.preprocessor
- Upstream preprocessor.public <K,V> M fit(Map<K,V> data, IgniteBiPredicate<K,V> filter, int parts, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.data
- Data.filter
- Filter for upstream
data.parts
- Number of partitions.preprocessor
- Upstream preprocessor.public <K,V> M update(M mdl, Map<K,V> data, IgniteBiPredicate<K,V> filter, int parts, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.data
- Data.filter
- Filter for upstream
data.parts
- Number of partitions.preprocessor
- Upstream preprocessor.public DatasetTrainer<M,L> withEnvironmentBuilder(LearningEnvironmentBuilder envBuilder)
envBuilder
- Learning environment builder.protected abstract <K,V> M updateModel(M mdl, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.mdl
- Learned model.datasetBuilder
- Dataset builder.preprocessor
- Extractor of UpstreamEntry
into LabeledVector
.public LearningEnvironment learningEnvironment()
public <L1> DatasetTrainer<M,L1> withConvertedLabels(IgniteFunction<L1,L> new2Old)
DatasetTrainer
with same training logic, but able to accept labels of given new type of labels.L1
- New labels type.new2Old
- Converter of new labels to old labels.DatasetTrainer
with same training logic, but able to accept labels of given new type of labels.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024