Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5694


Ignore:
Timestamp:
03/15/11 17:02:57 (14 years ago)
Author:
gkronber
Message:

#1418 ported views for support vector machine solutions and models.

Location:
branches/DataAnalysis Refactoring
Files:
2 added
7 edited
6 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.4

    • Property svn:ignore
      •  

        old new  
        33HeuristicLabAlgorithmsDataAnalysisViewsPlugin.cs
        44*.vs10x
         5*.user
  • branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj

    r5617 r5694  
    122122    <Compile Include="HeuristicLabAlgorithmsDataAnalysisViewsPlugin.cs" />
    123123    <Compile Include="Properties\AssemblyInfo.cs" />
     124    <Compile Include="SupportVectorMachineModelView.cs">
     125      <SubType>UserControl</SubType>
     126    </Compile>
     127    <Compile Include="SupportVectorMachineModelView.Designer.cs">
     128      <DependentUpon>SupportVectorMachineModelView.cs</DependentUpon>
     129    </Compile>
     130    <Compile Include="SupportVectorRegressionSolutionView.cs" />
     131    <Compile Include="SupportVectorRegressionSolutionView.Designer.cs">
     132      <DependentUpon>SupportVectorRegressionSolutionView.cs</DependentUpon>
     133    </Compile>
    124134  </ItemGroup>
    125135  <ItemGroup>
     
    161171      <Name>HeuristicLab.Data-3.3</Name>
    162172    </ProjectReference>
     173    <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.LibSVM\1.6.3\HeuristicLab.LibSVM-1.6.3\HeuristicLab.LibSVM-1.6.3.csproj">
     174      <Project>{89B50302-9CEE-4D13-9779-633EADCAE624}</Project>
     175      <Name>HeuristicLab.LibSVM-1.6.3 %28HeuristicLab.ExtLibs\HeuristicLab.LibSVM\HeuristicLab.LibSVM-1.6.3\HeuristicLab.LibSVM-1.6.3%29</Name>
     176    </ProjectReference>
     177    <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.LibSVM\1.6.3\LibSVM-1.6.3\LibSVM-1.6.3.csproj">
     178      <Project>{A16F23B5-FB62-499E-A831-26953AA56FE2}</Project>
     179      <Name>LibSVM-1.6.3</Name>
     180    </ProjectReference>
    163181    <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj">
    164182      <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>
     
    180198      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    181199      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
     200    </ProjectReference>
     201    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Views\3.4\HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj">
     202      <Project>{3E9E8944-44FF-40BB-A622-3A4A7DD0F198}</Project>
     203      <Name>HeuristicLab.Problems.DataAnalysis.Views-3.4</Name>
    182204    </ProjectReference>
    183205    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
  • branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/SupportVectorMachineModelView.Designer.cs

    r5692 r5694  
    1919 */
    2020#endregion
    21 namespace HeuristicLab.Problems.DataAnalysis.Views {
     21
     22namespace HeuristicLab.Algorithms.DataAnalysis.Views {
    2223  partial class SupportVectorMachineModelView {
    2324    /// <summary>
  • branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/SupportVectorMachineModelView.cs

    r5692 r5694  
    2424using HeuristicLab.MainForm;
    2525using HeuristicLab.MainForm.WindowsForms;
    26 using HeuristicLab.Problems.DataAnalysis.SupportVectorMachine;
    2726
    28 namespace HeuristicLab.Problems.DataAnalysis.Views {
    29   [View("Support Vector Machine Model View")]
     27namespace HeuristicLab.Algorithms.DataAnalysis.Views {
     28  [View("Support vector machine model view")]
    3029  [Content(typeof(SupportVectorMachineModel), true)]
    3130  public partial class SupportVectorMachineModelView : AsynchronousContentView {
     
    6362    private void UpdateTextBox() {
    6463      using (MemoryStream s = new MemoryStream()) {
    65         SupportVectorMachineModel.Export(Content, s);
    66         s.Seek(0, System.IO.SeekOrigin.Begin);
     64        StreamWriter writer = new StreamWriter(s);
     65        writer.WriteLine("RangeTransform:");
     66        writer.Flush();
     67        using (MemoryStream memStream = new MemoryStream()) {
     68          SVM.RangeTransform.Write(memStream, Content.RangeTransform);
     69          memStream.Seek(0, SeekOrigin.Begin);
     70          memStream.WriteTo(s);
     71        }
     72        writer.WriteLine("Model:");
     73        writer.Flush();
     74        using (MemoryStream memStream = new MemoryStream()) {
     75          SVM.Model.Write(memStream, Content.Model);
     76          memStream.Seek(0, SeekOrigin.Begin);
     77          memStream.WriteTo(s);
     78        }
     79        s.Flush();
     80
    6781        StreamReader reader = new StreamReader(s);
    6882        textBox.Text = reader.ReadToEnd();
  • branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/SupportVectorRegressionSolutionView.cs

    r5692 r5694  
    2222using HeuristicLab.MainForm;
    2323using HeuristicLab.MainForm.WindowsForms;
    24 using HeuristicLab.Problems.DataAnalysis.Regression.SupportVectorRegression;
     24using HeuristicLab.Algorithms.DataAnalysis;
    2525
    2626namespace HeuristicLab.Problems.DataAnalysis.Views {
    27   [View("Support Vector Regression Solution View")]
    28   [Content(typeof(SupportVectorRegressionSolution))]
     27  [View("Support vector machine solution view")]
     28  [Content(typeof(ISupportVectorMachineSolution))]
    2929  public partial class SupportVectorRegressionSolutionView : DataAnalysisSolutionView {
    3030
    31     public new SupportVectorRegressionSolution Content {
    32       get { return (SupportVectorRegressionSolution)base.Content; }
     31    public new ISupportVectorMachineSolution Content {
     32      get { return (ISupportVectorMachineSolution)base.Content; }
    3333      set { base.Content = value; }
    3434    }
     
    4242      base.OnContentChanged();
    4343      if (Content != null) {
    44         supportVectorViewHost.Content = Content.SupportVectors;
     44        supportVectorViewHost.Content = Content.Model.SupportVectors;
    4545      } else {
    4646        supportVectorViewHost.Content = null;
  • branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

    r5658 r5694  
    112112    <Compile Include="HeuristicLabAlgorithmsDataAnalysisPlugin.cs" />
    113113    <Compile Include="FixedDataAnalysisAlgorithm.cs" />
     114    <Compile Include="Interfaces\ISupportVectorMachineModel.cs" />
     115    <Compile Include="Interfaces\ISupportVectorMachineSolution.cs" />
    114116    <Compile Include="Interfaces\IDataAnalysisAlgorithm.cs" />
    115117    <Compile Include="kMeans\KMeansClustering.cs" />
  • branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassificationSolution.cs

    r5690 r5694  
    3535  [Item("SupportVectorClassificationSolution", "Represents a support vector solution for a classification problem which can be visualized in the GUI.")]
    3636  [StorableClass]
    37   public sealed class SupportVectorClassificationSolution : ClassificationSolution {
     37  public sealed class SupportVectorClassificationSolution : ClassificationSolution, ISupportVectorMachineSolution {
    3838
    39     public new SupportVectorMachineModel Model {
    40       get { return (SupportVectorMachineModel)base.Model; }
     39    public new ISupportVectorMachineModel Model {
     40      get { return (ISupportVectorMachineModel)base.Model; }
    4141    }
    4242
  • branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineModel.cs

    r5690 r5694  
    3838  [StorableClass]
    3939  [Item("SupportVectorMachineModel", "Represents a support vector machine model.")]
    40   public sealed class SupportVectorMachineModel : NamedItem, IRegressionModel, IClassificationModel {
     40  public sealed class SupportVectorMachineModel : NamedItem, ISupportVectorMachineModel, IRegressionModel, IClassificationModel {
    4141
    4242    private SVM.Model model;
     
    7676          var sv = Model.SupportVectors[i];
    7777          for (int j = 0; j < sv.Length; j++) {
    78             data[i, sv[j].Index] = sv[j].Value;
     78            data[i, j] = sv[j].Value;
    7979          }
    8080        }
     
    118118      return new SupportVectorMachineModel(this, cloner);
    119119    }
    120 
    121120
    122121    #region IRegressionModel Members
     
    196195      }
    197196    }
    198     #endregion
     197    #endregion   
    199198  }
    200199}
  • branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegressionSolution.cs

    r5690 r5694  
    3535  [Item("SupportVectorRegressionSolution", "Represents a support vector solution for a regression problem which can be visualized in the GUI.")]
    3636  [StorableClass]
    37   public sealed class SupportVectorRegressionSolution : RegressionSolution {
     37  public sealed class SupportVectorRegressionSolution : RegressionSolution, ISupportVectorMachineSolution {
    3838
    39     public new SupportVectorMachineModel Model {
    40       get { return (SupportVectorMachineModel)base.Model; }
     39    public new ISupportVectorMachineModel Model {
     40      get { return (ISupportVectorMachineModel)base.Model; }
    4141    }
    4242
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/DataAnalysisSolutionView.cs

    r5692 r5694  
    2525
    2626namespace HeuristicLab.Problems.DataAnalysis.Views {
    27   [View("Data Analysis Solution View")]
    28   [Content(typeof(DataAnalysisSolution))]
     27  [View("Data analysis solution view")]
     28  [Content(typeof(IDataAnalysisSolution))]
    2929  public partial class DataAnalysisSolutionView : AsynchronousContentView {
    3030    public DataAnalysisSolutionView() {
     
    3232    }
    3333
    34     public new DataAnalysisSolution Content {
    35       get { return (DataAnalysisSolution)base.Content; }
     34    public new IDataAnalysisSolution Content {
     35      get { return (IDataAnalysisSolution)base.Content; }
    3636      set { base.Content = value; }
    3737    }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r5678 r5694  
    140140      <DependentUpon>DiscriminantFunctionClassificationSolutionView.cs</DependentUpon>
    141141    </Compile>
     142    <Compile Include="DataAnalysisSolutionView.cs">
     143      <SubType>UserControl</SubType>
     144    </Compile>
     145    <Compile Include="DataAnalysisSolutionView.Designer.cs">
     146      <DependentUpon>DataAnalysisSolutionView.cs</DependentUpon>
     147    </Compile>
    142148    <Compile Include="Regression\RegressionSolutionEstimatedValuesView.cs">
    143149      <SubType>UserControl</SubType>
Note: See TracChangeset for help on using the changeset viewer.