public DataCleaning(List <string> valores, List <string> atributos, List <string> elementsToAnalyse, int columnIndex, BoxPlotElements boxplot, StatisticAnalysisForm anterior) { this.valores = valores; this.atributos = atributos; this.anterior = anterior; this.elementsToAnalyse = elementsToAnalyse; this.columnIndex = columnIndex; this.boxplot = boxplot; InitializeComponent(); makeGrid(); optionsWatch.Items.Add("Con reemplazo"); optionsWatch.Items.Add("Sin reemplazo"); transformacionValores.Items.Add("Min - Max"); transformacionValores.Items.Add("Z-score Desviacion Estandar"); transformacionValores.Items.Add("Z-score Desviacion Media Absoluta"); }
private void correctOutliers(BoxPlotElements boxplot, List <double> numbers) { double newValue; double median; double mode; numbers = obtenerElementos(); List <double> finalNumbers = new List <double>(); finalNumbers = obtenerElementos(); numbers.Sort(); boxplot.q1 = Stadistic.getFirstQuartile(numbers); boxplot.q3 = Stadistic.getLastQuartile(numbers); var interquartil = Stadistic.getInterquartileRange(boxplot.q3, boxplot.q1); boxplot.min = Stadistic.getBoxPlotMin(boxplot.q1, interquartil); boxplot.max = Stadistic.getBoxPlotMax(boxplot.q3, interquartil); boxplot.avg = Stadistic.getAverage(numbers); Stadistic.getModeAndMedian(numbers, out mode, out median); boxplot.med = median; double diferencia = (boxplot.max - boxplot.q3) - (boxplot.q1 - boxplot.min); if (diferencia == 0) { newValue = boxplot.avg; } else { newValue = boxplot.med; } for (int i = 0; i < finalNumbers.Count; i++) { if (finalNumbers.ElementAt(i) > boxplot.max || finalNumbers.ElementAt(i) < boxplot.min) { finalNumbers[i] = newValue; tablaPrincipal.Rows[i].Cells[columnIndex].Value = newValue; } } tablaPrincipal.Refresh(); }
public StatisticAnalysisForm(List <string> data, string columnName, List <string> valores, List <string> atributos, int columnIndex, Form1 anterior) { this.anterior = anterior; this.columnIndex = columnIndex; this.valores = valores; this.atributos = atributos; elementsToAnalyse = data; this.columnName = columnName; boxplot = new BoxPlotElements(); InitializeComponent(); dataName.Text = columnName; if (isNumber().Item1) { Mode.Text = "Moda"; Median.Text = "Mediana"; Average.Text = "Promedio"; StandarDesviation.Text = "Desviación Estandar"; Frecuencias.Visible = false; boxPlot.Visible = true; makeNumericalAnalyse(isNumber().Item2, columnName); } else { Mode.Text = ""; ValueMode.Text = ""; Median.Text = ""; ValueMedian.Text = ""; Average.Text = ""; ValueAverage.Text = ""; StandarDesviation.Text = ""; ValueStandarDesviation.Text = ""; boxPlot.Visible = false; Frecuencias.Visible = true; makeCategoricalAnalyse(data); } }