Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16955


Ignore:
Timestamp:
05/15/19 13:28:57 (6 years ago)
Author:
abeham
Message:

#2457: worked on thesis

Location:
branches/2457_ExpertSystem
Files:
14 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2457_ExpertSystem/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/InformationAnalysis.cs

    r16137 r16955  
    4646    public List<double> QualityDelta { get; private set; }
    4747    public double InformationStability { get; private set; }
    48     public int Regularity { get; private set; }
    49     public int Diversity { get; private set; }
     48    public double Regularity { get; private set; }
     49    public double Diversity { get; private set; }
    5050    public Peak PeakInformationContent { get; private set; }
    5151    public Peak PeakSymmetricInformationContent { get; private set; }
     
    7171      var differences = Differences(qualities).ToList();
    7272      InformationStability = differences.Select(Math.Abs).Max();
    73       Regularity = new HashSet<double>(differences).Count;
    74       Diversity = new HashSet<double>(qualities).Count;
     73      Regularity = new HashSet<double>(differences).Count / (double)differences.Count;
     74      Diversity = new HashSet<double>(qualities).Count / (double)qualities.Count;
    7575      var absDifferences = differences.Select(Math.Abs).OrderBy(d => d).ToList();
    7676      nQuantiles = Math.Min(nQuantiles, absDifferences.Count);
     
    118118      PeakTotalEntropy = GetPeak(QualityDelta, TotalEntropy);
    119119      PeakSymmetricTotalEntropy = GetPeak(QualityDelta, SymmetricTotalEntropy);
     120    }
     121
     122    public IEnumerable<Tuple<string, object>> GetFeatures() {
     123      yield return Tuple.Create("InformationContent", (object)InformationContent[0]);
     124      yield return Tuple.Create("DensityBasinInformation", (object)DensityBasinInformation[0]);
     125      yield return Tuple.Create("PartialInformationContent", (object)PartialInformationContent[0]);
     126      yield return Tuple.Create("TotalEntropy", (object)TotalEntropy[0]);
     127      yield return Tuple.Create("InformationStability", (object)InformationStability);
     128      yield return Tuple.Create("Regularity", (object)Regularity);
     129      yield return Tuple.Create("Diversity", (object)Diversity);
     130      yield return Tuple.Create("SymmetricInformationContent", (object)SymmetricInformationContent[0]);
     131      yield return Tuple.Create("SymmetricDensityBasinInformation", (object)SymmetricDensityBasinInformation[0]);
     132      yield return Tuple.Create("SymmetricTotalEntropy", (object)SymmetricTotalEntropy[0]);
     133      yield return Tuple.Create("PeakInformationContent", (object)PeakInformationContent.Value);
     134      yield return Tuple.Create("PeakDensityBasinInformation", (object)PeakDensityBasinInformation.Value);
     135      yield return Tuple.Create("PeakTotalEntropy", (object)PeakTotalEntropy.Value);
     136      yield return Tuple.Create("PeakSymmetricInformationContent", (object)PeakSymmetricInformationContent.Value);
     137      yield return Tuple.Create("PeakSymmetricDensityBasinInformation", (object)PeakSymmetricDensityBasinInformation.Value);
     138      yield return Tuple.Create("PeakSymmetricTotalEntropy", (object)PeakSymmetricTotalEntropy.Value);
    120139    }
    121140
  • branches/2457_ExpertSystem/HeuristicLab.Analysis.FitnessLandscape/3.3/Analysis/InformationAnalyzer.cs

    r16137 r16955  
    132132      InformationStabilityParameter.ActualValue = @is;
    133133      results.AddOrUpdateResult(InformationStabilityParameter.Name, @is);
    134       var regularity = new DoubleValue(1.0 * analysis.Regularity / qualities.Count);
     134      var regularity = new DoubleValue(analysis.Regularity);
    135135      RegularityParameter.ActualValue = regularity;
    136136      results.AddOrUpdateResult(RegularityParameter.Name, regularity);
    137       var diversity = new DoubleValue(1.0 * analysis.Diversity / qualities.Count);
     137      var diversity = new DoubleValue(analysis.Diversity);
    138138      DiversityParameter.ActualValue = diversity;
    139139      results.AddOrUpdateResult(DiversityParameter.Name, diversity);
  • branches/2457_ExpertSystem/HeuristicLab.Analysis.FitnessLandscape/3.3/Utilities/CurveAnalysis.cs

    r16137 r16955  
    2626namespace HeuristicLab.Analysis.FitnessLandscape {
    2727  public static class CurveAnalysis<T> {
    28     public static CurveAnalysisResult GetCharacteristics(List<List<Tuple<T, double>>> trajectories, Func<T, T, double> distFunc) {
    29       trajectories = trajectories.Where(x => x.Count > 5).ToList();
    30       if (trajectories.Count == 0) return new CurveAnalysisResult(0, 0, 0, new[] { 0.0, 0.0, 0.0 }, new[] { 0.0, 0.0, 0.0 }, new[] { 0.0, 0.0, 0.0 });
     28    public static CurveAnalysisResult GetCharacteristics(IEnumerable<List<Tuple<T, double>>> trajectories, Func<T, T, double> distFunc) {
     29      var traj = trajectories.Where(x => x.Count > 5).ToList();
     30      if (traj.Count == 0) return new CurveAnalysisResult(0, 0, 0, new[] { 0.0, 0.0, 0.0 }, new[] { 0.0, 0.0, 0.0 }, new[] { 0.0, 0.0, 0.0 });
    3131
    32       var symbols = GetSymbols(trajectories);
    33       var f1 = trajectories.Select(path => ApproximateDerivative(path, distFunc).ToList()).ToList();
     32      var symbols = GetSymbols(traj);
     33      var f1 = traj.Select(path => ApproximateDerivative(path, distFunc).ToList()).ToList();
    3434      var f2 = f1.Select(d1 => ApproximateDerivative(d1, distFunc).ToList()).ToList();
    3535
  • branches/2457_ExpertSystem/PerformanceComparison.sln

    r16137 r16955  
    3131EndProject
    3232Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{76241AF2-B428-4127-805D-667F79983F0F}"
     33EndProject
     34Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WalkExporter", "WalkExporter\WalkExporter.csproj", "{EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}"
    3335EndProject
    3436Global
     
    210212    {76241AF2-B428-4127-805D-667F79983F0F}.Release|x86.ActiveCfg = Release|Any CPU
    211213    {76241AF2-B428-4127-805D-667F79983F0F}.Release|x86.Build.0 = Release|Any CPU
     214    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     215    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|Any CPU.Build.0 = Debug|Any CPU
     216    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|x64.ActiveCfg = Debug|Any CPU
     217    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|x64.Build.0 = Debug|Any CPU
     218    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|x86.ActiveCfg = Debug|Any CPU
     219    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Debug|x86.Build.0 = Debug|Any CPU
     220    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|Any CPU.ActiveCfg = Release|Any CPU
     221    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|Any CPU.Build.0 = Release|Any CPU
     222    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|x64.ActiveCfg = Release|Any CPU
     223    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|x64.Build.0 = Release|Any CPU
     224    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|x86.ActiveCfg = Release|Any CPU
     225    {EE6BD7D3-8012-4A5D-ABAE-356B3D1E4573}.Release|x86.Build.0 = Release|Any CPU
    212226  EndGlobalSection
    213227  GlobalSection(SolutionProperties) = preSolution
  • branches/2457_ExpertSystem/ProblemInstanceIdentifier/Program.cs

    r16129 r16955  
    4848        writer.WriteLine(header);
    4949        Console.WriteLine(header);
    50         foreach (var dim in new[] { 20, 30, 40, 50, 100 }) {
     50        foreach (var dim in new[] { 20, 30, 40 }) {
    5151          foreach (var feat in dwFeatureSets) {
    5252            foreach (var type in dwTypes) {
  • branches/2457_ExpertSystem/UnitTests/InformationAnalysisTest.cs

    r16137 r16955  
    1515      Assert.AreEqual(0.9008, ia.TotalEntropy[0], 1e-04);
    1616      Assert.AreEqual(2, ia.InformationStability);
    17       Assert.AreEqual(4, ia.Diversity);
    18       Assert.AreEqual(5, ia.Regularity);
     17      Assert.AreEqual(4.0 / qualities.Length, ia.Diversity, 1e-07);
     18      Assert.AreEqual(5.0 / (qualities.Length - 1), ia.Regularity, 1e-07);
    1919      Assert.AreEqual(0.4603, ia.PeakDensityBasinInformation.Value, 1e-04);
    2020      Assert.AreEqual(0.8224, ia.PeakInformationContent.Value, 1e-04);
Note: See TracChangeset for help on using the changeset viewer.