public abstract class BaggingModelTrainer extends DatasetTrainer<ModelsComposition,Double>
DatasetTrainer.EmptyDatasetException
environment
Constructor and Description |
---|
BaggingModelTrainer(PredictionsAggregator predictionsAggregator,
int featureVectorSize,
int maximumFeaturesCntPerMdl,
int ensembleSize,
double samplePartSizePerMdl)
Constructs new instance of BaggingModelTrainer.
|
Modifier and Type | Method and Description |
---|---|
protected abstract DatasetTrainer<? extends Model<Vector,Double>,Double> |
buildDatasetTrainerForModel()
Creates trainer specific to ensemble.
|
<K,V> ModelsComposition |
fit(DatasetBuilder<K,V> datasetBuilder,
IgniteBiFunction<K,V,Vector> featureExtractor,
IgniteBiFunction<K,V,Double> lbExtractor)
Trains model based on the specified data.
|
<K,V> ModelsComposition |
updateModel(ModelsComposition mdl,
DatasetBuilder<K,V> datasetBuilder,
IgniteBiFunction<K,V,Vector> featureExtractor,
IgniteBiFunction<K,V,Double> lbExtractor)
Learn new models on dataset and create new Compositions over them and already learned models.
|
checkState, fit, fit, fit, fit, getLastTrainedModelOrThrowEmptyDatasetException, setEnvironment, update, update, update, update, update
public BaggingModelTrainer(PredictionsAggregator predictionsAggregator, int featureVectorSize, int maximumFeaturesCntPerMdl, int ensembleSize, double samplePartSizePerMdl)
predictionsAggregator
- Predictions aggregator.featureVectorSize
- Feature vector size.maximumFeaturesCntPerMdl
- Number of features to draw from original features vector to train each model.ensembleSize
- Ensemble size.samplePartSizePerMdl
- Size of sample part in percent to train one model.public <K,V> ModelsComposition fit(DatasetBuilder<K,V> datasetBuilder, IgniteBiFunction<K,V,Vector> featureExtractor, IgniteBiFunction<K,V,Double> lbExtractor)
fit
in class DatasetTrainer<ModelsComposition,Double>
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.datasetBuilder
- Dataset builder.featureExtractor
- Feature extractor.lbExtractor
- Label extractor.protected abstract DatasetTrainer<? extends Model<Vector,Double>,Double> buildDatasetTrainerForModel()
public <K,V> ModelsComposition updateModel(ModelsComposition mdl, DatasetBuilder<K,V> datasetBuilder, IgniteBiFunction<K,V,Vector> featureExtractor, IgniteBiFunction<K,V,Double> lbExtractor)
updateModel
in class DatasetTrainer<ModelsComposition,Double>
K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.mdl
- Learned model.datasetBuilder
- Dataset builder.featureExtractor
- Feature extractor.lbExtractor
- Label extractor.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019