Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/14/11 16:45:46 (14 years ago)
Author:
abeham
Message:

#1465

  • updated branch with latest version of trunk
Location:
branches/histogram
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/histogram

  • branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.3/HeuristicLabAlgorithmsDataAnalysisPlugin.cs.frame

    r5446 r6195  
    2626  /// Plugin class for HeuristicLab.Algorithms.DataAnalysis plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Algorithms.DataAnalysis", "3.3.3.$WCREV$")]
     28  [Plugin("HeuristicLab.Algorithms.DataAnalysis", "3.3.4.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Algorithms.DataAnalysis-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.3/Properties/AssemblyInfo.frame

    r5446 r6195  
    5353// by using the '*' as shown below:
    5454[assembly: AssemblyVersion("3.3.0.0")]
    55 [assembly: AssemblyFileVersion("3.3.3.$WCREV$")]
     55[assembly: AssemblyFileVersion("3.3.4.$WCREV$")]
  • branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs

    r5886 r6195  
    373373      foreach (IResult result in ExtractAndAggregateResults<PercentValue>(resultCollections))
    374374        results.Add(result.Name, result.Value);
    375 
     375      foreach (IResult result in ExtractAndAggregateRegressionSolutions(resultCollections)) {
     376        results.Add(result.Name, result.Value);
     377      }
    376378      results.Add("Execution Time", new TimeSpanValue(this.ExecutionTime));
    377379      results.Add("CrossValidation Folds", new RunCollection(runs));
     380    }
     381
     382    private IEnumerable<IResult> ExtractAndAggregateRegressionSolutions(IEnumerable<KeyValuePair<string, IItem>> resultCollections) {
     383      Dictionary<string, List<IRegressionSolution>> resultSolutions = new Dictionary<string, List<IRegressionSolution>>();
     384      foreach (var result in resultCollections) {
     385        var regressionSolution = result.Value as IRegressionSolution;
     386        if (regressionSolution != null) {
     387          if (resultSolutions.ContainsKey(result.Key)) {
     388            resultSolutions[result.Key].Add(regressionSolution);
     389          } else {
     390            resultSolutions.Add(result.Key, new List<IRegressionSolution>() { regressionSolution });
     391          }
     392        }
     393      }
     394      List<IResult> aggregatedResults = new List<IResult>();
     395      foreach (KeyValuePair<string, List<IRegressionSolution>> solutions in resultSolutions) {
     396        var problemDataClone = (IRegressionProblemData)Problem.ProblemData.Clone();
     397        problemDataClone.TrainingPartition.Start = SamplesStart.Value; problemDataClone.TrainingPartition.End = SamplesEnd.Value;
     398        problemDataClone.TestPartition.Start = SamplesStart.Value; problemDataClone.TestPartition.End = SamplesEnd.Value;
     399        var ensembleSolution = new RegressionEnsembleSolution(solutions.Value.Select(x => x.Model), problemDataClone,
     400          solutions.Value.Select(x => x.ProblemData.TrainingPartition),
     401          solutions.Value.Select(x => x.ProblemData.TestPartition));
     402
     403        aggregatedResults.Add(new Result(solutions.Key, ensembleSolution));
     404      }
     405      return aggregatedResults;
    378406    }
    379407
  • branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs

    r6011 r6195  
    6868      string targetVariable = problemData.TargetVariable;
    6969      IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables;
    70       int samplesStart = problemData.TrainingPartition.Start;
    71       int samplesEnd = problemData.TrainingPartition.End;
    72       IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart);
     70      IEnumerable<int> rows = problemData.TrainingIndizes;
    7371      int nClasses = problemData.ClassNames.Count();
    7472      double[,] inputMatrix = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables.Concat(new string[] { targetVariable }), rows);
  • branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs

    r6011 r6195  
    7272      string targetVariable = problemData.TargetVariable;
    7373      IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables;
    74       int samplesStart = problemData.TrainingPartition.Start;
    75       int samplesEnd = problemData.TrainingPartition.End;
    76       IEnumerable<int> rows = Enumerable.Range(samplesStart, samplesEnd - samplesStart);
     74      IEnumerable<int> rows = problemData.TrainingIndizes;
    7775      double[,] inputMatrix = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables.Concat(new string[] { targetVariable }), rows);
    7876      if (inputMatrix.Cast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))
  • branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorClassification.cs

    r5914 r6195  
    122122      Dataset dataset = problemData.Dataset;
    123123      string targetVariable = problemData.TargetVariable;
    124       int start = problemData.TrainingPartition.Start;
    125       int end = problemData.TrainingPartition.End;
    126       IEnumerable<int> rows = Enumerable.Range(start, end - start);
     124      IEnumerable<int> rows = problemData.TrainingIndizes;
    127125
    128126      //extract SVM parameters from scope and set them
  • branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorRegression.cs

    r5914 r6195  
    130130      Dataset dataset = problemData.Dataset;
    131131      string targetVariable = problemData.TargetVariable;
    132       int start = problemData.TrainingPartition.Start;
    133       int end = problemData.TrainingPartition.End;
    134       IEnumerable<int> rows = Enumerable.Range(start, end - start);
     132      IEnumerable<int> rows = problemData.TrainingIndizes;
    135133
    136134      //extract SVM parameters from scope and set them
  • branches/histogram/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClustering.cs

    r6011 r6195  
    8585      Dataset dataset = problemData.Dataset;
    8686      IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables;
    87       int start = problemData.TrainingPartition.Start;
    88       int end = problemData.TrainingPartition.End;
    89       IEnumerable<int> rows = Enumerable.Range(start, end - start);
     87      IEnumerable<int> rows = problemData.TrainingIndizes;
    9088      int info;
    9189      double[,] centers;
Note: See TracChangeset for help on using the changeset viewer.