- Timestamp:
- 07/03/12 13:41:36 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Clustering/CSV/ClusteringCSVInstanceProvider.cs
r8180 r8192 47 47 } 48 48 49 public override bool CanSaveData { 49 public override IClusteringProblemData LoadData(IDataDescriptor descriptor) { 50 throw new NotImplementedException(); 51 } 52 53 public override bool CanImportData { 50 54 get { return true; } 51 55 } 56 public override IClusteringProblemData ImportData(string path) { 57 var csvFileParser = new TableFileParser(); 52 58 53 public override void SaveData(IClusteringProblemData instance, string path) { 59 csvFileParser.Parse(path); 60 61 var dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values); 62 var claData = new ClusteringProblemData(dataset, dataset.DoubleVariables); 63 64 int trainingPartEnd = csvFileParser.Rows * 2 / 3; 65 claData.TrainingPartition.Start = 0; 66 claData.TrainingPartition.End = trainingPartEnd; 67 claData.TestPartition.Start = trainingPartEnd; 68 claData.TestPartition.End = csvFileParser.Rows; 69 int pos = path.LastIndexOf('\\'); 70 if (pos < 0) 71 claData.Name = path; 72 else { 73 pos++; 74 claData.Name = path.Substring(pos, path.Length - pos); 75 } 76 77 return claData; 78 } 79 80 public override bool CanExportData { 81 get { return true; } 82 } 83 public override void ExportData(IClusteringProblemData instance, string path) { 54 84 var strBuilder = new StringBuilder(); 55 85 … … 74 104 } 75 105 } 76 77 public override IClusteringProblemData LoadData(IDataDescriptor descriptor) {78 throw new NotImplementedException();79 }80 106 } 81 107 }
Note: See TracChangeset
for help on using the changeset viewer.