- Timestamp:
- 12/10/14 10:31:41 (10 years ago)
- Location:
- branches/ALPS
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS
-
branches/ALPS/HeuristicLab.Problems.Instances.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis (added) merged: 11540,11623,11650
- Property svn:mergeinfo changed
-
branches/ALPS/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/ResourceClassificationInstanceProvider.cs
r11171 r11677 23 23 using System.Globalization; 24 24 using System.IO; 25 using System.IO.Compression; 25 26 using System.Linq; 26 27 using System.Reflection; 27 28 using System.Text.RegularExpressions; 28 29 using HeuristicLab.Problems.DataAnalysis; 29 using ICSharpCode.SharpZipLib.Zip;30 30 31 31 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 38 38 39 39 var instanceArchiveName = GetResourceName(FileName + @"\.zip"); 40 using (var instancesZipFile = new Zip File(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {40 using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) { 41 41 var entry = instancesZipFile.GetEntry(descriptor.ResourceName); 42 42 NumberFormatInfo numberFormat; 43 43 DateTimeFormatInfo dateFormat; 44 44 char separator; 45 using (Stream stream = instancesZipFile.GetInputStream(entry)) {45 using (Stream stream = entry.Open()) { 46 46 TableFileParser.DetermineFileFormat(stream, out numberFormat, out dateFormat, out separator); 47 47 } 48 48 49 49 TableFileParser csvFileParser = new TableFileParser(); 50 using (Stream stream = instancesZipFile.GetInputStream(entry)) {50 using (Stream stream = entry.Open()) { 51 51 csvFileParser.Parse(stream, numberFormat, dateFormat, separator, true); 52 52 } -
branches/ALPS/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/UCI/UCIInstanceProvider.cs
r11171 r11677 23 23 using System.Collections.Generic; 24 24 using System.IO; 25 using System.IO.Compression; 25 26 using System.Linq; 26 using ICSharpCode.SharpZipLib.Zip;27 27 28 28 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 56 56 var solutionsArchiveName = GetResourceName(FileName + @"\.zip"); 57 57 if (!String.IsNullOrEmpty(solutionsArchiveName)) { 58 using (var solutionsZipFile = new Zip InputStream(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {58 using (var solutionsZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName), ZipArchiveMode.Read)) { 59 59 IList<string> entries = new List<string>(); 60 ZipEntry curEntry; 61 while ((curEntry = solutionsZipFile.GetNextEntry()) != null) { 60 foreach (var curEntry in solutionsZipFile.Entries) { 62 61 entries.Add(curEntry.Name); 63 62 } -
branches/ALPS/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Clustering/CSV/ClusteringCSVInstanceProvider.cs
r11283 r11677 61 61 62 62 Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values); 63 string targetVar = dataset.DoubleVariables.Last();64 63 65 64 // turn of input variables that are constant in the training partition … … 68 67 if (trainingIndizes.Count() >= 2) { 69 68 foreach (var variableName in dataset.DoubleVariables) { 70 if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 && 71 variableName != targetVar) 69 if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0) 72 70 allowedInputVars.Add(variableName); 73 71 } 74 72 } else { 75 allowedInputVars.AddRange(dataset.DoubleVariables .Where(x => !x.Equals(targetVar)));73 allowedInputVars.AddRange(dataset.DoubleVariables); 76 74 } 77 75 … … 96 94 97 95 Dataset dataset = new Dataset(csvFileParser.VariableNames, values); 98 string targetVar = dataset.DoubleVariables.Last();99 96 100 97 // turn of input variables that are constant in the training partition … … 104 101 if (trainingIndizes.Count() >= 2) { 105 102 foreach (var variableName in dataset.DoubleVariables) { 106 if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 && 107 variableName != targetVar) 103 if (dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0) 108 104 allowedInputVars.Add(variableName); 109 105 } 110 106 } else { 111 allowedInputVars.AddRange(dataset.DoubleVariables .Where(x => !x.Equals(targetVar)));107 allowedInputVars.AddRange(dataset.DoubleVariables); 112 108 } 113 109 -
branches/ALPS/HeuristicLab.Problems.Instances.DataAnalysis/3.3/HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj
r9453 r11677 11 11 <RootNamespace>HeuristicLab.Problems.Instances.DataAnalysis</RootNamespace> 12 12 <AssemblyName>HeuristicLab.Problems.Instances.DataAnalysis-3.3</AssemblyName> 13 <TargetFrameworkVersion>v4. 0</TargetFrameworkVersion>13 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 14 14 <FileAlignment>512</FileAlignment> 15 <TargetFrameworkProfile /> 15 16 </PropertyGroup> 16 17 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> … … 22 23 <ErrorReport>prompt</ErrorReport> 23 24 <WarningLevel>4</WarningLevel> 25 <Prefer32Bit>false</Prefer32Bit> 24 26 </PropertyGroup> 25 27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 30 32 <ErrorReport>prompt</ErrorReport> 31 33 <WarningLevel>4</WarningLevel> 34 <Prefer32Bit>false</Prefer32Bit> 32 35 </PropertyGroup> 33 36 <PropertyGroup> … … 50 53 <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> 51 54 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 55 <Prefer32Bit>false</Prefer32Bit> 52 56 </PropertyGroup> 53 57 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> … … 66 70 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 67 71 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 72 <Prefer32Bit>false</Prefer32Bit> 68 73 </PropertyGroup> 69 74 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> … … 80 85 <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> 81 86 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 87 <Prefer32Bit>false</Prefer32Bit> 82 88 </PropertyGroup> 83 89 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> … … 96 102 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 97 103 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 104 <Prefer32Bit>false</Prefer32Bit> 98 105 </PropertyGroup> 99 106 <ItemGroup> 100 <Reference Include="ICSharpCode.SharpZipLib">101 <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>102 <Private>False</Private>103 </Reference>104 107 <Reference Include="System" /> 105 108 <Reference Include="System.Core" /> 106 109 <Reference Include="System.Drawing" /> 110 <Reference Include="System.IO.Compression" /> 107 111 <Reference Include="System.Windows.Forms" /> 108 112 <Reference Include="System.Xml.Linq" /> -
branches/ALPS/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/RealWorld/RealWorldRegressionInstanceProvider.cs
r11171 r11677 23 23 using System.Collections.Generic; 24 24 using System.IO; 25 using System.IO.Compression; 25 26 using System.Linq; 26 using ICSharpCode.SharpZipLib.Zip;27 27 28 28 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 52 52 var solutionsArchiveName = GetResourceName(FileName + @"\.zip"); 53 53 if (!String.IsNullOrEmpty(solutionsArchiveName)) { 54 using (var solutionsZipFile = new Zip InputStream(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {54 using (var solutionsZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName), ZipArchiveMode.Read)) { 55 55 IList<string> entries = new List<string>(); 56 ZipEntry curEntry; 57 while ((curEntry = solutionsZipFile.GetNextEntry()) != null) { 56 foreach (var curEntry in solutionsZipFile.Entries) { 58 57 entries.Add(curEntry.Name); 59 58 } -
branches/ALPS/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/ResourceRegressionInstanceProvider.cs
r11171 r11677 23 23 using System.Globalization; 24 24 using System.IO; 25 using System.IO.Compression; 25 26 using System.Linq; 26 27 using System.Reflection; 27 28 using System.Text.RegularExpressions; 28 29 using HeuristicLab.Problems.DataAnalysis; 29 using ICSharpCode.SharpZipLib.Zip;30 30 31 31 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 38 38 39 39 var instanceArchiveName = GetResourceName(FileName + @"\.zip"); 40 using (var instancesZipFile = new Zip File(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {40 using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) { 41 41 var entry = instancesZipFile.GetEntry(descriptor.ResourceName); 42 42 NumberFormatInfo numberFormat; 43 43 DateTimeFormatInfo dateFormat; 44 44 char separator; 45 using (Stream stream = instancesZipFile.GetInputStream(entry)) {45 using (Stream stream = entry.Open()) { 46 46 TableFileParser.DetermineFileFormat(stream, out numberFormat, out dateFormat, out separator); 47 47 } 48 48 49 49 TableFileParser csvFileParser = new TableFileParser(); 50 using (Stream stream = instancesZipFile.GetInputStream(entry)) {50 using (Stream stream = entry.Open()) { 51 51 csvFileParser.Parse(stream, numberFormat, dateFormat, separator, true); 52 52 }
Note: See TracChangeset
for help on using the changeset viewer.