Table of Contents

Method ComputeFraudScore

Namespace
RinhaBackend
Assembly
Api.dll

ComputeFraudScore(Span<float>)

Computes the fraud score for a normalized feature vector by running a KNN search. Returns a value in [0, 1]: the fraction of the K nearest neighbors labeled as fraud.

public float ComputeFraudScore(Span<float> query)

Parameters

query Span<float>

Returns

float

Remarks

Performs a brute-force K=5 nearest-neighbor search using squared Euclidean distance. Uses stack-allocated buffers and unsafe ref arithmetic to stay off the heap on the hot path.