- Timestamp:
- 08/03/16 18:54:14 (9 years ago)
- Location:
- branches/symbreg-factors-2650
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs ¶
r13761 r14232 168 168 get { return variableValues.Where(p => p.Value is List<double>).Select(p => p.Key); } 169 169 } 170 171 public IEnumerable<string> StringVariables { 172 get { return variableValues.Where(p => p.Value is List<string>).Select(p => p.Key); } 173 } 174 170 175 public IEnumerable<double> GetDoubleValues(string variableName) { 171 176 return GetValues<double>(variableName); … … 189 194 return GetValues<double>(variableName, rows); 190 195 } 196 197 public string GetStringValue(string variableName, int row) { 198 var values = GetValues<string>(variableName); 199 return values[row]; 200 } 201 202 public IEnumerable<string> GetStringValues(string variableName, IEnumerable<int> rows) { 203 return GetValues<string>(variableName, rows); 204 } 205 public ReadOnlyCollection<string> GetReadOnlyStringValues(string variableName) { 206 var values = GetValues<string>(variableName); 207 return values.AsReadOnly(); 208 } 209 191 210 private IEnumerable<T> GetValues<T>(string variableName, IEnumerable<int> rows) { 192 211 var values = GetValues<T>(variableName); -
TabularUnified branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs ¶
r14185 r14232 131 131 protected DataAnalysisProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<ITransformation> transformations = null) { 132 132 if (dataset == null) throw new ArgumentNullException("The dataset must not be null."); 133 if (allowedInputVariables == null) throw new ArgumentNullException("The allowed InputVariables must not be null.");134 135 if (allowedInputVariables.Except(dataset.DoubleVariables). Any())136 throw new ArgumentException("All allowed input variables must be present in the dataset and of type double .");137 138 var inputVariables = new CheckedItemList<StringValue>(dataset.DoubleVariables. Select(x => new StringValue(x)));133 if (allowedInputVariables == null) throw new ArgumentNullException("The allowed input variables must not be null."); 134 135 if (allowedInputVariables.Except(dataset.DoubleVariables).Except(dataset.StringVariables).Any()) 136 throw new ArgumentException("All allowed input variables must be present in the dataset and of type double or string."); 137 138 var inputVariables = new CheckedItemList<StringValue>(dataset.DoubleVariables.Concat(dataset.StringVariables).Select(x => new StringValue(x))); 139 139 foreach (StringValue x in inputVariables) 140 140 inputVariables.SetItemCheckedState(x, allowedInputVariables.Contains(x.Value)); -
TabularUnified branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs ¶
r14185 r14232 30 30 31 31 IDataset Dataset { get; } 32 ICheckedItemList<StringValue> InputVariables { get; } 32 ICheckedItemList<StringValue> InputVariables { get; } // TODO: check all usages of InputVariables (distinguish between doubles and strings) 33 33 IEnumerable<string> AllowedInputVariables { get; } 34 34 -
TabularUnified branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataset.cs ¶
r14185 r14232 30 30 IEnumerable<string> VariableNames { get; } 31 31 IEnumerable<string> DoubleVariables { get; } 32 IEnumerable<string> StringVariables { get; } 33 34 bool VariableHasType<T>(string variableName); 32 35 33 36 double GetDoubleValue(string variableName, int row); … … 36 39 ReadOnlyCollection<double> GetReadOnlyDoubleValues(string variableName); 37 40 41 string GetStringValue(string variableName, int row); 38 42 IEnumerable<string> GetStringValues(string variableName); 43 IEnumerable<string> GetStringValues(string variableName, IEnumerable<int> rows); 44 ReadOnlyCollection<string> GetReadOnlyStringValues(string VariableName); 45 39 46 IEnumerable<DateTime> GetDateTimeValues(string variableName); 40 47 }
Note: See TracChangeset
for help on using the changeset viewer.