Package smile.classification
Class AbstractClassifier<T>
java.lang.Object
smile.classification.AbstractClassifier<T>
- Type Parameters:
T
- the type of input object
- All Implemented Interfaces:
Serializable
,ToDoubleFunction<T>
,ToIntFunction<T>
,Classifier<T>
- Direct Known Subclasses:
AdaBoost
,DiscreteNaiveBayes
,FLD
,GradientTreeBoost
,KNN
,LDA
,LogisticRegression
,Maxent
,NaiveBayes
,OneVersusOne
,OneVersusRest
,QDA
,RandomForest
,RBFNetwork
,SparseLogisticRegression
Abstract base class of classifiers.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface smile.classification.Classifier
Classifier.Trainer<T,
M extends Classifier<T>> -
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractClassifier
(int[] y) Constructor.AbstractClassifier
(BaseVector<?, ?, ?> y) Constructor.AbstractClassifier
(IntSet classes) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint[]
classes()
Returns the class labels.int
Returns the number of classes.
-
Field Details
-
classes
The class labels.
-
-
Constructor Details
-
AbstractClassifier
Constructor.- Parameters:
classes
- the class labels.
-
AbstractClassifier
public AbstractClassifier(int[] y) Constructor.- Parameters:
y
- the sample labels.
-
AbstractClassifier
Constructor.- Parameters:
y
- the sample labels.
-
-
Method Details
-
numClasses
public int numClasses()Description copied from interface:Classifier
Returns the number of classes.- Specified by:
numClasses
in interfaceClassifier<T>
- Returns:
- the number of classes.
-
classes
public int[] classes()Description copied from interface:Classifier
Returns the class labels.- Specified by:
classes
in interfaceClassifier<T>
- Returns:
- the class labels.
-