- Timestamp:
- 09/07/12 16:01:26 (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
r8598 r8599 70 70 var trainingIndizes = Enumerable.Range(0, (csvFileParser.Rows * 2) / 3); 71 71 foreach (var variableName in dataset.DoubleVariables) { 72 if ( dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&72 if (trainingIndizes.Count() >= 2 && dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 && 73 73 variableName != targetVar) 74 74 allowedInputVars.Add(variableName); … … 102 102 // turn of input variables that are constant in the training partition 103 103 var allowedInputVars = new List<string>(); 104 var trainingIndizes = Enumerable.Range(0, (csvFileParser.Rows * 2) / 3); 104 int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100; 105 var trainingIndizes = Enumerable.Range(0, trainingPartEnd); 105 106 foreach (var variableName in dataset.DoubleVariables) { 106 if ( dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&107 if (trainingIndizes.Count() >= 2 && dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 && 107 108 variableName != targetVar) 108 109 allowedInputVars.Add(variableName); … … 111 112 ClassificationProblemData classificationData = new ClassificationProblemData(dataset, allowedInputVars, targetVar); 112 113 113 int trainingPartEnd = trainingIndizes.Last(); 114 classificationData.TrainingPartition.Start = trainingIndizes.First(); 114 classificationData.TrainingPartition.Start = 0; 115 115 classificationData.TrainingPartition.End = trainingPartEnd; 116 116 classificationData.TestPartition.Start = trainingPartEnd; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Clustering/CSV/ClusteringCSVInstanceProvider.cs
r8598 r8599 69 69 var trainingIndizes = Enumerable.Range(0, (csvFileParser.Rows * 2) / 3); 70 70 foreach (var variableName in dataset.DoubleVariables) { 71 if ( dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&71 if (trainingIndizes.Count() >= 2 && dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 && 72 72 variableName != targetVar) 73 73 allowedInputVars.Add(variableName); … … 101 101 // turn of input variables that are constant in the training partition 102 102 var allowedInputVars = new List<string>(); 103 var trainingIndizes = Enumerable.Range(0, (csvFileParser.Rows * 2) / 3); 103 int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100; 104 var trainingIndizes = Enumerable.Range(0, trainingPartEnd); 104 105 foreach (var variableName in dataset.DoubleVariables) { 105 if ( dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&106 if (trainingIndizes.Count() >= 2 && dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 && 106 107 variableName != targetVar) 107 108 allowedInputVars.Add(variableName); … … 110 111 ClusteringProblemData clusteringData = new ClusteringProblemData(dataset, allowedInputVars); 111 112 112 int trainingPartEnd = trainingIndizes.Last(); 113 clusteringData.TrainingPartition.Start = trainingIndizes.First(); 113 clusteringData.TrainingPartition.Start = 0; 114 114 clusteringData.TrainingPartition.End = trainingPartEnd; 115 115 clusteringData.TestPartition.Start = trainingPartEnd; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/CSV/RegressionCSVInstanceProvider.cs
r8598 r8599 68 68 var trainingIndizes = Enumerable.Range(0, (csvFileParser.Rows * 2) / 3); 69 69 foreach (var variableName in dataset.DoubleVariables) { 70 if ( dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&70 if (trainingIndizes.Count() >= 2 && dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 && 71 71 variableName != targetVar) 72 72 allowedInputVars.Add(variableName); … … 99 99 // turn of input variables that are constant in the training partition 100 100 var allowedInputVars = new List<string>(); 101 var trainingIndizes = Enumerable.Range(0, (csvFileParser.Rows * 2) / 3); 101 int trainingPartEnd = (csvFileParser.Rows * type.Training) / 100; 102 var trainingIndizes = Enumerable.Range(0, trainingPartEnd); 102 103 foreach (var variableName in dataset.DoubleVariables) { 103 if ( dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 &&104 if (trainingIndizes.Count() >= 2 && dataset.GetDoubleValues(variableName, trainingIndizes).Range() > 0 && 104 105 variableName != targetVar) 105 106 allowedInputVars.Add(variableName); … … 108 109 RegressionProblemData regressionData = new RegressionProblemData(dataset, allowedInputVars, targetVar); 109 110 110 int trainingPartEnd = trainingIndizes.Last(); 111 regressionData.TrainingPartition.Start = trainingIndizes.First(); 111 regressionData.TrainingPartition.Start = 0; 112 112 regressionData.TrainingPartition.End = trainingPartEnd; 113 113 regressionData.TestPartition.Start = trainingPartEnd;
Note: See TracChangeset
for help on using the changeset viewer.