Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5624


Ignore:
Timestamp:
03/07/11 18:11:23 (14 years ago)
Author:
gkronber
Message:

#1418 renamed interface for interpreter, worked on solutions and models and implemented SVM regression.

Location:
branches/DataAnalysis Refactoring
Files:
9 added
27 edited
1 moved

Legend:

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

    r5617 r5624  
    120120    </Compile>
    121121    <Compile Include="Properties\AssemblyInfo.cs" />
     122    <Compile Include="SupportVectorMachine\SupportVectorMachineUtil.cs">
     123      <SubType>Code</SubType>
     124    </Compile>
     125    <Compile Include="SupportVectorMachine\SupportVectorRegression.cs">
     126      <SubType>Code</SubType>
     127    </Compile>
     128    <Compile Include="SupportVectorMachine\SupportVectorRegressionModel.cs">
     129      <SubType>Code</SubType>
     130    </Compile>
     131    <Compile Include="SupportVectorMachine\SupportVectorRegressionSolution.cs">
     132      <SubType>Code</SubType>
     133    </Compile>
    122134  </ItemGroup>
    123135  <ItemGroup>
     
    154166      <Name>HeuristicLab.ALGLIB-3.1.0 %28HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\HeuristicLab.ALGLIB-3.1.0\HeuristicLab.ALGLIB-3.1.0%29</Name>
    155167    </ProjectReference>
     168    <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.LibSVM\1.6.3\HeuristicLab.LibSVM-1.6.3\HeuristicLab.LibSVM-1.6.3.csproj">
     169      <Project>{89B50302-9CEE-4D13-9779-633EADCAE624}</Project>
     170      <Name>HeuristicLab.LibSVM-1.6.3 %28HeuristicLab.ExtLibs\HeuristicLab.LibSVM\HeuristicLab.LibSVM-1.6.3\HeuristicLab.LibSVM-1.6.3%29</Name>
     171    </ProjectReference>
     172    <ProjectReference Include="..\..\HeuristicLab.ExtLibs\HeuristicLab.LibSVM\1.6.3\LibSVM-1.6.3\LibSVM-1.6.3.csproj">
     173      <Project>{A16F23B5-FB62-499E-A831-26953AA56FE2}</Project>
     174      <Name>LibSVM-1.6.3</Name>
     175    </ProjectReference>
    156176    <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
    157177      <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
     
    173193      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    174194      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
     195    </ProjectReference>
     196    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj">
     197      <Project>{05BAE4E1-A9FA-4644-AA77-42558720159E}</Project>
     198      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4</Name>
     199    </ProjectReference>
     200    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj">
     201      <Project>{5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}</Project>
     202      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</Name>
    175203    </ProjectReference>
    176204    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
  • branches/DataAnalysis Refactoring/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs

    r5617 r5624  
    3232using System.Collections.Generic;
    3333using HeuristicLab.Problems.DataAnalysis.Symbolic;
     34using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
    3435
    3536namespace HeuristicLab.Algorithms.DataAnalysis {
     
    6162    protected override void Run() {
    6263      double rmsError, cvRmsError;
    63       IRegressionProblemData problemData = Problem.ProblemData;
    64       int samplesStart = problemData.TrainingPartitionStart.Value;
    65       int samplesEnd = problemData.TrainingPartitionEnd.Value;
    66       IEnumerable<string> selectedInputVariables = problemData.InputVariables.CheckedItems.Select(x => x.Value);
    67       var solution = CreateLinearRegressionSolution(problemData.Dataset, problemData.TargetVariable, selectedInputVariables, samplesStart, samplesEnd, out rmsError, out cvRmsError);
     64      var solution = CreateLinearRegressionSolution(Problem.ProblemData, out rmsError, out cvRmsError);
    6865      Results.Add(new Result(LinearRegressionModelResultName, "The linear regression model.", solution));
    6966      Results.Add(new Result("Root mean square error", "The root of the mean of squared errors of the linear regression model on the training set.", new DoubleValue(rmsError)));
     
    7168    }
    7269
    73     public static ISymbolicExpressionTree CreateLinearRegressionSolution(Dataset dataset, string targetVariable, IEnumerable<string> allowedInputVariables, int start, int end, out double rmsError, out double cvRmsError) {
    74       double[,] inputMatrix = LinearRegressionUtil.PrepareInputMatrix(dataset, targetVariable, allowedInputVariables, start, end);
     70    public static ISymbolicRegressionSolution CreateLinearRegressionSolution(IRegressionProblemData problemData, out double rmsError, out double cvRmsError) {
     71      Dataset dataset = problemData.Dataset;
     72      string targetVariable = problemData.TargetVariable;
     73      IEnumerable<string> allowedInputVariables = problemData.InputVariables.CheckedItems.Select(x => x.Value);
     74      int samplesStart = problemData.TrainingPartitionStart.Value;
     75      int samplesEnd = problemData.TrainingPartitionEnd.Value;
     76
     77      IEnumerable<string> selectedInputVariables = problemData.InputVariables.CheckedItems.Select(x => x.Value);
     78
     79      double[,] inputMatrix = LinearRegressionUtil.PrepareInputMatrix(dataset, targetVariable, allowedInputVariables, samplesStart, samplesEnd);
    7580
    7681      alglib.linearmodel lm = new alglib.linearmodel();
     
    107112      addition.AddSubTree(cNode);
    108113
    109       return tree;
     114      SymbolicRegressionSolution solution = new SymbolicRegressionSolution(new SymbolicRegressionModel(tree, new SymbolicDataAnalysisExpressionTreeInterpreter()), problemData);
     115      return solution;
    110116    }
    111117    #endregion
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj

    r5618 r5624  
    120120    <Compile Include="SingleObjective\SymbolicClassificationSingleObjectiveProblem.cs" />
    121121    <Compile Include="SingleObjective\SymbolicClassificationSingleObjectiveTrainingBestSolutionAnalyzer.cs" />
     122    <Compile Include="SymbolicClassificationModel.cs" />
     123    <Compile Include="SymbolicClassificationSolution.cs" />
    122124    <None Include="HeuristicLab.snk" />
    123125    <None Include="HeuristicLabProblemsDataAnalysisSymbolicClassificationPlugin.cs.frame" />
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationModel.cs

    r5557 r5624  
    2222using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2323namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
    24   public interface ISymbolicClassificationModel : ISymbolicDataAnalysisModel {
     24  public interface ISymbolicClassificationModel : IClassificationModel, ISymbolicDataAnalysisModel {
    2525  }
    2626}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationSolution.cs

    r5613 r5624  
    2323using HeuristicLab.Problems.DataAnalysis.Symbolic;
    2424namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
    25   public interface ISymbolicClassificationSolution : ISymbolicDataAnalysisSolution {
     25  public interface ISymbolicClassificationSolution : IClassificationSolution, ISymbolicDataAnalysisSolution {
    2626    new ISymbolicClassificationModel Model { get; }
    2727  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs

    r5618 r5624  
    5151    }
    5252
    53     public static double[] Calculate(ISymbolicDataAnalysisTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData, IEnumerable<int> rows) {
     53    public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData, IEnumerable<int> rows) {
    5454      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    5555      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs

    r5618 r5624  
    3030    }
    3131
    32     public static double[] Calculate(ISymbolicDataAnalysisTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData, IEnumerable<int> rows) {
     32    public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData, IEnumerable<int> rows) {
    3333      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    3434      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveMeanSquaredErrorEvaluator.cs

    r5618 r5624  
    5151    }
    5252
    53     public static double Calculate(ISymbolicDataAnalysisTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData, IEnumerable<int> rows) {
     53    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData, IEnumerable<int> rows) {
    5454      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    5555      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectivePearsonRSquaredEvaluator.cs

    r5613 r5624  
    5151    }
    5252
    53     public static double Calculate(ISymbolicDataAnalysisTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData, IEnumerable<int> rows) {
     53    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IClassificationProblemData problemData, IEnumerable<int> rows) {
    5454      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    5555      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj

    r5618 r5624  
    108108  </ItemGroup>
    109109  <ItemGroup>
     110    <Compile Include="SymbolicRegressionModel.cs" />
    110111    <Compile Include="Interfaces\ISymbolicRegressionModel.cs" />
    111112    <Compile Include="Interfaces\ISymbolicRegressionProblem.cs" />
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/ISymbolicRegressionModel.cs

    r5557 r5624  
    2222using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2323namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    24   public interface ISymbolicRegressionModel : ISymbolicDataAnalysisModel {
     24  public interface ISymbolicRegressionModel : IRegressionModel, ISymbolicDataAnalysisModel {
    2525  }
    2626}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/ISymbolicRegressionSolution.cs

    r5613 r5624  
    2323using HeuristicLab.Problems.DataAnalysis.Symbolic;
    2424namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    25   public interface ISymbolicRegressionSolution : ISymbolicDataAnalysisSolution {
     25  public interface ISymbolicRegressionSolution : IRegressionSolution, ISymbolicDataAnalysisSolution {
    2626    new ISymbolicRegressionModel Model { get; }
    2727  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs

    r5613 r5624  
    5151    }
    5252
    53     public static double[] Calculate(ISymbolicDataAnalysisTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
     53    public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
    5454      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    5555      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs

    r5618 r5624  
    5151    }
    5252
    53     public static double[] Calculate(ISymbolicDataAnalysisTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
     53    public static double[] Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
    5454      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    5555      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.cs

    r5618 r5624  
    5151    }
    5252
    53     public static double Calculate(ISymbolicDataAnalysisTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
     53    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
    5454      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    5555      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs

    r5618 r5624  
    5151    }
    5252
    53     public static double Calculate(ISymbolicDataAnalysisTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
     53    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, IRegressionProblemData problemData, IEnumerable<int> rows) {
    5454      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    5555      IEnumerable<double> originalValues = problemData.Dataset.GetEnumeratedVariableValues(problemData.TargetVariable, rows);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs

    r5607 r5624  
    3232using System;
    3333
    34 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     34namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    3535  /// <summary>
    3636  /// Represents a symbolic regression solution (model + data) and attributes of the solution like accuracy and complexity
     
    3838  [StorableClass]
    3939  [Item(Name = "SymbolicRegressionSolution", Description = "Represents a symbolic regression solution (model + data) and attributes of the solution like accuracy and complexity.")]
    40   public class SymbolicRegressionSolution : SymbolicDataAnalysisSolution, IRegressionSolution {
    41     #region properties
    42     public new IRegressionModel Model {
    43       get { throw new NotImplementedException(); }
     40  public class SymbolicRegressionSolution : RegressionSolution, ISymbolicRegressionSolution {
     41    #region ISymbolicRegressionSolution Members
     42
     43    public new ISymbolicRegressionModel Model {
     44      get { return (ISymbolicRegressionModel)base.Model; }
    4445    }
    45 
    46     public new IRegressionProblemData ProblemData {
    47       get { throw new NotImplementedException(); }
    48     }
    49 
    50     public IEnumerable<double> EstimatedValues {
    51       get { throw new NotImplementedException(); }
    52     }
    53 
    54     public IEnumerable<double> EstimatedTrainingValues {
    55       get { throw new NotImplementedException(); }
    56     }
    57 
    58     public IEnumerable<double> EstimatedTestValues {
    59       get { throw new NotImplementedException(); }
    60     }
    61 
    62     public IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows) {
    63       throw new NotImplementedException();
     46    ISymbolicDataAnalysisModel ISymbolicDataAnalysisSolution.Model {
     47      get { return (ISymbolicDataAnalysisModel)base.Model; }
    6448    }
    6549
     
    7155      : base(original, cloner) {
    7256    }
    73     public SymbolicRegressionSolution()
    74       : base() {
     57    public SymbolicRegressionSolution(ISymbolicRegressionModel model, IRegressionProblemData problemData)
     58      : base(model, problemData) {
    7559    }
    7660
     
    7862      return new SymbolicRegressionSolution(this, cloner);
    7963    }
    80 
    81     protected override void OnModelChanged(EventArgs e) {
    82       base.OnModelChanged(e);
    83     }
    84 
    85     protected override void OnProblemDataChanged(EventArgs e) {
    86       base.OnProblemDataChanged(e);
    87     }
    8864  }
    8965}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs

    r5618 r5624  
    5555      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
    5656    }
    57     public IValueLookupParameter<ISymbolicDataAnalysisTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
    58       get { return (IValueLookupParameter<ISymbolicDataAnalysisTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
     57    public IValueLookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
     58      get { return (IValueLookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
    5959    }
    6060    public IValueLookupParameter<T> ProblemDataParameter {
     
    8888      get { return SymbolicExpressionTreeParameter.ActualValue; }
    8989    }
    90     public ISymbolicDataAnalysisTreeInterpreter SymbolicDataAnalysisTreeInterpreter {
     90    public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicDataAnalysisTreeInterpreter {
    9191      get { return SymbolicDataAnalysisTreeInterpreterParameter.ActualValue; }
    9292    }
     
    119119      : base() {
    120120      Parameters.Add(new ValueLookupParameter<IRandom>(RandomParameterName, "The random generator to use."));
    121       Parameters.Add(new ValueLookupParameter<ISymbolicDataAnalysisTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic data analysis tree."));
     121      Parameters.Add(new ValueLookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The interpreter that should be used to calculate the output values of the symbolic data analysis tree."));
    122122      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic data analysis solution encoded as a symbolic expression tree."));
    123123      Parameters.Add(new ValueLookupParameter<T>(ProblemDataParameterName, "The problem data on which the symbolic data analysis solution should be evaluated."));
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r5618 r5624  
    118118    </Compile>
    119119    <Compile Include="Analyzers\SymbolicDataAnalysisVariableFrequencyAnalyzer.cs" />
     120    <Compile Include="Interfaces\ISymbolicDataAnalysisExpressionTreeInterpreter.cs" />
    120121    <Compile Include="SymbolicDataAnalysisExpressionTreeCreator.cs" />
     122    <Compile Include="SymbolicDataAnalysisModel.cs">
     123      <SubType>Code</SubType>
     124    </Compile>
    121125    <Compile Include="SymbolicDataAnalysisMultiObjectiveProblem.cs" />
    122126    <Compile Include="Interfaces\ISymbolicDataAnalysisValidationAnalyzer.cs" />
     
    128132    <Compile Include="Interfaces\ISymbolicDataAnalysisAnalyzer.cs" />
    129133    <Compile Include="SymbolicDataAnalysisSingleObjectiveProblem.cs" />
    130     <Compile Include="SymbolicDataAnalysisSolution.cs" />
    131134    <Compile Include="SymbolicDataAnalysisExpressionTreeInterpreter.cs" />
    132135    <Compile Include="SymbolicDataAnalysisExpressionTreeSimplifier.cs" />
     
    181184    <Compile Include="Interfaces\ISymbolicDataAnalysisSolution.cs" />
    182185    <Compile Include="Interfaces\ISymbolicDataAnalysisSolutionCreator.cs" />
    183     <Compile Include="Interfaces\ISymbolicDataAnalysisTreeInterpreter.cs" />
    184186    <Compile Include="Interfaces\ISymbolicDataAnalysisProblem.cs" />
    185187    <Compile Include="Properties\AssemblyInfo.cs" />
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisExpressionTreeInterpreter.cs

    r5621 r5624  
    2525
    2626namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    27   public interface ISymbolicDataAnalysisTreeInterpreter : INamedItem {
     27  public interface ISymbolicDataAnalysisExpressionTreeInterpreter : INamedItem {
    2828    IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows);
    2929  }
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisInterpreterOperator.cs

    r5514 r5624  
    2424namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    2525  public interface ISymbolicDataAnalysisInterpreterOperator : IOperator {
    26     IValueLookupParameter<ISymbolicDataAnalysisTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter { get; }
     26    IValueLookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter { get; }
    2727  }
    2828}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisModel.cs

    r5514 r5624  
    2424  public interface ISymbolicDataAnalysisModel : IDataAnalysisModel {
    2525    ISymbolicExpressionTree SymbolicExpressionTree { get; }
    26     ISymbolicDataAnalysisTreeInterpreter Interpreter { get; }
     26    ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get; }
    2727  }
    2828}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs

    r5574 r5624  
    3030  [StorableClass]
    3131  [Item("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.")]
    32   public sealed class SymbolicDataAnalysisExpressionTreeInterpreter : NamedItem, ISymbolicDataAnalysisTreeInterpreter {
     32  public sealed class SymbolicDataAnalysisExpressionTreeInterpreter : NamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter {
    3333    private class InterpreterState {
    3434      private const int ARGUMENT_STACK_SIZE = 1024;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r5623 r5624  
    7575      get { return (IValueParameter<ISymbolicDataAnalysisGrammar>)Parameters[SymbolicExpressionTreeGrammarParameterName]; }
    7676    }
    77     public IValueParameter<ISymbolicDataAnalysisTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
    78       get { return (IValueParameter<ISymbolicDataAnalysisTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
     77    public IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicExpressionTreeInterpreterParameter {
     78      get { return (IValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicExpressionTreeInterpreterParameterName]; }
    7979    }
    8080    public IFixedValueParameter<DoubleValue> LowerEstimationLimitParameter {
     
    114114      set { SymbolicExpressionTreeGrammarParameter.Value = value; }
    115115    }
    116     public ISymbolicDataAnalysisTreeInterpreter SymbolicExpressionTreeInterpreter {
     116    public ISymbolicDataAnalysisExpressionTreeInterpreter SymbolicExpressionTreeInterpreter {
    117117      get { return SymbolicExpressionTreeInterpreterParameter.Value; }
    118118      set { SymbolicExpressionTreeInterpreterParameter.Value = value; }
     
    155155      Parameters.Add(new ValueParameter<T>(ProblemDataParameterName, ProblemDataParameterDescription, problemData));
    156156      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisGrammar>(SymbolicExpressionTreeGrammarParameterName, SymbolicExpressionTreeGrammarParameterDescription));
    157       Parameters.Add(new ValueParameter<ISymbolicDataAnalysisTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, SymoblicExpressionTreeInterpreterParameterDescription));
     157      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicExpressionTreeInterpreterParameterName, SymoblicExpressionTreeInterpreterParameterDescription));
    158158      Parameters.Add(new FixedValueParameter<DoubleValue>(LowerEstimationLimitParameterName, LowerEstimationLimitParameterDescription, new DoubleValue()));
    159159      Parameters.Add(new FixedValueParameter<DoubleValue>(UpperEstimationLimitParameterName, UpperEstimationLimitParameterDescription, new DoubleValue()));
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tests/Util.cs

    r5574 r5624  
    7979    }
    8080
    81     public static double CalculateEvaluatedNodesPerSec(ISymbolicExpressionTree[] trees, ISymbolicDataAnalysisTreeInterpreter interpreter, Dataset dataset, int repetitions) {
     81    public static double CalculateEvaluatedNodesPerSec(ISymbolicExpressionTree[] trees, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, Dataset dataset, int repetitions) {
    8282      // warm up
    8383      IEnumerable<int> rows = Enumerable.Range(0, dataset.Rows);
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/ClassificationSolution.cs

    r5620 r5624  
    4343      : base(original, cloner) {
    4444    }
    45     public ClassificationSolution()
    46       : base() {
     45    public ClassificationSolution(IClassificationModel model, IClassificationProblemData problemData)
     46      : base(model, problemData) {
    4747      DoubleArray thresholds = new DoubleArray();
    4848      Add(new Result(ThresholdsResultsName, "The threshold values for class boundaries.", thresholds));
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/DataAnalysisSolution.cs

    r5620 r5624  
    3030using HeuristicLab.Optimization;
    3131using System;
     32using System.Drawing;
    3233
    3334namespace HeuristicLab.Problems.DataAnalysis {
     
    3940    private const string ModelResultName = "Model";
    4041    private const string ProblemDataResultName = "ProblemData";
     42
     43    public override Image ItemImage {
     44      get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; }
     45    }
     46
    4147    #region properties
    42 
    4348    public IDataAnalysisModel Model {
    4449      get { return (IDataAnalysisModel)this[ModelResultName].Value; }
    45       set {
    46         if (this[ModelResultName].Value != value) {
    47           if (value != null) {
    48             this[ModelResultName].Value = value;
    49             OnModelChanged(EventArgs.Empty);
    50           }
    51         }
    52       }
     50      //set {
     51      //  if (this[ModelResultName].Value != value) {
     52      //    if (value != null) {
     53      //      this[ModelResultName].Value = value;
     54      //      OnModelChanged(EventArgs.Empty);
     55      //    }
     56      //  }
     57      //}
    5358    }
    5459
    5560    public IDataAnalysisProblemData ProblemData {
    5661      get { return (IDataAnalysisProblemData)this[ProblemDataResultName].Value; }
    57       set {
    58         if (this[ProblemDataResultName].Value != value) {
    59           if (value != null) {
    60             this[ProblemDataResultName].Value = value;
    61             OnProblemDataChanged(EventArgs.Empty);
    62           }
    63         }
    64       }
     62      //set {
     63      //  if (this[ProblemDataResultName].Value != value) {
     64      //    if (value != null) {
     65      //      ProblemData.Changed -= new EventHandler(ProblemData_Changed);
     66      //      this[ProblemDataResultName].Value = value;
     67      //      ProblemData.Changed += new EventHandler(ProblemData_Changed);
     68      //      OnProblemDataChanged(EventArgs.Empty);
     69      //    }
     70      //  }
     71      //}
    6572    }
    6673    #endregion
     
    7380      description = original.Description;
    7481    }
    75     public DataAnalysisSolution()
     82    public DataAnalysisSolution(IDataAnalysisModel model, IDataAnalysisProblemData problemData)
    7683      : base() {
    7784      name = string.Empty;
    7885      description = string.Empty;
    79       Add(new Result(ModelResultName, "The symbolic data analysis model.", typeof(IDataAnalysisModel)));
    80       Add(new Result(ProblemDataResultName, "The symbolic data analysis problem data.", typeof(IDataAnalysisProblemData)));
     86      Add(new Result(ModelResultName, "The symbolic data analysis model.", model));
     87      Add(new Result(ProblemDataResultName, "The symbolic data analysis problem data.", problemData));
     88
     89      problemData.Changed += new EventHandler(ProblemData_Changed);
     90    }
     91
     92    private void ProblemData_Changed(object sender, EventArgs e) {
     93      OnProblemDataChanged(e);
    8194    }
    8295
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis/3.4/RegressionSolution.cs

    r5620 r5624  
    4242      : base(original, cloner) {
    4343    }
    44     public RegressionSolution()
    45       : base() {
     44    public RegressionSolution(IRegressionModel model, IRegressionProblemData problemData)
     45      : base(model, problemData) {
    4646    }
    4747
Note: See TracChangeset for help on using the changeset viewer.