L
- Type of labels.public class BaggedTrainer<L> extends DatasetTrainer<BaggedModel,L>
Bagging is done on both samples and features (Samples bagging, Features bagging).
DatasetTrainer.EmptyDatasetException
envBuilder, environment
Constructor and Description |
---|
BaggedTrainer(DatasetTrainer<? extends IgniteModel,L> tr,
PredictionsAggregator aggregator,
int ensembleSize,
double subsampleRatio,
int featuresVectorSize,
int featureSubspaceDim)
Construct instance of this class with given parameters.
|
Modifier and Type | Method and Description |
---|---|
<K,V> BaggedModel |
fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder,
Preprocessor<K,V> preprocessor)
Trains model based on the specified data.
|
static int[] |
getMapping(int featuresVectorSize,
int maximumFeaturesCntPerMdl,
long seed)
Get mapping R^featuresVectorSize -> R^maximumFeaturesCntPerMdl.
|
boolean |
isUpdateable(BaggedModel mdl)
This method is never called, instead of constructing logic of update from
DatasetTrainer.isUpdateable(M) and
DatasetTrainer.updateModel(M, org.apache.ignite.ml.dataset.DatasetBuilder<K, V>, org.apache.ignite.ml.preprocessing.Preprocessor<K, V>)
in this class we explicitly override update method. |
<K,V> BaggedModel |
update(BaggedModel 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.
|
protected <K,V> BaggedModel |
updateModel(BaggedModel mdl,
DatasetBuilder<K,V> datasetBuilder,
Preprocessor<K,V> preprocessor)
This method is never called, instead of constructing logic of update from
DatasetTrainer.isUpdateable(M) and
DatasetTrainer.updateModel(M, org.apache.ignite.ml.dataset.DatasetBuilder<K, V>, org.apache.ignite.ml.preprocessing.Preprocessor<K, V>)
in this class we explicitly override update method. |
BaggedTrainer<L> |
withEnvironmentBuilder(LearningEnvironmentBuilder envBuilder)
Changes learning Environment.
|
fit, fit, fit, fit, fit, fit, getLastTrainedModelOrThrowEmptyDatasetException, identityTrainer, learningEnvironment, update, update, update, update, withConvertedLabels
public BaggedTrainer(DatasetTrainer<? extends IgniteModel,L> tr, PredictionsAggregator aggregator, int ensembleSize, double subsampleRatio, int featuresVectorSize, int featureSubspaceDim)
tr
- Trainer for making bagged.aggregator
- Aggregator of models.ensembleSize
- Size of ensemble.subsampleRatio
- Ratio (subsample size) / (initial dataset size).featuresVectorSize
- Dimensionality of feature vector.featureSubspaceDim
- Dimensionality of feature subspace.public static int[] getMapping(int featuresVectorSize, int maximumFeaturesCntPerMdl, long seed)
featuresVectorSize
- Features vector size (Dimension of initial space).maximumFeaturesCntPerMdl
- Dimension of target space.seed
- Seed.public <K,V> BaggedModel fitWithInitializedDeployingContext(DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)
fitWithInitializedDeployingContext
in class DatasetTrainer<BaggedModel,L>
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> BaggedModel update(BaggedModel mdl, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)
update
in class DatasetTrainer<BaggedModel,L>
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 BaggedTrainer<L> withEnvironmentBuilder(LearningEnvironmentBuilder envBuilder)
withEnvironmentBuilder
in class DatasetTrainer<BaggedModel,L>
envBuilder
- Learning environment builder.public boolean isUpdateable(BaggedModel mdl)
DatasetTrainer.isUpdateable(M)
and
DatasetTrainer.updateModel(M, org.apache.ignite.ml.dataset.DatasetBuilder<K, V>, org.apache.ignite.ml.preprocessing.Preprocessor<K, V>)
in this class we explicitly override update method.isUpdateable
in class DatasetTrainer<BaggedModel,L>
mdl
- Model.protected <K,V> BaggedModel updateModel(BaggedModel mdl, DatasetBuilder<K,V> datasetBuilder, Preprocessor<K,V> preprocessor)
DatasetTrainer.isUpdateable(M)
and
DatasetTrainer.updateModel(M, org.apache.ignite.ml.dataset.DatasetBuilder<K, V>, org.apache.ignite.ml.preprocessing.Preprocessor<K, V>)
in this class we explicitly override update method.updateModel
in class DatasetTrainer<BaggedModel,L>
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.mdl
- Model.datasetBuilder
- Dataset builder.preprocessor
- Extractor of UpstreamEntry
into LabeledVector
.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024