Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/07/12 13:44:33 (11 years ago)
Author:
mkommend
Message:

#1292: Minor code cleanup in feature correlation classes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/FeatureCorrelation/FeatureCorrelationCalculator.cs

    r8833 r8874  
    7070        bw.CancelAsync();
    7171      }
    72     }
    73 
    74     private double[,] GetElementsOfCorrelation(double[,] corr, int frames) {
    75       double[,] elements = new double[corr.GetLength(0), frames + 1];
    76       for (int i = 0; i < corr.GetLength(0); i++) {
    77         for (int j = 0; j <= frames; j++) {
    78           elements[i, j] = corr[i, j];
    79         }
    80       }
    81       return elements;
    8272    }
    8373
     
    204194
    205195    private IEnumerable<double> GetRelevantValues(IDataAnalysisProblemData problemData, string partition, string variable) {
    206       IEnumerable<double> var = problemData.Dataset.GetDoubleValues(variable);
    207       if (partition.Equals(FeatureCorrelationPartitions.TRAININGSAMPLES)) {
    208         var = var.Skip(problemData.TrainingPartition.Start).Take(problemData.TrainingPartition.End - problemData.TrainingPartition.Start);
    209       } else if (partition.Equals(FeatureCorrelationPartitions.TESTSAMPLES)) {
    210         var = var.Skip(problemData.TestPartition.Start).Take(problemData.TestPartition.End - problemData.TestPartition.Start);
    211       }
     196      IEnumerable<double> var;
     197      if (partition.Equals(FeatureCorrelationPartitions.TRAININGSAMPLES))
     198        var = problemData.Dataset.GetDoubleValues(variable, problemData.TrainingIndices);
     199      else if (partition.Equals(FeatureCorrelationPartitions.TESTSAMPLES))
     200        var = problemData.Dataset.GetDoubleValues(variable, problemData.TestIndices);
     201      else var = problemData.Dataset.GetDoubleValues(variable);
    212202      return var;
    213203    }
     
    216206      BackgroundWorker worker = sender as BackgroundWorker;
    217207      if (!e.Cancelled && !worker.CancellationPending) {
    218         if (!(e.Error == null)) {
     208        if (e.Error != null) {
    219209          ErrorHandling.ShowErrorDialog(e.Error);
    220210        } else {
Note: See TracChangeset for help on using the changeset viewer.