public class ClassifierFactory extends Object
TrainableStatisticalModel
s, DifferentiableStatisticalModel
s, and DifferentiableSequenceScore
s.
Most parameters of the classifiers are set to default values. If you like to set some of these additional parameters to non-standard values, directly use the constructors of
TrainSMBasedClassifier
, GenDisMixClassifier
, or MSPClassifier
.Constructor and Description |
---|
ClassifierFactory() |
Modifier and Type | Method and Description |
---|---|
static AbstractClassifier |
createClassifier(DifferentiableSequenceScore... models)
Creates a classifier that is based on at least two
DifferentiableSequenceScore s. |
static AbstractClassifier |
createClassifier(double[] beta,
DifferentiableStatisticalModel... models)
Creates a classifier that is based on at least two
DifferentiableStatisticalModel s. |
static AbstractClassifier |
createClassifier(LearningPrinciple principle,
DifferentiableStatisticalModel... models)
Creates a classifier that is based on at least two
DifferentiableStatisticalModel s. |
static AbstractClassifier |
createGenerativeClassifier(TrainableStatisticalModel... models)
Creates a classifier that is based on at least two
TrainableStatisticalModel s. |
public static AbstractClassifier createGenerativeClassifier(TrainableStatisticalModel... models) throws IllegalArgumentException, CloneNotSupportedException, ClassDimensionException
TrainableStatisticalModel
s. Such models can be created using the
TrainableStatisticalModelFactory
or by directly using constructors of sub-classes of TrainableStatisticalModel
.
After the classifier has been created, it can be trained using the AbstractClassifier.train(de.jstacs.data.DataSet...)
method using
one data set for each TrainableStatisticalModel
provided.models
- the models for the individual classesIllegalArgumentException
- if the TrainableStatisticalModel
s do not describe a common domain of
sequencesCloneNotSupportedException
- if at least one TrainableStatisticalModel
could not be clonedClassDimensionException
- if the number of classes is below 2public static AbstractClassifier createClassifier(LearningPrinciple principle, DifferentiableStatisticalModel... models) throws IllegalArgumentException, Exception
DifferentiableStatisticalModel
s. Such models can be created using the
DifferentiableStatisticalModelFactory
or by directly using constructors of sub-classes of DifferentiableStatisticalModel
.
After the classifier has been created, it can be trained using the AbstractClassifier.train(de.jstacs.data.DataSet...)
method using
one data set for each DifferentiableStatisticalModel
provided. The LearningPrinciple
(generative ML or MAP,
or discriminative MCL or MSP) must be provided as first parameter.principle
- the learning principlemodels
- the models for the individual classesIllegalArgumentException
- if the lengths of the DifferentiableStatisticalModel
s (see SequenceScore.getLength()
) are incompatibleException
- if something else went wrongpublic static AbstractClassifier createClassifier(double[] beta, DifferentiableStatisticalModel... models) throws IllegalArgumentException, Exception
DifferentiableStatisticalModel
s. Such models can be created using the
DifferentiableStatisticalModelFactory
or by directly using constructors of sub-classes of DifferentiableStatisticalModel
.
After the classifier has been created, it can be trained using the AbstractClassifier.train(de.jstacs.data.DataSet...)
method using
one data set for each DifferentiableStatisticalModel
provided. The beta
array determines the employed learning principle
and must be provided as first parameter.beta
- an array specifying the learning principle by weighting factors for conditional likelihood, likelihood and priormodels
- the models for the individual classesIllegalArgumentException
- if the lengths of the DifferentiableStatisticalModel
s (see SequenceScore.getLength()
) are incompatibleException
- if something else went wrongLearningPrinciple
,
LogGenDisMixFunction
public static AbstractClassifier createClassifier(DifferentiableSequenceScore... models) throws IllegalArgumentException, Exception
DifferentiableSequenceScore
s. Such scores can be created using the
DifferentiableStatisticalModelFactory
(since DifferentiableStatisticalModel
s are also DifferentiableSequenceScore
s)
or by directly using constructors of sub-classes of DifferentiableSequenceScore
.
After the classifier has been created, it can be trained using the discriminative MCL principle using the AbstractClassifier.train(de.jstacs.data.DataSet...)
method using
one data set for each DifferentiableSequenceScore
provided.models
- the models for the individual classesIllegalArgumentException
- if the lengths of the DifferentiableSequenceScore
s (see SequenceScore.getLength()
) are incompatibleException
- if something else went wrong