Changeset 17394 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs
- Timestamp:
- 01/07/20 16:25:39 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs
r17379 r17394 11 11 public class RegressionProblemDataConverter : BaseConverter { 12 12 private const BindingFlags flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; 13 public override JsonItem ExtractData(IItem value) { 14 JsonItem item = new JsonItem() { 15 Path = value.ItemName, 16 Children = new List<JsonItem>() 17 }; 18 13 public override int Priority => 20; 14 public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("EE612297-B1AF-42D2-BF21-AF9A2D42791C")); 15 16 public override void Populate(IItem value, JsonItem item, IJsonItemConverter root) { 19 17 dynamic val = (dynamic)value; 20 18 object dataset = (object)val.Dataset; … … 22 20 FieldInfo dataInfo = dataset.GetType().GetField("storableData", flags); 23 21 // TODO: aufteilen in trainings und test daten abschnitte 24 item. Children.Add(new JsonItem() {22 item.AddChilds(new JsonItem() { 25 23 Name = "Dataset", 26 Value = dataInfo.GetValue(dataset), 27 Path = "Dataset" 24 Value = dataInfo.GetValue(dataset) 28 25 }); 29 26 30 27 IEnumerable<StringValue> variables = (IEnumerable<StringValue>)val.InputVariables; 31 item. Children.Add(new JsonItem() {28 item.AddChilds(new JsonItem() { 32 29 Name = "TargetVariable", 33 30 Value = (object)targetVariable, 34 Range = variables.Select(x => x.Value), 35 Path = "TargetVariable" 31 Range = variables.Select(x => x.Value) 36 32 }); 37 33 38 34 39 item. Children.Add(new JsonItem() {35 item.AddChilds(new JsonItem() { 40 36 Name = "AllowedInputVariables", 41 37 Value = (object)val.AllowedInputVariables, 42 Range = variables.Select(x => x.Value), 43 Path = "AllowedInputVariables" 38 Range = variables.Select(x => x.Value) 44 39 }); 45 46 item.UpdatePath();47 48 return item;49 40 } 50 41 51 public override void InjectData(IItem item, JsonItem data ) {42 public override void InjectData(IItem item, JsonItem data, IJsonItemConverter root) { 52 43 // TODO: inject data 53 44 throw new NotImplementedException();
Note: See TracChangeset
for help on using the changeset viewer.