SampleApp.MainForm.btnEstimateSigma_Click C# (CSharp) Method

btnEstimateSigma_Click() private method

Estimates a suitable value for the Gaussian's kernel sigma
private btnEstimateSigma_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void btnEstimateSigma_Click(object sender, EventArgs e)
        {
            // Extract inputs
            int rows = dgvTrainingSource.Rows.Count;
            double[][] input = new double[rows][];
            for (int i = 0; i < rows; i++)
                input[i] = (double[])dgvTrainingSource.Rows[i].Cells["colTrainingFeatures"].Value;

            Gaussian g = Gaussian.Estimate(input, input.Length / 4);

            numSigma.Value = (decimal)g.Sigma;
        }
MainForm