Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/16/16 12:04:56 (8 years ago)
Author:
pfleck
Message:

#2632

  • Added the name of the target variable in plots and charts (scatter, line, ...).
  • Renamed MathSymbolicDataAnalysisModelView and added two subclasses for regression and classification that shows the name of the target variable in the equation. (added and used a new Format method to the LatexFormatter that uses the actual target name when encountering the StartSymbol)
Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/ConfidenceRegressionSolutionLineChartView.cs

    r14185 r14255  
    2828using HeuristicLab.Problems.DataAnalysis;
    2929using HeuristicLab.Problems.DataAnalysis.Views;
     30using HeuristicLab.Visualization.ChartControlsExtensions;
    3031
    3132namespace HeuristicLab.Algorithms.DataAnalysis.Views {
     
    109110        // target
    110111        this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME);
    111         this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable;
     112        this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = TARGETVARIABLE_SERIES_NAME;
    112113        this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    113114        this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindXY(Enumerable.Range(0, Content.ProblemData.Dataset.Rows).ToArray(),
     
    126127        var s3Color = chart.Series[3].Color;
    127128        this.chart.PaletteCustomColors = new Color[] { s1Color, s2Color, s3Color, s0Color };
     129
     130        // set the y-axis
     131        var axisY = this.chart.ChartAreas[0].AxisY;
     132        axisY.Title = Content.ProblemData.TargetVariable;
     133        double min = double.MaxValue, max = double.MinValue;
     134        foreach (var point in chart.Series.SelectMany(x => x.Points)) {
     135          if (!point.YValues.Any() || double.IsInfinity(point.YValues[0]) || double.IsNaN(point.YValues[0]))
     136            continue;
     137          var y = point.YValues[0];
     138          if (y < min)
     139            min = y;
     140          if (y > max)
     141            max = y;
     142        }
     143
     144        double axisMin, axisMax, axisInterval;
     145        ChartUtil.CalculateOptimalAxisInterval(min, max, out axisMin, out axisMax, out axisInterval);
     146        axisY.Minimum = axisMin;
     147        axisY.Maximum = axisMax;
     148        axisY.Interval = axisInterval;
    128149
    129150        UpdateCursorInterval();
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs

    r14185 r14255  
    154154      }
    155155
    156       chart.ChartAreas[0].AxisX.Title = residualComboBox.SelectedItem.ToString();
     156      chart.ChartAreas[0].AxisX.Title = string.Format("{0} ({1})", residualComboBox.SelectedItem, Content.ProblemData.TargetVariable);
    157157    }
    158158
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs

    r14185 r14255  
    6464
    6565        this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME);
    66         this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable;
     66        this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = TARGETVARIABLE_SERIES_NAME;
    6767        this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    6868        this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindXY(Enumerable.Range(0, Content.ProblemData.Dataset.Rows).ToArray(),
     
    9797        this.ToggleSeriesData(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]);
    9898
    99         // set the y-axis bounds
     99        // set the y-axis
    100100        var axisY = this.chart.ChartAreas[0].AxisY;
     101        axisY.Title = Content.ProblemData.TargetVariable;
    101102        double min = double.MaxValue, max = double.MinValue;
    102103        foreach (var point in chart.Series.SelectMany(x => x.Points)) {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualHistogram.cs

    r14185 r14255  
    9696
    9797        ChartArea chartArea = chart.ChartAreas[0];
     98        chartArea.AxisX.Title = string.Format("Residuals ({0})", Content.ProblemData.TargetVariable);
    9899        chartArea.AxisX.Minimum = -roundedMax - intervalWidth;
    99100        chartArea.AxisX.Maximum = roundedMax + intervalWidth;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs

    r14185 r14255  
    172172        double axisMin, axisMax, axisInterval;
    173173        ChartUtil.CalculateOptimalAxisInterval(min, max, out axisMin, out axisMax, out axisInterval);
     174        this.chart.ChartAreas[0].AxisX.Title = "Estimated " + targetVariableName;
    174175        this.chart.ChartAreas[0].AxisX.Maximum = axisMax;
    175176        this.chart.ChartAreas[0].AxisX.Minimum = axisMin;
    176177        this.chart.ChartAreas[0].AxisX.Interval = axisInterval;
     178        this.chart.ChartAreas[0].AxisY.Title = targetVariableName;
    177179        this.chart.ChartAreas[0].AxisY.Maximum = axisMax;
    178180        this.chart.ChartAreas[0].AxisY.Minimum = axisMin;
Note: See TracChangeset for help on using the changeset viewer.