Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/14 15:33:02 (10 years ago)
Author:
pfleck
Message:
  • Fixed typo in linear transformation error msg.
  • removed StringBuilder in transformation error msg.
Location:
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3/LinearTransformation.cs

    r10808 r10821  
    8282
    8383    public override bool Check(IEnumerable<double> data, out string errorMsg) {
    84       StringBuilder sb = new StringBuilder();
    85       bool success = true;
    8684      errorMsg = null;
    87 
    8885      if (Multiplier == 0.0) {
    89         sb.Append(String.Format("Multiplicand is 0, all {0} entries will be set to {1}. Reversal will not be possble", data.Count(), Addend));
    90         errorMsg = sb.ToString();
    91         success = false;
     86        errorMsg = String.Format("Multiplicand is 0, all {0} entries will be set to {1}. Inverse apply will not be possible (division by 0).", data.Count(), Addend);
     87        return false;
    9288      }
    93       return success;
     89      return true;
    9490    }
    9591  }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3/LogarithmicTransformation.cs

    r10808 r10821  
    11using System;
    22using System.Collections.Generic;
     3using System.Linq;
    34using System.Text;
    45using HeuristicLab.Common;
     
    4950
    5051    public override bool Check(IEnumerable<double> data, out string errorMsg) {
    51       StringBuilder sb = new StringBuilder();
    5252      errorMsg = null;
    53       int errorCounter = 0;
    54 
    55       foreach (double i in data) {
    56         if (i <= 0.0) {
    57           ++errorCounter;
    58         }
    59       }
    60 
     53      int errorCounter = data.Count(i => i <= 0.0);
    6154      if (errorCounter > 0) {
    62         sb.Append(String.Format("{0} values are zero or below zero. Logarithm can not be applied onto these values", errorCounter));
    63         errorMsg = sb.ToString();
     55        errorMsg = String.Format("{0} values are zero or below zero. Logarithm can not be applied onto these values", errorCounter);
    6456        return false;
    6557      }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3/ReciprocalTransformation.cs

    r10808 r10821  
    22using System;
    33using System.Collections.Generic;
     4using System.Linq;
    45using System.Text;
    56using HeuristicLab.Common;
     
    3435
    3536    public override bool Check(IEnumerable<double> data, out string errorMsg) {
    36       StringBuilder sb = new StringBuilder();
    3737      errorMsg = null;
    38       int errorCounter = 0;
    39 
    40       foreach (double i in data) {
    41         if (i <= 0.0) {
    42           ++errorCounter;
    43         }
    44       }
    45 
     38      int errorCounter = data.Count(i => i <= 0.0);
    4639      if (errorCounter > 0) {
    47         sb.Append(String.Format("{0} values are zero or below zero. 1/x can not be applied onto these values", errorCounter));
    48         errorMsg = sb.ToString();
     40        errorMsg = String.Format("{0} values are zero or below zero. 1/x can not be applied onto these values", errorCounter);
    4941        return false;
    5042      }
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.3/StandardDeviationTransformation.cs

    r10816 r10821  
    9090        errorMsg = "Standard deviaton for the original data is 0.0, Transformation cannot be applied onto these values.";
    9191        return false;
    92       } else {
    93         return true;
    9492      }
     93      return true;
    9594    }
    9695
Note: See TracChangeset for help on using the changeset viewer.