Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/20/11 10:11:14 (13 years ago)
Author:
gkronber
Message:

#1081 added classes (problem, evaluators, analyzers, solution, model, online-calculators, and views) for time series prognosis problems and added an algorithm implementation to generation linear AR (auto-regressive) time series prognosis solution.

Location:
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

    r6777 r6802  
    134134    </Compile>
    135135    <Compile Include="Linear\AlglibUtil.cs" />
     136    <Compile Include="Linear\LinearTimeSeriesPrognosis.cs" />
    136137    <Compile Include="Linear\LinearDiscriminantAnalysis.cs" />
    137138    <Compile Include="Linear\LinearRegression.cs">
     
    240241      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</Name>
    241242    </ProjectReference>
     243    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4.csproj">
     244      <Project>{07486E68-1517-4B9D-A58D-A38E99AE71AB}</Project>
     245      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4</Name>
     246    </ProjectReference>
    242247    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
    243248      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLabAlgorithmsDataAnalysisPlugin.cs.frame

    r6548 r6802  
    4242  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Classification", "3.4")]
    4343  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression", "3.4")]
     44  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis", "3.4")]
    4445  public class HeuristicLabAlgorithmsDataAnalysisPlugin : PluginBase {
    4546  }
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/AlglibUtil.cs

    r6740 r6802  
    2727  public static class AlglibUtil {
    2828    public static double[,] PrepareInputMatrix(Dataset dataset, IEnumerable<string> variables, IEnumerable<int> rows) {
    29       List<string> variablesList = variables.ToList();
     29      return PrepareInputMatrix(dataset, variables, rows, new int[] { 0 });
     30    }
     31
     32    public static double[,] PrepareInputMatrix(Dataset dataset, IEnumerable<string> variables, IEnumerable<int> rows, IEnumerable<int> lags) {
     33      int maxLag = lags.Max();
     34
     35      // drop last variable (target variable)
     36      List<string> inputVariablesList = variables
     37        .Reverse()
     38        .Skip(1)
     39        .Reverse()
     40        .ToList();
     41      string targetVariable = variables.Last();
    3042      List<int> rowsList = rows.ToList();
    31 
    32       double[,] matrix = new double[rowsList.Count, variablesList.Count];
     43      int nRows = rowsList.Count - maxLag;
     44      double[,] matrix = new double[nRows, inputVariablesList.Count * lags.Count() + 1];
    3345
    3446      int col = 0;
    35       foreach (string column in variables) {
    36         var values = dataset.GetDoubleValues(column, rows);
    37         int row = 0;
    38         foreach (var value in values) {
    39           matrix[row, col] = value;
    40           row++;
     47      int row = 0;
     48      // input variables
     49      foreach (int lag in lags) {
     50        foreach (string column in inputVariablesList) {
     51          var values = dataset.GetDoubleValues(column, rows.Select(x => x - lag).Take(nRows));
     52          row = 0;
     53          foreach (var value in values) {
     54            if (row >= 0) {
     55              matrix[row, col] = value;
     56            }
     57            row++;
     58          }
     59          col++;
    4160        }
    42         col++;
    4361      }
    44 
     62      // target variable
     63      row = 0;
     64      foreach (var value in dataset.GetDoubleValues(targetVariable, rows).Take(nRows)) {
     65        matrix[row, col] = value;
     66        row++;
     67      }
    4568      return matrix;
    4669    }
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs

    r6240 r6802  
    143143      parameter.Probability = false;
    144144
    145 
    146145      SVM.Problem problem = SupportVectorMachineUtil.CreateSvmProblem(dataset, targetVariable, allowedInputVariables, rows);
    147146      SVM.RangeTransform rangeTransform = SVM.RangeTransform.Compute(problem);
Note: See TracChangeset for help on using the changeset viewer.