public Classterization(InitialAnalysMultidimensionalData IAM, ref List <InitialStatisticalAnalys> ML, ref List <double[]> undolist, ref TreeView treeView1) { this.IAM = IAM; this.ML = ML; this.undolist = undolist; this.treeView1 = treeView1; Data = new List <double[]>(); for (int i = 0; i < IAM.N; i++) { double[] value = new double[IAM.n]; for (int j = 0; j < IAM.n; j++) { value[j] = IAM.Xall[i, j]; } Data.Add(value); } InitializeComponent(); SetData(); if (IAM.n == 2) { chart.Series.Add(PaintData.CorelPaint(IAM.ISA[0].unsortl, IAM.ISA[1].unsortl, Color.Blue, "")); chart.Series.Add(ClassterCenterSer); } }
static public void DrawClassters(Chart chart, Classter[] classters) { for (int i = 0; i < classters.Length; i++) { chart.Series.Add(PaintData.CorelPaint(classters[i].IAM.ISA[0].unsortl, classters[i].IAM.ISA[1].unsortl, PaintData.HsvToRgb(360.0 * i / classters.Length, 1, 1), "Класстер: " + (i + 1).ToString())); } }
private void Classterizate_Click(object sender, EventArgs e) { Classter.ChangeD(TypeDComboBox.Text); Classter.ChangeDSS(TypeDSSComboBox.Text); Classter.VFound(IAM); if (MethodComboBox.SelectedIndex == 0) { if (Classters.Count < 2) { return; } KAverage(); } else if (MethodComboBox.SelectedIndex == 1) { AdditionalInformationForm AIF = new AdditionalInformationForm("Введіть K"); int index; try { index = Convert.ToInt32(AIF.getString()); } catch { return; } AgmomerativClassterizate(index > 1 ? index : 2); } if (IAM.n == 2) { chart.Series[0].Enabled = chart.Series[1].Enabled = Classterizate.Visible = false; } int MaxGroup = -1; for (int j = 0; j < ML.Count; j++) { MaxGroup = Math.Max(MaxGroup, ML[j].Group); } for (int i = 0; i < Classters.Count; i++) { InitialStatisticalAnalys[] ISA = Classters[i].ToISA(MaxGroup + i + 1); if (IAM.n == 2) { chart.Series.Add( PaintData.CorelPaint(ISA[0].unsortl, ISA[1].unsortl, GetColor(i), "Classter" + (i + 1).ToString())); chart.Series[chart.Series.Count - 1].MarkerSize = 10; } for (int j = 0; j < ISA.Length; j++) { ML.Add(ISA[j]); undolist.Add(ML[ML.Count - 1].unsortl); } } WraitData.RefreshList(treeView1, ML); Classter.QFound(Classters.ToArray()); ShowQ(Classter.Q); }
private void CorelAreachartPaint(InitialAnalysMultidimensionalData IAM, Color CorelCol, Color GistCol, Chart CorelChart, Color ColLine) { for (int i = 0; i < IAM.n; i++) { for (int j = 0; j < IAM.n; j++) { string ChartAreaName = j.ToString() + "_" + i.ToString(); ChartArea ChartArea1 = new ChartArea(ChartAreaName); ChartArea1.AxisX.LabelStyle.Enabled = false; ChartArea1.AxisY.LabelStyle.Enabled = false; CorelChart.ChartAreas.Add(ChartArea1); var po = CorelAreachart.ChartAreas[0].Position; Series ser; if (i != j) { InitialStatisticalAnalys ISAX = new InitialStatisticalAnalys(InitialStatisticalAnalys.StandData(IAM.ISA[i].unsortl, IAM.ISA[i].Gx.Q, IAM.ISA[i].Mx.Q)); InitialStatisticalAnalys ISAY = new InitialStatisticalAnalys(InitialStatisticalAnalys.StandData(IAM.ISA[j].unsortl, IAM.ISA[j].Gx.Q, IAM.ISA[j].Mx.Q)); ser = PaintData.CorelPaint(ISAX.unsortl, ISAY.unsortl, CorelCol, ChartAreaName); ser.MarkerStyle = MarkerStyle.Circle; CorelChart.Series.Add(ser); double Sz = 0; if (Correlation_RegressionAnalysis.KorelationZnach(IAM.K[i, j], IAM.N, IAM.ISA[0].alf.Q)) { List <Data> Param = Correlation_RegressionAnalysis.RegresParamFound( ISAX, ISAY, IAM.K[i, j], RegresTypeName.LineRegresion, ref Sz); Series serReg = PaintData.LineRegresPaint(ISAX.Min.Q, ISAX.Max.Q, Param[0].Q, Param[1].Q, ColLine, ChartAreaName + "Line"); serReg.ChartArea = ChartAreaName; CorelChart.Series.Add(serReg); } } else { ser = PaintData.GistogPaint(IAM.ISA[i], GistCol, ChartAreaName); CorelChart.Series.Add(ser); } ser.ChartArea = ChartAreaName; } } }