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.Symbolic.Classification.Views/3.4
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views-3.4.csproj

    r14125 r14255  
    144144    <Compile Include="SymbolicDiscriminantFunctionClassificationSolutionView.Designer.cs">
    145145      <DependentUpon>SymbolicDiscriminantFunctionClassificationSolutionView.cs</DependentUpon>
     146    </Compile>
     147    <Compile Include="SymbolicClassificationModelMathView.cs">
     148      <SubType>UserControl</SubType>
     149    </Compile>
     150    <Compile Include="SymbolicClassificationModelMathView.designer.cs">
     151      <DependentUpon>SymbolicClassificationModelMathView.cs</DependentUpon>
    146152    </Compile>
    147153    <None Include="HeuristicLab.snk" />
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationModelMathView.cs

    r14250 r14255  
    2020#endregion
    2121
    22 using System;
    23 using System.IO;
    24 using System.Windows.Forms;
    2522using HeuristicLab.MainForm;
    26 using HeuristicLab.MainForm.WindowsForms;
     23using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;
    2724
    28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
     25namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
    2926  [View("Mathematical Representation")]
    30   [Content(typeof(ISymbolicDataAnalysisModel))]
    31   public partial class MathSymbolicDataAnalysisModelView : AsynchronousContentView {
    32     private SymbolicDataAnalysisExpressionLatexFormatter formatter = new SymbolicDataAnalysisExpressionLatexFormatter();
    33     public MathSymbolicDataAnalysisModelView()
    34       : base() {
    35       InitializeComponent();
    36       webBrowser.ScrollBarsEnabled = true;
    37       webBrowser.ScriptErrorsSuppressed = false;
     27  [Content(typeof(ISymbolicClassificationModel))]
     28  public partial class SymbolicClassificationModelMathView : SymbolicDataAnalysisModelMathView {
    3829
    39       // update for the first time after page has loaded
    40       webBrowser.DocumentCompleted += (sender, args) => RefreshHtmlPage();
     30    public SymbolicClassificationModelMathView() : base() { }
    4131
    42       string hlDir = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory);
    43       webBrowser.Navigate("file://" + Path.Combine(hlDir, "displayModelFrame.html"));
    44     }
    45 
    46     public new ISymbolicDataAnalysisModel Content {
    47       get { return (ISymbolicDataAnalysisModel)base.Content; }
     32    public new ISymbolicClassificationModel Content {
     33      get { return (ISymbolicClassificationModel)base.Content; }
    4834      set { base.Content = value; }
    4935    }
    5036
    51     protected override void OnContentChanged() {
    52       base.OnContentChanged();
    53       RefreshHtmlPage();
    54     }
    55 
    56     private void RefreshHtmlPage() {
    57       // only update if the page has loaded already
    58       if (webBrowser.Document == null || webBrowser.Document.Body == null) return;
    59 
    60       if (Content != null) {
    61         HtmlElement newElement = webBrowser.Document.GetElementById("model");
    62         newElement.InnerText = formatter.Format(Content.SymbolicExpressionTree);
    63         webBrowser.Document.InvokeScript("refreshModel");
    64       } else {
    65         HtmlElement newElement = webBrowser.Document.GetElementById("model");
    66         newElement.InnerText = string.Empty;
    67       }
     37    protected override string GetFormattedTree() {
     38      return Formatter.Format(Content.SymbolicExpressionTree, Content.TargetVariable);
    6839    }
    6940  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicClassificationModelMathView.designer.cs

    r14250 r14255  
    2020#endregion
    2121
    22 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    23   partial class MathSymbolicDataAnalysisModelView {
     22namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
     23  partial class SymbolicClassificationModelMathView {
    2424    /// <summary>
    2525    /// Required designer variable.
Note: See TracChangeset for help on using the changeset viewer.