void analizeToolStripMenuItem_Click(object sender, EventArgs e) { try { int N; int[] arrF; double[] arrPC; string[] arrC; int[][] arrArrIC; double H; ReplForm rf = new ReplForm(); if (rf.ShowDialog() != DialogResult.OK) { return; } Quality.ClustRepl(matrY, matrLL, arrYMin, arrYMax, rf.arrRepl, out matrL, out N, out arrF, out arrP, out arrC, out arrArrIC, out arrPC, out H); arrReport[9] = string.Format("Общее количество наблюдений: {0}<br>" + "Количество наблюдений, попавших в рассматриваемую область качества: {1}<br>", matrX.GetLength(0), N); arrReport[10] = Quality.CTable(arrYName, matrL, arrYMin, arrYMax, arrF, arrP, arrYAv); arrReport[11] = Quality.RTable(arrC, arrPC); arrReport[12] = string.Format("H = {0:F3}", H); } catch { MessageBox.Show("Ошибка анализа"); } }
void analizeToolStripMenuItem_Click(object sender, EventArgs e) { try { int N; int[] arrF; double[] arrP, arrPC; double[][] matrL; string[] arrC; int[][] arrArrIC; double H; Quality.Clast(matrY, matrLL, arrYMin, arrYMax, clusters, out matrL, out N, out arrF, out arrP, out arrC, out arrArrIC, out arrPC, out H); arrRep[2] = string.Format("Общее количество наблюдений: {0}<br>" + "Количество наблюдений, попавших в рассматриваемую область качества: {1}<br>", matrX.GetLength(0), N); arrRep[3] = Quality.CTable(arrYName, matrL, arrYMin, arrYMax, arrF, arrP); arrRep[4] = Quality.RTable(arrC, arrPC); arrRep[5] = string.Format("H = {0:F3}", H); /*string[] arrG, arrGU; * int[][] arrArrI; * int N, N1; * Quality.SetID(matrY, arrYMin, arrYMax, out arrG, out arrGU, out arrArrI, out N, out N1); * int[] arrIS, arrFreq; * string[] arrGS; * int[][] arrArrIS; * Quality.Sort(arrGU, arrArrI, out arrIS, out arrFreq, out arrGS, out arrArrIS); * string[] arrGC; * double[] arrP, arrP1, arrPM; * int[] arrGFreq; * double H; * Quality.Clustering(arrGS, arrArrIS, N, N1, out arrGC, out arrGFreq, out arrP, out arrP1, out arrPM, out H); * //arrRep[0] = Quality.DataTable(arrXName, arrYName, matrX, matrY, arrG); * arrRep[2] = string.Format("Общее количество наблюдений: {0}<br>" + * "Количество качественных экземпляров: {1}<br>" + * "Количество бракованных экземпляров: {2}", N, N - N1, N1); * arrRep[3] = Quality.GTable(arrGU, arrArrI); * arrRep[4] = Quality.ITable(arrIS, arrYName, arrFreq); * arrRep[5] = Quality.GTable(arrGS, arrArrIS); * arrRep[6] = Quality.PTable(arrGC, arrGFreq, arrP, arrP1, arrPM); * arrRep[7] = Quality.ID2dTable(arrGC, arrP); * arrRep[8] = Quality.ID2dTable(arrGC, arrP1); * arrRep[9] = Quality.ID2dTable(arrGC, arrPM); * arrRep[10] = string.Format("H = {0:F3}", H);*/ } catch { MessageBox.Show("Ошибка анализа"); } }
void importToolStripMenuItem_Click(object sender, EventArgs e) { try { ImportForm form = new ImportForm(); if (form.ShowDialog() != DialogResult.OK) { return; } matrX = form.matrX; matrY = form.matrY; arrXName = form.arrXName; arrYName = form.arrYName; arrXAv = form.arrXAv; arrYAv = form.arrYAv; QMinMaxForm qf = new QMinMaxForm(arrYName); if (qf.ShowDialog() != DialogResult.OK) { return; } arrYMin = qf.arrYMin; arrYMax = qf.arrYMax; for (int i = 0; i < arrYMin.Length; i++) { arrYMin[i] /= arrYAv[i]; arrYMax[i] /= arrYAv[i]; } ClustForm cf = new ClustForm(arrYName); if (cf.ShowDialog() != DialogResult.OK) { return; } matrLL = cf.matrLL; arrReport = new string[14]; arrReport[0] = "Наблюдения (в скобках указаны ненормированные значения)" + Quality.DataTable2(arrXName, arrYName, matrX, matrY, arrXAv, arrYAv); arrReport[8] = ""; wb.DocumentText = arrReport[0]; if (arrYName.Length == 2) { histToolStripMenuItem.Visible = true; hist3dToolStripMenuItem.Visible = false; } else if (arrYName.Length == 3) { histToolStripMenuItem.Visible = false; hist3dToolStripMenuItem.Visible = true; } else { histToolStripMenuItem.Visible = false; hist3dToolStripMenuItem.Visible = false; } } catch { MessageBox.Show("Ошибка импорта"); return; } try { int[] arrF; int N; Quality.Clust(matrY, matrLL, arrYMin, arrYMax, out matrL, out arrF, out arrP, out N); arrReport[9] = string.Format("Общее количество наблюдений: {0}<br>" + "Количество наблюдений, попавших в рассматриваемую область качества: {1}<br>", matrX.GetLength(0), N); arrReport[10] = "Эмпирические вероятности попадания в кластеры (в скобках /.../ - ненормированные границы кластеров)" + Quality.CTable(arrYName, matrL, arrYMin, arrYMax, arrF, arrP, arrYAv); } catch { MessageBox.Show("Ошибка кластеризации"); } }