Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/UCITimeSeries/UCITimeSeriesProvider.cs @ 17554

Last change on this file since 17554 was 17418, checked in by pfleck, 5 years ago

#3040

  • (partially) enabled data preprocessing for vectorial data
  • use flat zip-files for large benchmarks instead of embedded resources (faster build times)
  • added multiple variants of vector benchmark I (vector lengh constraints)
File size: 2.8 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Globalization;
25using System.IO;
26using System.IO.Compression;
27
28namespace HeuristicLab.Problems.Instances.DataAnalysis {
29  public class UCITimeSeriesProvider : ResourceRegressionInstanceProvider {
30    public override string Name {
31      get { return "UCI Time Series"; }
32    }
33
34    public override string Description {
35      get { return "Some selected instances of the UCI Machine Learning Repository that contain time series or vectorial data."; }
36    }
37
38    public override Uri WebLink {
39      get { return new Uri("https://archive.ics.uci.edu/ml/datasets.php?format=&task=reg&att=&area=&numAtt=&numIns=&type=ts&sort=taskUp&view=table"); }
40    }
41
42    public override string ReferencePublication {
43      get { return "Dua, D. and Graff, C. (2019). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science."; }
44    }
45
46    protected override string FileName {
47      get { return "UCITimeSeries"; }
48    }
49
50    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
51      return new IDataDescriptor[] {
52        new GasFlowModulation(),
53        new HydraulicConditionMonitoring(),
54        new SocialMediaBuzzTwitter(),
55        new SocialMediaBuzzTomsHardware()
56      };
57    }
58
59    protected override Stream OpenResourceStream(string fileName) {
60      var instanceArchiveName = Path.Combine("Regression", "Data", fileName + ".zip");
61      return new FileStream(instanceArchiveName, FileMode.Open, FileAccess.Read, FileShare.Read);
62    }
63
64    protected override TableFileFormatOptions GetFormatOptions(ZipArchiveEntry entry) {
65      return new TableFileFormatOptions {
66        NumberFormat = NumberFormatInfo.InvariantInfo,
67        DateTimeFormat = DateTimeFormatInfo.InvariantInfo,
68        ColumnSeparator = ';',
69        VectorSeparator = ','
70      };
71    }
72  }
73}
Note: See TracBrowser for help on using the repository browser.