#region License Information /* HeuristicLab * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.IO.Compression; namespace HeuristicLab.Problems.Instances.DataAnalysis { public class UCITimeSeriesProvider : ResourceRegressionInstanceProvider { public override string Name { get { return "UCI Time Series"; } } public override string Description { get { return "Some selected instances of the UCI Machine Learning Repository that contain time series or vectorial data."; } } public override Uri WebLink { 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"); } } public override string ReferencePublication { 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."; } } protected override string FileName { get { return "UCITimeSeries"; } } public override IEnumerable GetDataDescriptors() { return new IDataDescriptor[] { new GasFlowModulation(), new HydraulicConditionMonitoring(), new SocialMediaBuzzTwitter(), new SocialMediaBuzzTomsHardware() }; } protected override Stream OpenResourceStream(string fileName) { var instanceArchiveName = Path.Combine("Regression", "Data", fileName + ".zip"); return new FileStream(instanceArchiveName, FileMode.Open, FileAccess.Read, FileShare.Read); } protected override TableFileFormatOptions GetFormatOptions(ZipArchiveEntry entry) { return new TableFileFormatOptions { NumberFormat = NumberFormatInfo.InvariantInfo, DateTimeFormat = DateTimeFormatInfo.InvariantInfo, ColumnSeparator = ';', VectorSeparator = ',' }; } } }