Changeset 6223 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification
- Timestamp:
- 05/17/11 14:55:51 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
r6186 r6223 37 37 private const string ClassNamesParameterName = "ClassNames"; 38 38 private const string ClassificationPenaltiesParameterName = "ClassificationPenalties"; 39 private const int MaximumNumberOfClass = 100;39 private const int MaximumNumberOfClasses = 20; 40 40 private const int InspectedRowsToDetermineTargets = 500; 41 41 … … 266 266 267 267 private static IEnumerable<string> CheckVariablesForPossibleTargetVariables(Dataset dataset) { 268 int maxSamples = Math.Min(InspectedRowsToDetermineTargets, dataset.Rows); 268 269 var validTargetVariables = from v in dataset.VariableNames 269 let DistinctValues = dataset.Rows > InspectedRowsToDetermineTargets ? dataset.GetVariableValues(v, 0, InspectedRowsToDetermineTargets).Distinct().Count() 270 : dataset.GetVariableValues(v).Distinct().Count() 271 where DistinctValues < MaximumNumberOfClass 270 let DistinctValues = dataset.GetVariableValues(v) 271 .Take(maxSamples) 272 .Distinct() 273 .Count() 274 where DistinctValues < MaximumNumberOfClasses 272 275 select v; 273 276 274 277 if (!validTargetVariables.Any()) 275 throw new ArgumentException("Import of classification problem data was not successful l, because no target variable was found." +276 " A target variable must have at most " + MaximumNumberOfClass + " distinct values to be applicable to classification.");278 throw new ArgumentException("Import of classification problem data was not successful, because no target variable was found." + 279 " A target variable must have at most " + MaximumNumberOfClasses + " distinct values to be applicable to classification."); 277 280 return validTargetVariables; 278 281 }
Note: See TracChangeset
for help on using the changeset viewer.