Class OneClassNearestNeighborClassifier
This IDistanceClassifier implementation will consider both test and training samples and claculate the threshold to separate the original and forged signatures to approximate EER. Note that this classifier is not applicable for real world scenarios. It was developed to test the theoratical boundaries of threshold based classification
Inherited Members
Namespace: SigStat.Common.PipelineItems.Classifiers
Assembly: SigStat.Common.dll
Syntax
public class OneClassNearestNeighborClassifier : PipelineBase, ILoggerObject, IProgress, IPipelineIO, IClassifier
Constructors
| Improve this Doc View SourceOneClassNearestNeighborClassifier(Int32, Int32, Double, IDistance<Double[][]>)
Initializes a new instance of the OneClassNearestNeighborClassifier class.
Declaration
public OneClassNearestNeighborClassifier(int j = 1, int k = 1, double threshold = null, IDistance<double[][]> distanceFunction = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | j | The J parameter of the Ocjknn classifier |
System.Int32 | k | The K parameter of the Ocjknn classifier |
System.Double | threshold | The K parameter of the Ocjknn classifier |
IDistance<System.Double[][]> | distanceFunction | The distance function. |
Properties
| Improve this Doc View SourceDistanceFunction
The function used to calculate the distance between two data sequences
Declaration
public IDistance<double[][]> DistanceFunction { get; set; }
Property Value
Type | Description |
---|---|
IDistance<System.Double[][]> |
Features
FeatureDescriptors to consider during classification
Declaration
public List<FeatureDescriptor> Features { get; set; }
Property Value
Type | Description |
---|---|
List<FeatureDescriptor> |
J
The J parameter of the Ocjknn classifier
Declaration
public int J { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
K
The K parameter of the Ocjknn classifier
Declaration
public int K { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Threshold
The Threshold parameter of the Ocjknn classifier
Declaration
public double Threshold { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceTest(ISignerModel, Signature)
Returns a double value in the range [0..1], representing the probability of the given signature belonging to the trained model.
Declaration
public double Test(ISignerModel signerModel, Signature testSignature)
Parameters
Type | Name | Description |
---|---|---|
ISignerModel | signerModel | |
Signature | testSignature |
Returns
Type | Description |
---|---|
System.Double |
Train(List<Signature>)
Trains a model based on the signatures and returns the trained model
Declaration
public ISignerModel Train(List<Signature> signatures)
Parameters
Type | Name | Description |
---|---|---|
List<Signature> | signatures |
Returns
Type | Description |
---|---|
ISignerModel |
Train(List<Signature>, DistanceMatrix<String, String, Double>)
Trains the specified signatures based on a precalculated distance matrix
Declaration
public ISignerModel Train(List<Signature> signatures, DistanceMatrix<string, string, double> distanceMatrix)
Parameters
Type | Name | Description |
---|---|---|
List<Signature> | signatures | The signatures. |
DistanceMatrix<System.String, System.String, System.Double> | distanceMatrix | The distance matrix may contain all the distance pairs for the signatures. If you ommit this parameter, distances will be calculated automatically using DistanceFunction. |
Returns
Type | Description |
---|---|
ISignerModel |