Example #1
0
        private void btnProject_Click(object sender, EventArgs e)
        {
            if (pls == null || dgvProjectionSourceX.DataSource == null || dgvProjectionSourceY.DataSource == null)
            {
                MessageBox.Show("Please compute the analysis first.");
                return;
            }

            int components = (int)numComponents.Value;

            double[,] sourceInput  = Matrix.ToMatrix(dgvProjectionSourceX.DataSource as DataTable);
            double[,] sourceOutput = Matrix.ToMatrix(dgvProjectionSourceY.DataSource as DataTable);

            double[,] input  = pls.Transform(sourceInput, components);
            double[,] output = pls.TransformOutput(sourceOutput, components);

            dgvProjectionX.DataSource = new ArrayDataView(input);
            dgvProjectionY.DataSource = new ArrayDataView(output);
        }