Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/07/09 11:58:21 (15 years ago)
Author:
gkronber
Message:

Updated LibSVM project to latest version. #774

File:
1 edited

Legend:

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

    r2413 r2415  
    2929using System.Windows.Forms;
    3030using HeuristicLab.Core;
     31using System.IO;
    3132
    3233namespace HeuristicLab.SupportVectorMachines {
     
    5051    }
    5152
    52     protected override string GetModelString() {
    53       StringBuilder builder = new StringBuilder();
    54       builder.Append("LowerPredictionLimit: ").AppendLine(predictor.LowerPredictionLimit.ToString());
    55       builder.Append("UpperPredictionLimit: ").AppendLine(predictor.UpperPredictionLimit.ToString());
    56       builder.Append("MaxTimeOffset: ").AppendLine(predictor.MaxTimeOffset.ToString());
    57       builder.Append("MinTimeOffset: ").AppendLine(predictor.MinTimeOffset.ToString());
    58       builder.Append("InputVariables :");
    59       builder.Append(predictor.GetInputVariables().First());
    60       foreach (string variable in predictor.GetInputVariables().Skip(1)) {
    61         builder.Append("; ").Append(variable);
     53    protected override void UpdateControls() {
     54      base.UpdateControls();
     55      textBox.Text = GetModelString();
     56    }
     57
     58    private string GetModelString() {
     59      if (predictor == null) return "";
     60      using (MemoryStream s = new MemoryStream()) {
     61        Predictor.Export(predictor, s);
     62        s.Flush();
     63        s.Seek(0, System.IO.SeekOrigin.Begin);
     64        StreamReader reader = new StreamReader(s);
     65        return reader.ReadToEnd();
    6266      }
    63       builder.AppendLine();
    64       builder.Append(base.GetModelString());
    65       return builder.ToString();
    6667    }
    6768  }
Note: See TracChangeset for help on using the changeset viewer.