Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/03/09 15:00:23 (15 years ago)
Author:
gkronber
Message:

this is the remaining part of changeset r2327.
Applied changes in modeling plugins that are necessary for the new model analyzer (#722)

  • predictor has properties for the lower and upper limit of the predicted value
  • added views for predictors that show the limits (also added a new view for GeneticProgrammingModel that shows the size and height of the model)
  • Reintroduced TreeEvaluatorInjectors that read a PunishmentFactor and calculate the lower and upper limits for estimated values (limits are set in the tree evaluators)
  • Added operators to create Predictors. Changed modeling algorithms to use the predictors for the calculation of final model qualities and variable impacts (to be compatible with the new model analyzer the predictors use a very large PunishmentFactor)
  • replaced all private implementations of double.IsAlmost and use HL.Commons instead (see #733 r2324)
  • Implemented operator SolutionExtractor and moved BestSolutionStorer from HL.Logging to HL.Modeling (fixes #734)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification.Classification/3.3/MulticlassModeller.cs

    r2222 r2328  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
     
    8384            double[] row = new double[dataset.Columns];
    8485            double targetValue = origDataset.GetValue(k, targetVariable);
    85             if (IsEqual(targetValue, classAValue)) {
     86            if (targetValue.IsAlmost(classAValue)) {
    8687              for (int l = 0; l < row.Length; l++) {
    8788                row[l] = origDataset.GetValue(k, l);
     
    8990              row[targetVariable] = 0;
    9091              rows.Add(row);
    91             } else if (IsEqual(targetValue, classBValue)) {
     92            } else if (targetValue.IsAlmost(classBValue)) {
    9293              for (int l = 0; l < row.Length; l++) {
    9394                row[l] = origDataset.GetValue(k, l);
     
    102103            double[] row = new double[dataset.Columns];
    103104            double targetValue = origDataset.GetValue(k, targetVariable);
    104             if (IsEqual(targetValue, classAValue)) {
     105            if (targetValue.IsAlmost(classAValue)) {
    105106              for (int l = 0; l < row.Length; l++) {
    106107                row[l] = origDataset.GetValue(k, l);
     
    108109              row[targetVariable] = 0;
    109110              rows.Add(row);
    110             } else if (IsEqual(targetValue, classBValue)) {
     111            } else if (targetValue.IsAlmost(classBValue)) {
    111112              for (int l = 0; l < row.Length; l++) {
    112113                row[l] = origDataset.GetValue(k, l);
     
    141142      return null;
    142143    }
    143 
    144     private bool IsEqual(double x, double y) {
    145       return Math.Abs(x - y) < EPSILON;
    146     }
    147144  }
    148145}
Note: See TracChangeset for help on using the changeset viewer.