Show / Hide Table of Contents

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

Inheritance
System.Object
PipelineBase
OneClassNearestNeighborClassifier
Implements
ILoggerObject
IProgress
IPipelineIO
IClassifier
Inherited Members
PipelineBase.PipelineInputs
PipelineBase.PipelineOutputs
PipelineBase.Logger
PipelineBase.Progress
PipelineBase.ProgressChanged
PipelineBase.OnProgressChanged()
Namespace: SigStat.Common.PipelineItems.Classifiers
Assembly: SigStat.Common.dll
Syntax
public class OneClassNearestNeighborClassifier : PipelineBase, ILoggerObject, IProgress, IPipelineIO, IClassifier

Constructors

| Improve this Doc View Source

OneClassNearestNeighborClassifier(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 Source

DistanceFunction

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[][]>
| Improve this Doc View Source

Features

FeatureDescriptors to consider during classification

Declaration
public List<FeatureDescriptor> Features { get; set; }
Property Value
Type Description
List<FeatureDescriptor>
| Improve this Doc View Source

J

The J parameter of the Ocjknn classifier

Declaration
public int J { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

K

The K parameter of the Ocjknn classifier

Declaration
public int K { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

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 Source

Test(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
| Improve this Doc View Source

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
| Improve this Doc View Source

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

Implements

ILoggerObject
IProgress
IPipelineIO
IClassifier

See Also

PipelineBase
IDistanceClassifier
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX