Changeset 8530
- Timestamp:
- 08/28/12 11:48:05 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/CSV/ClassifiactionCSVInstanceProvider.cs
r8211 r8530 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Globalization; 24 25 using System.IO; 25 26 using System.Linq; … … 86 87 } 87 88 public override void ExportData(IClassificationProblemData instance, string path) { 88 StringBuilder strBuilder = new StringBuilder();89 var strBuilder = new StringBuilder(); 89 90 90 91 foreach (var variable in instance.InputVariables) { 91 strBuilder.Append(variable + ";");92 strBuilder.Append(variable + CultureInfo.CurrentCulture.TextInfo.ListSeparator); 92 93 } 93 strBuilder.Remove(strBuilder.Length - 1, 1);94 strBuilder.Remove(strBuilder.Length - CultureInfo.CurrentCulture.TextInfo.ListSeparator.Length, CultureInfo.CurrentCulture.TextInfo.ListSeparator.Length); 94 95 strBuilder.AppendLine(); 95 96 96 Datasetdataset = instance.Dataset;97 var dataset = instance.Dataset; 97 98 98 99 for (int i = 0; i < dataset.Rows; i++) { 99 100 for (int j = 0; j < dataset.Columns; j++) { 100 strBuilder.Append(dataset.GetValue(i, j) + ";"); 101 if (j > 0) strBuilder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator); 102 strBuilder.Append(dataset.GetValue(i, j)); 101 103 } 102 strBuilder.Remove(strBuilder.Length - 1, 1);103 104 strBuilder.AppendLine(); 104 105 } 105 106 106 using ( StreamWriter writer = new StreamWriter(path)) {107 using (var writer = new StreamWriter(path)) { 107 108 writer.Write(strBuilder); 108 109 } -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Clustering/CSV/ClusteringCSVInstanceProvider.cs
r8211 r8530 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Globalization; 24 25 using System.IO; 25 26 using System.Text; … … 85 86 86 87 foreach (var variable in instance.InputVariables) { 87 strBuilder.Append(variable + ";");88 strBuilder.Append(variable + CultureInfo.CurrentCulture.TextInfo.ListSeparator); 88 89 } 89 strBuilder.Remove(strBuilder.Length - 1, 1);90 strBuilder.Remove(strBuilder.Length - CultureInfo.CurrentCulture.TextInfo.ListSeparator.Length, CultureInfo.CurrentCulture.TextInfo.ListSeparator.Length); 90 91 strBuilder.AppendLine(); 91 92 … … 94 95 for (int i = 0; i < dataset.Rows; i++) { 95 96 for (int j = 0; j < dataset.Columns; j++) { 96 strBuilder.Append(dataset.GetValue(i, j) + ";"); 97 if (j > 0) strBuilder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator); 98 strBuilder.Append(dataset.GetValue(i, j)); 97 99 } 98 strBuilder.Remove(strBuilder.Length - 1, 1);99 100 strBuilder.AppendLine(); 100 101 } -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/CSV/RegressionCSVInstanceProvider.cs
r8211 r8530 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Globalization; 24 25 using System.IO; 25 26 using System.Linq; … … 85 86 } 86 87 public override void ExportData(IRegressionProblemData instance, string path) { 87 StringBuilder strBuilder = new StringBuilder();88 var strBuilder = new StringBuilder(); 88 89 89 90 foreach (var variable in instance.InputVariables) { 90 strBuilder.Append(variable + ";");91 strBuilder.Append(variable + CultureInfo.CurrentCulture.TextInfo.ListSeparator); 91 92 } 92 strBuilder.Remove(strBuilder.Length - 1, 1);93 strBuilder.Remove(strBuilder.Length - CultureInfo.CurrentCulture.TextInfo.ListSeparator.Length, CultureInfo.CurrentCulture.TextInfo.ListSeparator.Length); 93 94 strBuilder.AppendLine(); 94 95 95 Datasetdataset = instance.Dataset;96 var dataset = instance.Dataset; 96 97 97 98 for (int i = 0; i < dataset.Rows; i++) { 98 99 for (int j = 0; j < dataset.Columns; j++) { 99 strBuilder.Append(dataset.GetValue(i, j) + ";"); 100 if (j > 0) strBuilder.Append(CultureInfo.CurrentCulture.TextInfo.ListSeparator); 101 strBuilder.Append(dataset.GetValue(i, j)); 100 102 } 101 strBuilder.Remove(strBuilder.Length - 1, 1);102 103 strBuilder.AppendLine(); 103 104 } 104 105 105 using ( StreamWriter writer = new StreamWriter(path)) {106 using (var writer = new StreamWriter(path)) { 106 107 writer.Write(strBuilder); 107 108 }
Note: See TracChangeset
for help on using the changeset viewer.