public class SVMLinearBinaryClassificationTrainer extends SingleLabelDatasetTrainer<SVMLinearBinaryClassificationModel>
This trainer takes input as Labeled Dataset with 0 and 1 labels for two classes and makes binary classification.
The paper about this algorithm could be found here https://arxiv.org/abs/1409.1458.DatasetTrainer.EmptyDatasetException
environment
Constructor and Description |
---|
SVMLinearBinaryClassificationTrainer() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkState(SVMLinearBinaryClassificationModel mdl) |
<K,V> SVMLinearBinaryClassificationModel |
fit(DatasetBuilder<K,V> datasetBuilder,
IgniteBiFunction<K,V,Vector> featureExtractor,
IgniteBiFunction<K,V,Double> lbExtractor)
Trains model based on the specified data.
|
int |
getAmountOfIterations()
Get the amount of outer iterations of SCDA algorithm.
|
int |
getAmountOfLocIterations()
Get the amount of local iterations of SCDA algorithm.
|
double |
getLambda()
Get the regularization lambda.
|
long |
getSeed()
Get the seed number.
|
protected <K,V> SVMLinearBinaryClassificationModel |
updateModel(SVMLinearBinaryClassificationModel 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.
|
SVMLinearBinaryClassificationTrainer |
withAmountOfIterations(int amountOfIterations)
Set up the amount of outer iterations of SCDA algorithm.
|
SVMLinearBinaryClassificationTrainer |
withAmountOfLocIterations(int amountOfLocIterations)
Set up the amount of local iterations of SCDA algorithm.
|
SVMLinearBinaryClassificationTrainer |
withLambda(double lambda)
Set up the regularization parameter.
|
SVMLinearBinaryClassificationTrainer |
withSeed(long seed)
Set up the seed.
|
fit, fit, fit, fit, getLastTrainedModelOrThrowEmptyDatasetException, setEnvironment, update, update, update, update, update
public SVMLinearBinaryClassificationTrainer()
public <K,V> SVMLinearBinaryClassificationModel fit(DatasetBuilder<K,V> datasetBuilder, IgniteBiFunction<K,V,Vector> featureExtractor, IgniteBiFunction<K,V,Double> lbExtractor)
fit
in class DatasetTrainer<SVMLinearBinaryClassificationModel,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> SVMLinearBinaryClassificationModel updateModel(SVMLinearBinaryClassificationModel mdl, DatasetBuilder<K,V> datasetBuilder, IgniteBiFunction<K,V,Vector> featureExtractor, IgniteBiFunction<K,V,Double> lbExtractor)
updateModel
in class DatasetTrainer<SVMLinearBinaryClassificationModel,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(SVMLinearBinaryClassificationModel mdl)
checkState
in class DatasetTrainer<SVMLinearBinaryClassificationModel,Double>
mdl
- Model.public SVMLinearBinaryClassificationTrainer withLambda(double lambda)
lambda
- The regularization parameter. Should be more than 0.0.public double getLambda()
public int getAmountOfIterations()
public SVMLinearBinaryClassificationTrainer withAmountOfIterations(int amountOfIterations)
amountOfIterations
- The parameter value.public int getAmountOfLocIterations()
public SVMLinearBinaryClassificationTrainer withAmountOfLocIterations(int amountOfLocIterations)
amountOfLocIterations
- The parameter value.public long getSeed()
public SVMLinearBinaryClassificationTrainer withSeed(long seed)
seed
- The parameter value.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019