Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/16/12 16:28:49 (12 years ago)
Author:
gkronber
Message:

merged r7609:7840 from trunk into time series branch

Location:
branches/HeuristicLab.TimeSeries
Files:
1 deleted
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries

  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis

  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs

    r7268 r7842  
    7272      rows = variableValues.First().Count;
    7373      this.variableNames = new List<string>(variableNames);
    74       this.variableValues = new Dictionary<string, IList>();
     74      this.variableValues = new Dictionary<string, IList>(this.variableNames.Count);
    7575      for (int i = 0; i < this.variableNames.Count; i++) {
    7676        var values = variableValues.ElementAt(i);
     
    107107      this.variableNames = new List<string>(variableNames);
    108108
    109       this.variableValues = new Dictionary<string, IList>();
     109      this.variableValues = new Dictionary<string, IList>(variableValues.GetLength(1));
    110110      for (int col = 0; col < variableValues.GetLength(1); col++) {
    111111        string columName = this.variableNames[col];
    112         var values = new List<double>();
     112        var values = new List<double>(variableValues.GetLength(0));
    113113        for (int row = 0; row < variableValues.GetLength(0); row++) {
    114114          values.Add(variableValues[row, col]);
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r7460 r7842  
    146146    <Compile Include="Interfaces\Regression\IRegressionEnsembleSolution.cs" />
    147147    <Compile Include="Implementation\Regression\RegressionSolutionBase.cs" />
     148    <Compile Include="OnlineCalculators\OnlineMaxAbsoluteErrorCalculator.cs" />
    148149    <Compile Include="OnlineCalculators\OnlineMeanErrorCalculator.cs" />
    149150    <Compile Include="OnlineCalculators\NormalizedGiniCalculator.cs" />
     
    204205  </ItemGroup>
    205206  <ItemGroup>
    206     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    207       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    208       <Name>HeuristicLab.Collections-3.3</Name>
    209       <Private>False</Private>
    210     </ProjectReference>
    211     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    212       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    213       <Name>HeuristicLab.Common.Resources-3.3</Name>
    214       <Private>False</Private>
    215     </ProjectReference>
    216     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    217       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    218       <Name>HeuristicLab.Common-3.3</Name>
    219       <Private>False</Private>
    220     </ProjectReference>
    221     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    222       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    223       <Name>HeuristicLab.Core-3.3</Name>
    224       <Private>False</Private>
    225     </ProjectReference>
    226     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    227       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    228       <Name>HeuristicLab.Data-3.3</Name>
    229       <Private>False</Private>
    230     </ProjectReference>
    231     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    232       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    233       <Name>HeuristicLab.Optimization-3.3</Name>
    234       <Private>False</Private>
    235     </ProjectReference>
    236     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    237       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    238       <Name>HeuristicLab.Parameters-3.3</Name>
    239       <Private>False</Private>
    240     </ProjectReference>
    241     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    242       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    243       <Name>HeuristicLab.Persistence-3.3</Name>
    244       <Private>False</Private>
    245     </ProjectReference>
    246     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    247       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    248       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    249       <Private>False</Private>
    250     </ProjectReference>
    251   </ItemGroup>
    252   <ItemGroup>
    253207    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
    254208      <Visible>False</Visible>
     
    267221    </BootstrapperPackage>
    268222  </ItemGroup>
    269   <ItemGroup />
     223  <ItemGroup>
     224    <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
     225      <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
     226      <Name>HeuristicLab.Collections-3.3</Name>
     227      <Private>False</Private>
     228    </ProjectReference>
     229    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
     230      <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
     231      <Name>HeuristicLab.Common.Resources-3.3</Name>
     232      <Private>False</Private>
     233    </ProjectReference>
     234    <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
     235      <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
     236      <Name>HeuristicLab.Common-3.3</Name>
     237      <Private>False</Private>
     238    </ProjectReference>
     239    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
     240      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
     241      <Name>HeuristicLab.Core-3.3</Name>
     242      <Private>False</Private>
     243    </ProjectReference>
     244    <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
     245      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
     246      <Name>HeuristicLab.Data-3.3</Name>
     247      <Private>False</Private>
     248    </ProjectReference>
     249    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
     250      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
     251      <Name>HeuristicLab.Optimization-3.3</Name>
     252      <Private>False</Private>
     253    </ProjectReference>
     254    <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
     255      <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
     256      <Name>HeuristicLab.Parameters-3.3</Name>
     257      <Private>False</Private>
     258    </ProjectReference>
     259    <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
     260      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
     261      <Name>HeuristicLab.Persistence-3.3</Name>
     262      <Private>False</Private>
     263    </ProjectReference>
     264    <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
     265      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
     266      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
     267      <Private>False</Private>
     268    </ProjectReference>
     269    <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
     270      <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
     271      <Name>HeuristicLab.Problems.Instances-3.3</Name>
     272      <Private>False</Private>
     273    </ProjectReference>
     274  </ItemGroup>
    270275  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    271276  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs

    r7268 r7842  
    4040      ProblemData = new ClassificationProblemData();
    4141    }
    42 
    43     public override void ImportProblemDataFromFile(string fileName) {
    44       ClassificationProblemData problemData = ClassificationProblemData.ImportFromFile(fileName);
    45       ProblemData = problemData;
    46     }
    4742  }
    4843}
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs

    r7268 r7842  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.IO;
    2524using System.Linq;
    2625using HeuristicLab.Common;
     
    403402    }
    404403    #endregion
    405 
    406     #region Import from file
    407     public static ClassificationProblemData ImportFromFile(string fileName) {
    408       TableFileParser csvFileParser = new TableFileParser();
    409       csvFileParser.Parse(fileName);
    410 
    411       Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    412       dataset.Name = Path.GetFileName(fileName);
    413 
    414       ClassificationProblemData problemData = new ClassificationProblemData(dataset, dataset.DoubleVariables.Skip(1), dataset.DoubleVariables.First());
    415       problemData.Name = "Data imported from " + Path.GetFileName(fileName);
    416       return problemData;
    417     }
    418     #endregion
    419404  }
    420405}
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblem.cs

    r7268 r7842  
    3838      ProblemData = new ClusteringProblemData();
    3939    }
    40 
    41     public override void ImportProblemDataFromFile(string fileName) {
    42       ClusteringProblemData problemData = ClusteringProblemData.ImportFromFile(fileName);
    43       ProblemData = problemData;
    44     }
    4540  }
    4641}
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblemData.cs

    r7268 r7842  
    2121
    2222using System.Collections.Generic;
    23 using System.IO;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Core;
     
    9089      : base(dataset, allowedInputVariables) {
    9190    }
    92 
    93 
    94     #region Import from file
    95     public static ClusteringProblemData ImportFromFile(string fileName) {
    96       TableFileParser csvFileParser = new TableFileParser();
    97       csvFileParser.Parse(fileName);
    98 
    99       Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    100       dataset.Name = Path.GetFileName(fileName);
    101 
    102       ClusteringProblemData problemData = new ClusteringProblemData(dataset, dataset.DoubleVariables);
    103       problemData.Name = "Data imported from " + Path.GetFileName(fileName);
    104       return problemData;
    105     }
    106     #endregion
    10791  }
    10892}
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs

    r7268 r7842  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Problems.Instances;
    2829
    2930namespace HeuristicLab.Problems.DataAnalysis {
    3031  [StorableClass]
    31   public abstract class DataAnalysisProblem<T> : Problem,
    32     IDataAnalysisProblem<T>
     32  public abstract class DataAnalysisProblem<T> : Problem, IDataAnalysisProblem<T>,
     33    IProblemInstanceConsumer<T>, IProblemInstanceExporter<T>
    3334    where T : class, IDataAnalysisProblemData {
    3435    private const string ProblemDataParameterName = "ProblemData";
     
    9192    }
    9293
    93     public abstract void ImportProblemDataFromFile(string fileName);
     94    #region Import & Export
     95    public void Load(T data) {
     96      Name = data.Name;
     97      Description = data.Description;
     98      ProblemData = data;
     99      OnReset();
     100    }
     101
     102    public T Export() {
     103      return ProblemData;
     104    }
     105    #endregion
    94106  }
    95107}
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs

    r7268 r7842  
    9797
    9898      RegisterRegressionSolutionsEventHandler();
     99    }
     100
     101    public RegressionEnsembleSolution(IRegressionProblemData problemData)
     102      : this(Enumerable.Empty<IRegressionModel>(), problemData) {
    99103    }
    100104
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs

    r7268 r7842  
    4040      ProblemData = new RegressionProblemData();
    4141    }
    42 
    43     public override void ImportProblemDataFromFile(string fileName) {
    44       RegressionProblemData problemData = RegressionProblemData.ImportFromFile(fileName);
    45       ProblemData = problemData;
    46     }
    4742  }
    4843}
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r7268 r7842  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.IO;
    2524using System.Linq;
    2625using HeuristicLab.Common;
     
    136135      OnChanged();
    137136    }
    138 
    139     #region Import from file
    140     public static RegressionProblemData ImportFromFile(string fileName) {
    141       TableFileParser csvFileParser = new TableFileParser();
    142       csvFileParser.Parse(fileName);
    143 
    144       Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    145       dataset.Name = Path.GetFileName(fileName);
    146 
    147       RegressionProblemData problemData = new RegressionProblemData(dataset, dataset.DoubleVariables.Skip(1), dataset.DoubleVariables.First());
    148       problemData.Name = "Data imported from " + Path.GetFileName(fileName);
    149       return problemData;
    150     }
    151     #endregion
    152137  }
    153138}
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolution.cs

    r7268 r7842  
    4444    protected RegressionSolution(IRegressionModel model, IRegressionProblemData problemData)
    4545      : base(model, problemData) {
    46       evaluationCache = new Dictionary<int, double>();
     46      evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows);
    4747    }
    4848
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs

    r7460 r7842  
    2121
    2222using System.Collections.Generic;
    23 using System.Linq;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Data;
     
    166165
    167166    protected void CalculateResults() {
    168       double[] estimatedTrainingValues = EstimatedTrainingValues.ToArray(); // cache values
    169       double[] originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToArray();
    170       double[] estimatedTestValues = EstimatedTestValues.ToArray(); // cache values
    171       double[] originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes).ToArray();
     167      IEnumerable<double> estimatedTrainingValues = EstimatedTrainingValues; // cache values
     168      IEnumerable<double> originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
     169      IEnumerable<double> estimatedTestValues = EstimatedTestValues; // cache values
     170      IEnumerable<double> originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
    172171
    173172      OnlineCalculatorError errorState;
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs

    r7268 r7842  
    2929    IDataAnalysisProblemData ProblemData { get; }
    3030    event EventHandler ProblemDataChanged;
    31 
    32     void ImportProblemDataFromFile(string fileName);
    3331  }
    3432
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Plugin.cs.frame

    r7268 r7842  
    3636  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    3737  [PluginDependency("HeuristicLab.Persistence", "3.3")]
     38  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
    3839  public class HeuristicLabProblemsDataAnalysisPlugin : PluginBase {
    3940  }
Note: See TracChangeset for help on using the changeset viewer.