Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/03/15 16:40:34 (9 years ago)
Author:
dglaser
Message:

#2388: Merged trunk into HiveStatistics branch

Location:
branches/HiveStatistics/sources
Files:
11 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources

  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs

    r12012 r12586  
    7676    #endregion
    7777
    78     private HiveClient() {
    79       //this will never be deregistered
    80       TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException);
    81     }
    82 
    83     private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) {
    84       e.SetObserved(); // avoid crash of process because task crashes. first exception found is handled in Results property
    85       throw new HiveException("Unobserved Exception in ConcurrentTaskDownloader", e.Exception);
    86     }
     78    private HiveClient() { }
    8779
    8880    public void ClearHiveClient() {
  • branches/HiveStatistics/sources/HeuristicLab.Optimization.Operators/3.3/MultiObjective/FastNonDominatedSort.cs

    r12144 r12586  
    6868    public override IOperation Apply() {
    6969      bool dominateOnEqualQualities = DominateOnEqualQualitiesParameter.ActualValue.Value;
    70       BoolArray maximization = MaximizationParameter.ActualValue;
    71       ItemArray<DoubleArray> qualities = QualitiesParameter.ActualValue;
     70      bool[] maximization = MaximizationParameter.ActualValue.ToArray();
     71      double[][] qualities = QualitiesParameter.ActualValue.Select(x => x.ToArray()).ToArray();
    7272      if (qualities == null) throw new InvalidOperationException(Name + ": No qualities found.");
    7373
     
    8282      for (int pI = 0; pI < populationSize - 1; pI++) {
    8383        IScope p = scope.SubScopes[pI];
    84         if (!dominatedScopes.ContainsKey(p))
    85           dominatedScopes[p] = new List<int>();
     84        List<int> dominatedScopesByp;
     85        if (!dominatedScopes.TryGetValue(p, out dominatedScopesByp))
     86          dominatedScopes[p] = dominatedScopesByp = new List<int>();
    8687        for (int qI = pI + 1; qI < populationSize; qI++) {
    8788          DominationResult test = Dominates(qualities[pI], qualities[qI], maximization, dominateOnEqualQualities);
    8889          if (test == DominationResult.Dominates) {
    89             dominatedScopes[p].Add(qI);
     90            dominatedScopesByp.Add(qI);
    9091            dominationCounter[qI] += 1;
    9192          } else if (test == DominationResult.IsDominated) {
     
    111112        ScopeList nextFront = new ScopeList();
    112113        foreach (IScope p in fronts[i]) {
    113           if (dominatedScopes.ContainsKey(p)) {
    114             for (int k = 0; k < dominatedScopes[p].Count; k++) {
    115               int dominatedScope = dominatedScopes[p][k];
     114          List<int> dominatedScopesByp;
     115          if (dominatedScopes.TryGetValue(p, out dominatedScopesByp)) {
     116            for (int k = 0; k < dominatedScopesByp.Count; k++) {
     117              int dominatedScope = dominatedScopesByp[k];
    116118              dominationCounter[dominatedScope] -= 1;
    117119              if (dominationCounter[dominatedScope] == 0) {
     
    140142    }
    141143
    142     private static DominationResult Dominates(DoubleArray left, DoubleArray right, BoolArray maximizations, bool dominateOnEqualQualities) {
    143       if (dominateOnEqualQualities && left.SequenceEqual(right)) return DominationResult.Dominates;
     144    private static DominationResult Dominates(double[] left, double[] right, bool[] maximizations, bool dominateOnEqualQualities) {
     145      //mkommend Caution: do not use LINQ.SequenceEqual for comparing the two quality arrays (left and right) due to performance reasons
     146      if (dominateOnEqualQualities) {
     147        var equal = true;
     148        for (int i = 0; i < left.Length; i++) {
     149          if (left[i] != right[i]) {
     150            equal = false;
     151            break;
     152          }
     153        }
     154        if (equal) return DominationResult.Dominates;
     155      }
    144156
    145157      bool leftIsBetter = false, rightIsBetter = false;
  • branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis

  • branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Views

  • branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/MenuItems/ShrinkDataAnalysisRunsMenuItem.cs

    r12515 r12586  
    8282        var variableValuesMapping = new Dictionary<ValuesType, ValuesType>();
    8383        foreach (var problemData in view.Content.GetObjectGraphObjects(excludeStaticMembers: true).OfType<IDataAnalysisProblemData>()) {
    84           var originalValues = variableValuesGetter(problemData.Dataset);
     84          var dataset = problemData.Dataset as Dataset;
     85          if (dataset == null) continue;
     86          var originalValues = variableValuesGetter(dataset);
    8587          var matchingValues = GetEqualValues(originalValues, variableValuesMapping);
    86           variableValuesSetter(problemData.Dataset, matchingValues);
     88          variableValuesSetter(dataset, matchingValues);
    8789        }
    8890      };
     
    116118    }
    117119
    118     private static readonly Action<IDataset, Dictionary<string, IList>> variableValuesSetter;
    119     private static readonly Func<IDataset, Dictionary<string, IList>> variableValuesGetter;
     120    private static readonly Action<Dataset, Dictionary<string, IList>> variableValuesSetter;
     121    private static readonly Func<Dataset, Dictionary<string, IList>> variableValuesGetter;
    120122    /// <summary>
    121123    /// The static initializer is used to create expressions for getting and setting the private variableValues field in the dataset.
     
    123125    /// </summary>
    124126    static ShrinkDataAnalysisRunsMenuItem() {
    125       var dataset = Expression.Parameter(typeof(IDataset));
     127      var dataset = Expression.Parameter(typeof(Dataset));
    126128      var variableValues = Expression.Parameter(typeof(ValuesType));
    127129      var valuesExpression = Expression.Field(dataset, "variableValues");
    128130      var assignExpression = Expression.Assign(valuesExpression, variableValues);
    129131
    130       var variableValuesSetExpression = Expression.Lambda<Action<IDataset, ValuesType>>(assignExpression, dataset, variableValues);
     132      var variableValuesSetExpression = Expression.Lambda<Action<Dataset, ValuesType>>(assignExpression, dataset, variableValues);
    131133      variableValuesSetter = variableValuesSetExpression.Compile();
    132134
    133       var variableValuesGetExpression = Expression.Lambda<Func<IDataset, ValuesType>>(valuesExpression, dataset);
     135      var variableValuesGetExpression = Expression.Lambda<Func<Dataset, ValuesType>>(valuesExpression, dataset);
    134136      variableValuesGetter = variableValuesGetExpression.Compile();
    135137    }
  • branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs

    r12515 r12586  
    125125
    126126      var maxValue = residuals.Max();
    127       double scale = Math.Pow(10, Math.Floor(Math.Log10(maxValue)));
    128       var maximum = scale * (1 + (int)(maxValue / scale));
    129       chart.ChartAreas[0].AxisX.Maximum = maximum;
    130       chart.ChartAreas[0].CursorX.Interval = residuals.Min() / 100;
     127      if (maxValue >= chart.ChartAreas[0].AxisX.Maximum) {
     128        double scale = Math.Pow(10, Math.Floor(Math.Log10(maxValue)));
     129        var maximum = scale * (1 + (int)(maxValue / scale));
     130        chart.ChartAreas[0].AxisX.Maximum = maximum;
     131        chart.ChartAreas[0].CursorX.Interval = residuals.Min() / 100;
     132      }
    131133
    132134      UpdateSeries(residuals, solutionSeries);
     
    211213          .Where(x => x > 0) // remove entries where the original value is 0
    212214          .ToList();
    213       }
    214       // should never happen
    215       return new List<double>();
     215        default: throw new NotSupportedException();
     216      }
    216217    }
    217218
  • branches/HiveStatistics/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionBase.cs

    r12012 r12586  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using HeuristicLab.Common;
     
    3940    protected const string TrainingNormalizedMeanSquaredErrorResultName = "Normalized mean squared error (training)";
    4041    protected const string TestNormalizedMeanSquaredErrorResultName = "Normalized mean squared error (test)";
    41     protected const string TrainingMeanErrorResultName = "Mean error (training)";
    42     protected const string TestMeanErrorResultName = "Mean error (test)";
     42    protected const string TrainingRootMeanSquaredErrorResultName = "Root mean squared error (training)";
     43    protected const string TestRootMeanSquaredErrorResultName = "Root mean squared error (test)";
     44
     45    // BackwardsCompatibility3.3
     46    #region Backwards compatible code, remove with 3.5
     47    private const string TrainingMeanErrorResultName = "Mean error (training)";
     48    private const string TestMeanErrorResultName = "Mean error (test)";
     49    #endregion
     50
    4351
    4452    protected const string TrainingMeanSquaredErrorResultDescription = "Mean of squared errors of the model on the training partition";
     
    5260    protected const string TrainingNormalizedMeanSquaredErrorResultDescription = "Normalized mean of squared errors of the model on the training partition";
    5361    protected const string TestNormalizedMeanSquaredErrorResultDescription = "Normalized mean of squared errors of the model on the test partition";
    54     protected const string TrainingMeanErrorResultDescription = "Mean of errors of the model on the training partition";
    55     protected const string TestMeanErrorResultDescription = "Mean of errors of the model on the test partition";
     62    protected const string TrainingRootMeanSquaredErrorResultDescription = "Root mean of squared errors of the model on the training partition";
     63    protected const string TestRootMeanSquaredErrorResultDescription = "Root mean of squared errors of the model on the test partition";
    5664
    5765    public new IRegressionModel Model {
     
    111119      private set { ((DoubleValue)this[TestNormalizedMeanSquaredErrorResultName].Value).Value = value; }
    112120    }
    113     public double TrainingMeanError {
    114       get { return ((DoubleValue)this[TrainingMeanErrorResultName].Value).Value; }
    115       private set { ((DoubleValue)this[TrainingMeanErrorResultName].Value).Value = value; }
    116     }
    117     public double TestMeanError {
    118       get { return ((DoubleValue)this[TestMeanErrorResultName].Value).Value; }
    119       private set { ((DoubleValue)this[TestMeanErrorResultName].Value).Value = value; }
    120     }
     121    public double TrainingRootMeanSquaredError {
     122      get { return ((DoubleValue)this[TrainingRootMeanSquaredErrorResultName].Value).Value; }
     123      private set { ((DoubleValue)this[TrainingRootMeanSquaredErrorResultName].Value).Value = value; }
     124    }
     125    public double TestRootMeanSquaredError {
     126      get { return ((DoubleValue)this[TestRootMeanSquaredErrorResultName].Value).Value; }
     127      private set { ((DoubleValue)this[TestRootMeanSquaredErrorResultName].Value).Value = value; }
     128    }
     129
     130    // BackwardsCompatibility3.3
     131    #region Backwards compatible code, remove with 3.5
     132    private double TrainingMeanError {
     133      get {
     134        if (!ContainsKey(TrainingMeanErrorResultName)) return double.NaN;
     135        return ((DoubleValue)this[TrainingMeanErrorResultName].Value).Value;
     136      }
     137      set {
     138        if (ContainsKey(TrainingMeanErrorResultName))
     139          ((DoubleValue)this[TrainingMeanErrorResultName].Value).Value = value;
     140      }
     141    }
     142    private double TestMeanError {
     143      get {
     144        if (!ContainsKey(TestMeanErrorResultName)) return double.NaN;
     145        return ((DoubleValue)this[TestMeanErrorResultName].Value).Value;
     146      }
     147      set {
     148        if (ContainsKey(TestMeanErrorResultName))
     149          ((DoubleValue)this[TestMeanErrorResultName].Value).Value = value;
     150      }
     151    }
     152    #endregion
    121153    #endregion
    122154
     
    138170      Add(new Result(TrainingNormalizedMeanSquaredErrorResultName, TrainingNormalizedMeanSquaredErrorResultDescription, new DoubleValue()));
    139171      Add(new Result(TestNormalizedMeanSquaredErrorResultName, TestNormalizedMeanSquaredErrorResultDescription, new DoubleValue()));
    140       Add(new Result(TrainingMeanErrorResultName, TrainingMeanErrorResultDescription, new DoubleValue()));
    141       Add(new Result(TestMeanErrorResultName, TestMeanErrorResultDescription, new DoubleValue()));
     172      Add(new Result(TrainingRootMeanSquaredErrorResultName, TrainingRootMeanSquaredErrorResultDescription, new DoubleValue()));
     173      Add(new Result(TestRootMeanSquaredErrorResultName, TestRootMeanSquaredErrorResultDescription, new DoubleValue()));
    142174    }
    143175
     
    145177    private void AfterDeserialization() {
    146178      // BackwardsCompatibility3.4
    147 
    148179      #region Backwards compatible code, remove with 3.5
    149 
    150180      if (!ContainsKey(TrainingMeanAbsoluteErrorResultName)) {
    151181        OnlineCalculatorError errorState;
     
    162192      }
    163193
    164       if (!ContainsKey(TrainingMeanErrorResultName)) {
    165         OnlineCalculatorError errorState;
    166         Add(new Result(TrainingMeanErrorResultName, "Mean of errors of the model on the training partition", new DoubleValue()));
    167         double trainingME = OnlineMeanErrorCalculator.Calculate(EstimatedTrainingValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices), out errorState);
    168         TrainingMeanError = errorState == OnlineCalculatorError.None ? trainingME : double.NaN;
    169       }
    170       if (!ContainsKey(TestMeanErrorResultName)) {
    171         OnlineCalculatorError errorState;
    172         Add(new Result(TestMeanErrorResultName, "Mean of errors of the model on the test partition", new DoubleValue()));
    173         double testME = OnlineMeanErrorCalculator.Calculate(EstimatedTestValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndices), out errorState);
    174         TestMeanError = errorState == OnlineCalculatorError.None ? testME : double.NaN;
     194      if (!ContainsKey(TrainingRootMeanSquaredErrorResultName)) {
     195        OnlineCalculatorError errorState;
     196        Add(new Result(TrainingRootMeanSquaredErrorResultName, TrainingRootMeanSquaredErrorResultDescription, new DoubleValue()));
     197        double trainingMSE = OnlineMeanSquaredErrorCalculator.Calculate(EstimatedTrainingValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices), out errorState);
     198        TrainingRootMeanSquaredError = errorState == OnlineCalculatorError.None ? Math.Sqrt(trainingMSE) : double.NaN;
     199      }
     200
     201      if (!ContainsKey(TestRootMeanSquaredErrorResultName)) {
     202        OnlineCalculatorError errorState;
     203        Add(new Result(TestRootMeanSquaredErrorResultName, TestRootMeanSquaredErrorResultDescription, new DoubleValue()));
     204        double testMSE = OnlineMeanSquaredErrorCalculator.Calculate(EstimatedTestValues, ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndices), out errorState);
     205        TestRootMeanSquaredError = errorState == OnlineCalculatorError.None ? Math.Sqrt(testMSE) : double.NaN;
    175206      }
    176207      #endregion
     
    213244      TestNormalizedMeanSquaredError = errorState == OnlineCalculatorError.None ? testNMSE : double.NaN;
    214245
    215       double trainingME = OnlineMeanErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
    216       TrainingMeanError = errorState == OnlineCalculatorError.None ? trainingME : double.NaN;
    217       double testME = OnlineMeanErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
    218       TestMeanError = errorState == OnlineCalculatorError.None ? testME : double.NaN;
     246      TrainingRootMeanSquaredError = Math.Sqrt(TrainingMeanSquaredError);
     247      TestRootMeanSquaredError = Math.Sqrt(TestMeanSquaredError);
     248
     249      // BackwardsCompatibility3.3
     250      #region Backwards compatible code, remove with 3.5
     251      if (ContainsKey(TrainingMeanErrorResultName)) {
     252        double trainingME = OnlineMeanErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
     253        TrainingMeanError = errorState == OnlineCalculatorError.None ? trainingME : double.NaN;
     254      }
     255      if (ContainsKey(TestMeanErrorResultName)) {
     256        double testME = OnlineMeanErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
     257        TestMeanError = errorState == OnlineCalculatorError.None ? testME : double.NaN;
     258      }
     259      #endregion
    219260    }
    220261  }
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApp/status/statusCtrl.js

    r12558 r12586  
    125125                        }
    126126                    }
    127                     cpuSeries.push([$scope.status.Timestamp, $scope.cpu.knobData]);
    128 
     127                   
     128                    cpuSeries.push([$scope.status.Timestamp, Math.round(status.CpuUtilizationStatus.TotalCpuUtilization)]);
    129129                    coreSeries[0].push([$scope.status.Timestamp, status.CoreStatus.TotalCores]);
    130130                    coreSeries[1].push([$scope.status.Timestamp, status.CoreStatus.UsedCores]);
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/WebApp/helper.js

    r12584 r12586  
    6262};
    6363
    64 function decryptString(s) {
     64var decryptString = function(s) {
    6565    return CryptoJS.AES.decrypt(s, "heuristiclab").toString(CryptoJS.enc.Utf8);
    66 }
     66};
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp/3.3/WebApp/plugins/about/aboutCtrl.js

    r12584 r12586  
    11(function () {
    22    var module = appAboutPlugin.getAngularModule();
    3     module.controller('app.about.ctrl', ['$scope', '$log', function($scope, $log) {
     3    module.controller('app.about.ctrl', ['$scope', function($scope) {
    44        $scope.mailToSupport = function () {
    55            location.href = decryptString('U2FsdGVkX1/pCOITUzzsN36hx4sHh11FeVXkVyQ5b2KeZebFQ3KaNN8G9bKL3lU9');
Note: See TracChangeset for help on using the changeset viewer.