Changeset 6666 for trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
- Timestamp:
- 08/17/11 14:37:34 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
r6654 r6666 34 34 [Item("ClassificationProblemData", "Represents an item containing all data defining a classification problem.")] 35 35 public class ClassificationProblemData : DataAnalysisProblemData, IClassificationProblemData { 36 pr ivateconst string TargetVariableParameterName = "TargetVariable";37 pr ivateconst string ClassNamesParameterName = "ClassNames";38 pr ivateconst string ClassificationPenaltiesParameterName = "ClassificationPenalties";39 pr ivateconst int MaximumNumberOfClasses = 20;40 pr ivateconst int InspectedRowsToDetermineTargets = 500;36 protected const string TargetVariableParameterName = "TargetVariable"; 37 protected const string ClassNamesParameterName = "ClassNames"; 38 protected const string ClassificationPenaltiesParameterName = "ClassificationPenalties"; 39 protected const int MaximumNumberOfClasses = 20; 40 protected const int InspectedRowsToDetermineTargets = 500; 41 41 42 42 #region default data … … 174 174 private static IEnumerable<string> defaultAllowedInputVariables; 175 175 private static string defaultTargetVariable; 176 177 private static ClassificationProblemData emptyProblemData; 178 public static ClassificationProblemData EmptyProblemData { 179 get { return EmptyProblemData; } 180 } 181 176 182 static ClassificationProblemData() { 177 183 defaultDataset = new Dataset(defaultVariableNames, defaultData); … … 181 187 defaultAllowedInputVariables = defaultVariableNames.Except(new List<string>() { "sample", "class" }); 182 188 defaultTargetVariable = "class"; 189 190 var problemData = new ClassificationProblemData(); 191 problemData.Parameters.Clear(); 192 problemData.Name = "Empty Classification ProblemData"; 193 problemData.Description = "This ProblemData acts as place holder before the correct problem data is loaded."; 194 problemData.isEmpty = true; 195 196 problemData.Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", new Dataset())); 197 problemData.Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, "")); 198 problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly())); 199 problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly())); 200 problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>())); 201 problemData.Parameters.Add(new FixedValueParameter<StringMatrix>(ClassNamesParameterName, "", new StringMatrix(0, 0).AsReadOnly())); 202 problemData.Parameters.Add(new FixedValueParameter<DoubleMatrix>(ClassificationPenaltiesParameterName, "", (DoubleMatrix)new DoubleMatrix(0, 0).AsReadOnly())); 203 emptyProblemData = problemData; 183 204 } 184 205 #endregion … … 249 270 RegisterParameterEvents(); 250 271 } 251 public override IDeepCloneable Clone(Cloner cloner) { return new ClassificationProblemData(this, cloner); } 272 public override IDeepCloneable Clone(Cloner cloner) { 273 if (this == emptyProblemData) return emptyProblemData; 274 return new ClassificationProblemData(this, cloner); 275 } 252 276 253 277 public ClassificationProblemData() : this(defaultDataset, defaultAllowedInputVariables, defaultTargetVariable) { }
Note: See TracChangeset
for help on using the changeset viewer.