Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/10/11 14:41:17 (13 years ago)
Author:
gkronber
Message:

#1418 ported estimated values view for classification and regression solutions and porter scatter plot and line chart for regression solutions.

Location:
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression
Files:
1 added
1 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.cs

    r5642 r5663  
    2828
    2929namespace HeuristicLab.Problems.DataAnalysis.Views {
    30   [View("Estimated Values View")]
    31   [Content(typeof(DataAnalysisSolution))]
    32   public partial class EstimatedValuesView : AsynchronousContentView {
     30  [View("Regression solution estimated values view")]
     31  [Content(typeof(IRegressionSolution))]
     32  public partial class RegressionSolutionEstimatedValuesView : AsynchronousContentView {
    3333    private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable";
    3434    private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedValues";
    3535
    36     public new DataAnalysisSolution Content {
    37       get { return (DataAnalysisSolution)base.Content; }
     36    public new IRegressionSolution Content {
     37      get { return (IRegressionSolution)base.Content; }
    3838      set {
    3939        base.Content = value;
     
    4343    private StringConvertibleMatrixView matrixView;
    4444
    45     public EstimatedValuesView()
     45    public RegressionSolutionEstimatedValuesView()
    4646      : base() {
    4747      InitializeComponent();
     
    5656    protected override void RegisterContentEvents() {
    5757      base.RegisterContentEvents();
    58       Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
     58      Content.ModelChanged += new EventHandler(Content_ModelChanged);
    5959      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
    6060    }
     
    6262    protected override void DeregisterContentEvents() {
    6363      base.DeregisterContentEvents();
    64       Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
     64      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
    6565      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
    6666    }
    6767
    68     void Content_ProblemDataChanged(object sender, EventArgs e) {
     68    private void Content_ProblemDataChanged(object sender, EventArgs e) {
    6969      OnContentChanged();
    7070    }
    7171
    72     void Content_EstimatedValuesChanged(object sender, EventArgs e) {
     72    private void Content_ModelChanged(object sender, EventArgs e) {
    7373      OnContentChanged();
    7474    }
     
    8686          double[,] values = new double[Content.ProblemData.Dataset.Rows, 4];
    8787
    88           double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value);
     88          double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable);
    8989          double[] estimated = Content.EstimatedValues.ToArray();
    9090          for (int row = 0; row < target.Length; row++) {
     
    9696
    9797          matrix = new DoubleMatrix(values);
    98           matrix.ColumnNames = new string[] { "Original", "Estimated", "Error", "Rel. Error" };
     98          matrix.ColumnNames = new string[] { TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, "Absolute Error", "Relative Error" };
    9999        }
    100100        matrixView.Content = matrix;
Note: See TracChangeset for help on using the changeset viewer.