1. A method of assigning a test pattern to a class chosen from a predefined set of classes, comprising: calculating a class membership probability for said test pattern; and calculating a confidence interval for said class membership probability based upon a number of training patterns in a neighbourhood of said test pattern in a feature space, wherein said number of training patterns in the neighbourhood of the test pattern is obtained from computing a convolution of a density function of said training patterns with a Gaussian smoothing function centred on said test pattern, said density function of the training patterns being represented as a mixture of Gaussian functions, and said convolution of the density function of the train patterns and said smoothing function is calculated by a function expressible as: N N ⁡ ( x ) = ∑ K k = 1 ⁢ N k ′ ⁢ exp ⁢ { - ( x - μ k ) ⁢ S k ′ - 1 ⁡ ( x - μ k ) / 2 } , where x represents said test pattern, N N (x) the number of training patterns in a neighbourhood of x, K the number of Gaussian functions in said mixture, μ k , the centre of the k-th Gaussian function, S′ k a matrix and N′ k a real number, S′ k and N′ k depending on said smoothing function and the k-th Gaussian function.