Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/06/09 09:40:25 (15 years ago)
Author:
gkronber
Message:

Implemented #772 (Text export of SVM models)

Location:
trunk/sources/HeuristicLab.SupportVectorMachines/3.2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/PredictorView.Designer.cs

    r2373 r2411  
    5454      this.minTimeOffsetLabel = new System.Windows.Forms.Label();
    5555      this.SuspendLayout();
     56      //
     57      // textBox
     58      //
     59      this.textBox.Location = new System.Drawing.Point(0, 238);
     60      this.textBox.Size = new System.Drawing.Size(324, 130);
    5661      //
    5762      // lowerPredictionLimit
     
    136141      this.Controls.Add(this.lowerPredictionLimit);
    137142      this.Name = "PredictorView";
    138       this.Size = new System.Drawing.Size(252, 240);
     143      this.Size = new System.Drawing.Size(324, 371);
     144      this.Controls.SetChildIndex(this.textBox, 0);
    139145      this.Controls.SetChildIndex(this.lowerPredictionLimit, 0);
    140146      this.Controls.SetChildIndex(this.lowerLimitTextbox, 0);
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMModelView.Designer.cs

    r2322 r2411  
    5555      this.kernelType = new System.Windows.Forms.TextBox();
    5656      this.gamma = new System.Windows.Forms.TextBox();
     57      this.textBox = new System.Windows.Forms.TextBox();
    5758      this.SuspendLayout();
    5859      //
     
    142143      this.gamma.TabIndex = 12;
    143144      //
     145      // textBox
     146      //
     147      this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     148                  | System.Windows.Forms.AnchorStyles.Left)
     149                  | System.Windows.Forms.AnchorStyles.Right)));
     150      this.textBox.Location = new System.Drawing.Point(0, 134);
     151      this.textBox.Multiline = true;
     152      this.textBox.Name = "textBox";
     153      this.textBox.ReadOnly = true;
     154      this.textBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
     155      this.textBox.Size = new System.Drawing.Size(283, 171);
     156      this.textBox.TabIndex = 13;
     157      this.textBox.WordWrap = false;
     158      //
    144159      // SVMModelView
    145160      //
    146161      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    147162      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     163      this.Controls.Add(this.textBox);
    148164      this.Controls.Add(this.gamma);
    149165      this.Controls.Add(this.kernelType);
     
    157173      this.Controls.Add(this.numberSupportVectorsLabel);
    158174      this.Name = "SVMModelView";
    159       this.Size = new System.Drawing.Size(253, 135);
     175      this.Size = new System.Drawing.Size(283, 308);
    160176      this.ResumeLayout(false);
    161177      this.PerformLayout();
     
    175191    private System.Windows.Forms.TextBox kernelType;
    176192    private System.Windows.Forms.TextBox gamma;
     193    protected System.Windows.Forms.TextBox textBox;
    177194  }
    178195}
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SVMModelView.cs

    r2328 r2411  
    2929using System.Windows.Forms;
    3030using HeuristicLab.Core;
     31using System.IO;
    3132
    3233namespace HeuristicLab.SupportVectorMachines {
    3334  public partial class SVMModelView : ViewBase {
    3435    private SVMModel model;
    35     public SVMModelView() : base() {
     36    public SVMModelView()
     37      : base() {
    3638      InitializeComponent();
    37     }   
    38     public SVMModelView(SVMModel model) : base() {
     39    }
     40    public SVMModelView(SVMModel model)
     41      : base() {
    3942      InitializeComponent();
    4043      this.model = model;
     
    4649      kernelType.DataBindings.Add(new Binding("Text", model.Model.Parameter, "KernelType"));
    4750      gamma.DataBindings.Add(new Binding("Text", model.Model.Parameter, "Gamma"));
     51      StringBuilder builder = new StringBuilder();
     52      builder.AppendLine("RangeTransform:");
     53      using (MemoryStream stream = new MemoryStream()) {
     54        SVM.RangeTransform.Write(stream, model.RangeTransform);
     55        stream.Seek(0, System.IO.SeekOrigin.Begin);
     56        StreamReader reader = new StreamReader(stream);
     57        builder.AppendLine(reader.ReadToEnd());
     58      }
     59      builder.AppendLine("Model:");
     60      using (MemoryStream stream = new MemoryStream()) {
     61        SVM.Model.Write(stream, model.Model);
     62        stream.Seek(0, System.IO.SeekOrigin.Begin);
     63        StreamReader reader = new StreamReader(stream);
     64        builder.AppendLine(reader.ReadToEnd());
     65      }
     66
     67      textBox.Text = builder.ToString();
    4868    }
    4969  }
Note: See TracChangeset for help on using the changeset viewer.