Changeset 10940
- Timestamp:
- 06/04/14 13:22:03 (10 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TransformationToSymbolicTreeMapper.cs
r10878 r10940 46 46 } else if (transformation is ShiftStandardDistributionTransformation) { 47 47 return GenerateModelForShiftStandardDistributionTransformation(); 48 } else if (transformation is CopyColumnTransformation) { 49 // TODO 48 50 } 49 51 throw new NotImplementedException(); -
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.4/CopyColumnTransformation.cs
r10935 r10940 30 30 namespace HeuristicLab.Problems.DataAnalysis.Transformations { 31 31 [Item("CopyColumnTransformation", "Represents a transformation which represents a copied Column.")] 32 public class CopyColumnTransformation <T> : Transformation<T>{32 public class CopyColumnTransformation : Transformation { 33 33 protected const string CopiedColumnNameParameterName = "CopiedColumnName"; 34 34 … … 40 40 41 41 #region properties 42 public override string ShortName { 43 get { return "Cpy"; } 44 } 42 45 public string CopiedColumnName { 43 46 get { return CopiedColumnNameParameter.Value.Value; } … … 47 50 [StorableConstructor] 48 51 protected CopyColumnTransformation(bool deserializing) : base(deserializing) { } 49 protected CopyColumnTransformation(CopyColumnTransformation <T>original, Cloner cloner)52 protected CopyColumnTransformation(CopyColumnTransformation original, Cloner cloner) 50 53 : base(original, cloner) { 51 54 } … … 56 59 57 60 public override IDeepCloneable Clone(Cloner cloner) { 58 return new CopyColumnTransformation<T>(this, cloner); 59 } 60 61 public override IEnumerable<T> Apply(IEnumerable<T> data) { 62 foreach (T a in data) { 63 yield return a; 64 } 65 } 66 67 public override bool Check(IEnumerable<T> data, out string errorMsg) { 68 errorMsg = ""; 69 return true; 61 return new CopyColumnTransformation(this, cloner); 70 62 } 71 63 } -
branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Transformations/3.4/Transformation.cs
r10932 r10940 29 29 30 30 namespace HeuristicLab.Problems.DataAnalysis.Transformations { 31 31 32 [Item("Transformation", "Represents the base class for a transformation.")] 32 33 [StorableClass] 33 public abstract class Transformation <T> : ParameterizedNamedItem, ITransformation<T>{34 public abstract class Transformation : ParameterizedNamedItem, ITransformation { 34 35 protected const string ColumnParameterName = "Column"; 35 36 #region parameter properties … … 49 50 [StorableConstructor] 50 51 protected Transformation(bool deserializing) : base(deserializing) { } 51 protected Transformation(Transformation <T>original, Cloner cloner) : base(original, cloner) { }52 protected Transformation(Transformation original, Cloner cloner) : base(original, cloner) { } 52 53 protected Transformation(IEnumerable<string> allowedColumns) { 53 54 var allowed = new ItemSet<StringValue>(allowedColumns.Select(e => new StringValue(e))); 54 55 Parameters.Add(new ConstrainedValueParameter<StringValue>(ColumnParameterName, "Column used for the Transformation", allowed)); 55 56 } 57 } 58 59 [Item("Transformation", "Represents the base class for a transformation.")] 60 [StorableClass] 61 public abstract class Transformation<T> : Transformation, ITransformation<T> { 62 63 [StorableConstructor] 64 protected Transformation(bool deserializing) : base(deserializing) { } 65 protected Transformation(Transformation<T> original, Cloner cloner) : base(original, cloner) { } 66 protected Transformation(IEnumerable<string> allowedColumns):base(allowedColumns) { } 56 67 57 68 public abstract IEnumerable<T> Apply(IEnumerable<T> data); 58 69 59 70 public abstract bool Check(IEnumerable<T> data, out string errorMsg); 60 61 #region IParameterizedItem Members62 63 public new IKeyedItemCollection<string, IParameter> Parameters {64 get { throw new System.NotImplementedException(); }65 }66 67 #endregion68 71 } 69 72 }
Note: See TracChangeset
for help on using the changeset viewer.