java.lang.Object
com.pervasive.datarush.analytics.knn.ClassificationScheme
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
VotingClassification
Determines how to classify a query record based on
its nearest neighbors.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceResolves the class of a query record from a set of neighbors.static classRepresentation of the distance between two points. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassificationSchemeavg()Resolves the class of the query record by doing a straight average of all neighbors.abstract booleanIndicates whether the classification method is valid for the specified type.abstract ClassificationScheme.ClassifiernewClassifier(int k) Creates a new classifier for use.static ClassificationSchemevote()Resolves the class of the query records by simple plurality of all neighbors (alternatively, the mode of the neighbors).
-
Constructor Details
-
ClassificationScheme
public ClassificationScheme()
-
-
Method Details
-
isValidTargetType
Indicates whether the classification method is valid for the specified type. Some classifiers may only be applicable to continuous data.- Parameters:
type- the type of the class data- Returns:
trueif the data type is compatible,falseotherwise.
-
newClassifier
Creates a new classifier for use.- Parameters:
k- the number of neighbors to expect.- Returns:
- a new classifier
-
avg
Resolves the class of the query record by doing a straight average of all neighbors.This scheme is only applicable when the target feature is a continuous data type.
- Returns:
- a method which averages the neighbors
-
vote
Resolves the class of the query records by simple plurality of all neighbors (alternatively, the mode of the neighbors). In case of a tie, the class of the nearest neighbor is returned.- Returns:
- a method which decides by a vote of neighbors
-