Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/11/11 15:03:46 (13 years ago)
Author:
gkronber
Message:

Merged changes from trunk to data analysis exploration branch and added fractional distance metric evaluator. #1142

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis/3.3/Operators/WeightedParentsQualityVarianceComparator.cs

    r5265 r5275  
    2828using HeuristicLab.Parameters;
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     30using HeuristicLab.Common;
    3031
    3132namespace HeuristicLab.Problems.DataAnalysis.Operators {
     
    6162    }
    6263
     64    [StorableConstructor]
     65    protected WeightedParentsQualityVarianceComparator(bool deserializing) : base(deserializing) { }
     66    protected WeightedParentsQualityVarianceComparator(WeightedParentsQualityVarianceComparator original, Cloner cloner)
     67      : base(original, cloner) {
     68    }
    6369    public WeightedParentsQualityVarianceComparator()
    6470      : base() {
     
    7581      Parameters.Add(new ScopeTreeLookupParameter<IntValue>("RightSideSamples", "The number of samples used to calculate the quality of the parent."));
    7682    }
    77 
     83    public override IDeepCloneable Clone(Cloner cloner) {
     84      return new WeightedParentsQualityVarianceComparator(this, cloner);
     85    }
    7886    public override IOperation Apply() {
    7987      double leftQuality = LeftSideParameter.ActualValue.Value;
     
    114122      double stat = (xmean - ymean) / Math.Sqrt(xvar / n + yvar / m);
    115123      double c = xvar / n / (xvar / n + yvar / m);
    116       double df = (n - 1) * (m - 1) / ((m - 1) * AP.Math.Sqr(c) + (n - 1) * (1 - AP.Math.Sqr(c)));
     124      double df = (n - 1) * (m - 1) / ((m - 1) * alglib.math.sqr(c) + (n - 1) * (1 - alglib.math.sqr(c)));
    117125      if ((double)(stat) > (double)(0))
    118         p = 1 - 0.5 * ibetaf.incompletebeta(df / 2, 0.5, df / (df + AP.Math.Sqr(stat)));
     126        p = 1 - 0.5 * alglib.ibetaf.incompletebeta(df / 2, 0.5, df / (df + alglib.math.sqr(stat)));
    119127      else
    120         p = 0.5 * ibetaf.incompletebeta(df / 2, 0.5, df / (df + AP.Math.Sqr(stat)));
     128        p = 0.5 * alglib.ibetaf.incompletebeta(df / 2, 0.5, df / (df + alglib.math.sqr(stat)));
    121129      double bothtails = 2 * Math.Min(p, 1 - p);
    122130      double lefttail = p;
Note: See TracChangeset for help on using the changeset viewer.