Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/31/20 12:42:47 (5 years ago)
Author:
pfleck
Message:

#3040 Started adding UCI time series regression benchmarks.
Adapted parser (extracted format options & added parsing for double vectors).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/ResourceRegressionInstanceProvider.cs

    r17180 r17414  
    3939      using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) {
    4040        var entry = instancesZipFile.GetEntry(descriptor.ResourceName);
    41         NumberFormatInfo numberFormat;
    42         DateTimeFormatInfo dateFormat;
    43         char separator;
    44         using (Stream stream = entry.Open()) {
    45           TableFileParser.DetermineFileFormat(stream, out numberFormat, out dateFormat, out separator);
    46         }
     41        var formatOptions = GetFormatOptions(entry);
    4742
    4843        TableFileParser csvFileParser = new TableFileParser();
    4944        using (Stream stream = entry.Open()) {
    50           csvFileParser.Parse(stream, numberFormat, dateFormat, separator, true);
     45          csvFileParser.Parse(stream, formatOptions, true);
    5146        }
    5247
     
    6459              .Where(x => Regex.Match(x, @".*\.Data\." + fileName).Success).SingleOrDefault();
    6560    }
     61
     62    protected virtual TableFileFormatOptions GetFormatOptions(ZipArchiveEntry entry) {
     63      using (Stream stream = entry.Open()) {
     64        return TableFileParser.DetermineFileFormat(stream);
     65      }
     66    }
    6667  }
    6768}
Note: See TracChangeset for help on using the changeset viewer.