Changeset 9133 for trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/RealWorld
- Timestamp:
- 01/09/13 14:56:57 (12 years ago)
- 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 24 24 using System.IO; 25 25 using System.Linq; 26 using HeuristicLab.Problems.DataAnalysis;27 26 using ICSharpCode.SharpZipLib.Zip; 28 27 … … 47 46 48 47 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()); 50 51 descriptorList.Add(new Tower()); 51 52 var solutionsArchiveName = GetResourceName(FileName + @"\.zip"); … … 59 60 foreach (var entry in entries.OrderBy(x => x)) { 60 61 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(); 62 63 if (desc != null) { 63 yield return new RealWorldResourceRegressionDataDescriptor(prettyName, desc.Description, entry, desc.Training, desc.Test); 64 desc.ResourceName = entry; 65 yield return desc; 64 66 } else 65 yield return new ResourceRegressionDataDescriptor(prettyName, Description, entry);67 throw new ArgumentNullException("No Descriptor could be found for this entry."); 66 68 } 67 69 } 68 70 } 69 71 } 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 }87 72 } 88 73 } -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/RealWorld/Tower.cs
r9131 r9133 20 20 #endregion 21 21 22 using System; 22 23 23 using System;24 using HeuristicLab.Data;25 24 namespace 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 { 29 28 get { 30 29 return "Publication: Order of Nonlinearity as a Complexity Measure for Models " + … … 33 32 } 34 33 } 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; } } 37 45 } 38 46 }
Note: See TracChangeset
for help on using the changeset viewer.