Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/09/13 14:56:57 (12 years ago)
Author:
sforsten
Message:

#2001:

  • removed IRealWorldRegressionDataDescriptor and RealWorldResourceRegressionDataDescriptor
  • simplified regression data descriptors as suggested by mkommend
Location:
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/RealWorld
Files:
2 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/RealWorld/RealWorldRegressionInstanceProvider.cs

    r9131 r9133  
    2424using System.IO;
    2525using System.Linq;
    26 using HeuristicLab.Problems.DataAnalysis;
    2726using ICSharpCode.SharpZipLib.Zip;
    2827
     
    4746
    4847    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
    49       List<IRealWorldRegressionDataDescriptor> descriptorList = new List<IRealWorldRegressionDataDescriptor>();
     48      List<ResourceRegressionDataDescriptor> descriptorList = new List<ResourceRegressionDataDescriptor>();
     49      descriptorList.Add(new ChemicalOne());
     50      descriptorList.Add(new Housing());
    5051      descriptorList.Add(new Tower());
    5152      var solutionsArchiveName = GetResourceName(FileName + @"\.zip");
     
    5960          foreach (var entry in entries.OrderBy(x => x)) {
    6061            string prettyName = Path.GetFileNameWithoutExtension(entry);
    61             IRealWorldRegressionDataDescriptor desc = descriptorList.Where(x => x.Name.Equals(prettyName)).FirstOrDefault();
     62            ResourceRegressionDataDescriptor desc = descriptorList.Where(x => x.Name.Equals(prettyName)).FirstOrDefault();
    6263            if (desc != null) {
    63               yield return new RealWorldResourceRegressionDataDescriptor(prettyName, desc.Description, entry, desc.Training, desc.Test);
     64              desc.ResourceName = entry;
     65              yield return desc;
    6466            } else
    65               yield return new ResourceRegressionDataDescriptor(prettyName, Description, entry);
     67              throw new ArgumentNullException("No Descriptor could be found for this entry.");
    6668          }
    6769        }
    6870      }
    6971    }
    70 
    71     public override IRegressionProblemData LoadData(IDataDescriptor id) {
    72       var problem = base.LoadData(id);
    73 
    74       var descriptor = id as RealWorldResourceRegressionDataDescriptor;
    75 
    76       if (descriptor == null) {
    77         return problem;
    78       }
    79 
    80       problem.TrainingPartition.Start = descriptor.Training.Start;
    81       problem.TrainingPartition.End = descriptor.Training.End;
    82       problem.TestPartition.Start = descriptor.Test.Start;
    83       problem.TestPartition.End = descriptor.Test.End;
    84 
    85       return problem;
    86     }
    8772  }
    8873}
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/RealWorld/Tower.cs

    r9131 r9133  
    2020#endregion
    2121
     22using System;
    2223
    23 using System;
    24 using HeuristicLab.Data;
    2524namespace HeuristicLab.Problems.Instances.DataAnalysis {
    26   public class Tower : IRealWorldRegressionDataDescriptor {
    27     public string Name { get { return "Tower"; } }
    28     public string Description {
     25  public class Tower : ResourceRegressionDataDescriptor {
     26    public override string Name { get { return "Tower"; } }
     27    public override string Description {
    2928      get {
    3029        return "Publication: Order of Nonlinearity as a Complexity Measure for Models " +
     
    3332      }
    3433    }
    35     public IntRange Training { get { return new IntRange(0, 3135); } }
    36     public IntRange Test { get { return new IntRange(3135, 4999); } }
     34    protected override string TargetVariable { get { return "towerResponse"; } }
     35    protected override string[] VariableNames {
     36      get { return new string[] { "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", "x24", "x25", "towerResponse" }; }
     37    }
     38    protected override string[] AllowedInputVariables {
     39      get { return new string[] { "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", "x24", "x25" }; }
     40    }
     41    protected override int TrainingPartitionStart { get { return 0; } }
     42    protected override int TrainingPartitionEnd { get { return 3135; } }
     43    protected override int TestPartitionStart { get { return 3135; } }
     44    protected override int TestPartitionEnd { get { return 4999; } }
    3745  }
    3846}
Note: See TracChangeset for help on using the changeset viewer.