Accord.Statistics.Kernels.Sparse.SparseLaplacian.Estimate C# (CSharp) Метод

Estimate() публичный статический Метод

Estimate appropriate values for sigma given a data set.
This method uses a simple heuristic to obtain appropriate values for sigma in a radial basis function kernel. The heuristic is shown by Caputo, Sim, Furesjo and Smola, "Appearance-based object recognition using SVMs: which kernel should I use?", 2002.
public static Estimate ( double inputs, int samples, DoubleRange &range ) : SparseLaplacian
inputs double The data set.
samples int The number of random samples to analyze.
range DoubleRange The range of suitable values for sigma.
Результат SparseLaplacian
        public static SparseLaplacian Estimate(double[][] inputs, int samples, out DoubleRange range)
        {
            if (samples > inputs.Length)
                throw new ArgumentOutOfRangeException("samples");

            double[] distances = Gaussian.Distances(inputs, samples);

            double q1 = distances[(int)Math.Ceiling(0.15 * distances.Length)];
            double q9 = distances[(int)Math.Ceiling(0.85 * distances.Length)];
            double qm = distances.Median(alreadySorted: true);

            range = new DoubleRange(q1, q9);

            return new SparseLaplacian(sigma: qm);
        }
    }