public class LogisticRegressionSGDTrainer<P extends Serializable> extends SingleLabelDatasetTrainer<LogisticRegressionModel>
DatasetTrainer.EmptyDatasetException
environment
Constructor and Description |
---|
LogisticRegressionSGDTrainer() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkState(LogisticRegressionModel mdl) |
<K,V> LogisticRegressionModel |
fit(DatasetBuilder<K,V> datasetBuilder,
IgniteBiFunction<K,V,Vector> featureExtractor,
IgniteBiFunction<K,V,Double> lbExtractor)
Trains model based on the specified data.
|
int |
getBatchSize()
Get the batch size.
|
int |
getLocIterations()
Get the amount of local iterations.
|
int |
getMaxIterations()
Get the max amount of iterations.
|
long |
getSeed()
Get the seed for random generator.
|
UpdatesStrategy |
getUpdatesStgy()
Get the update strategy.
|
protected <K,V> LogisticRegressionModel |
updateModel(LogisticRegressionModel mdl,
DatasetBuilder<K,V> datasetBuilder,
IgniteBiFunction<K,V,Vector> featureExtractor,
IgniteBiFunction<K,V,Double> lbExtractor)
Gets state of model in arguments, update in according to new data and return new model.
|
LogisticRegressionSGDTrainer<P> |
withBatchSize(int batchSize)
Set up the batchSize parameter.
|
LogisticRegressionSGDTrainer<P> |
withLocIterations(int amountOfLocIterations)
Set up the amount of local iterations of SGD algorithm.
|
LogisticRegressionSGDTrainer<P> |
withMaxIterations(int maxIterations)
Set up the max amount of iterations before convergence.
|
LogisticRegressionSGDTrainer<P> |
withSeed(long seed)
Set up the random seed parameter.
|
LogisticRegressionSGDTrainer |
withUpdatesStgy(UpdatesStrategy updatesStgy)
Set up the regularization parameter.
|
fit, fit, fit, fit, getLastTrainedModelOrThrowEmptyDatasetException, setEnvironment, update, update, update, update, update
public <K,V> LogisticRegressionModel fit(DatasetBuilder<K,V> datasetBuilder, IgniteBiFunction<K,V,Vector> featureExtractor, IgniteBiFunction<K,V,Double> lbExtractor)
fit
in class DatasetTrainer<LogisticRegressionModel,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 <K,V> LogisticRegressionModel updateModel(LogisticRegressionModel mdl, DatasetBuilder<K,V> datasetBuilder, IgniteBiFunction<K,V,Vector> featureExtractor, IgniteBiFunction<K,V,Double> lbExtractor)
updateModel
in class DatasetTrainer<LogisticRegressionModel,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.protected boolean checkState(LogisticRegressionModel mdl)
checkState
in class DatasetTrainer<LogisticRegressionModel,Double>
mdl
- Model.public LogisticRegressionSGDTrainer<P> withMaxIterations(int maxIterations)
maxIterations
- The parameter value.public LogisticRegressionSGDTrainer<P> withBatchSize(int batchSize)
batchSize
- The size of learning batch.public LogisticRegressionSGDTrainer<P> withLocIterations(int amountOfLocIterations)
amountOfLocIterations
- The parameter value.public LogisticRegressionSGDTrainer<P> withSeed(long seed)
seed
- Seed for random generator.public LogisticRegressionSGDTrainer withUpdatesStgy(UpdatesStrategy updatesStgy)
updatesStgy
- Update strategy.public UpdatesStrategy getUpdatesStgy()
public int getMaxIterations()
public int getBatchSize()
public int getLocIterations()
public long getSeed()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019