Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/19/18 10:25:45 (7 years ago)
Author:
pfleck
Message:

#2906 First concept of simple transformation (single target transformation)

Location:
branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4
Files:
10 added
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4

    • Property svn:ignore
      •  

        old new  
        55*.vs10x
        66Plugin.cs
         7*.DotSettings
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r15837 r15846  
    101101    <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    102102      <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath>
    103       <Private>False</Private>
    104     </Reference>
    105     <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec" />
     103      <SpecificVersion>False</SpecificVersion>
     104      <Private>False</Private>
     105    </Reference>
     106    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     107      <SpecificVersion>False</SpecificVersion>
     108      <Private>False</Private>
     109    </Reference>
    106110    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    107111      <SpecificVersion>False</SpecificVersion>
    108112      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common-3.3.dll</HintPath>
     113      <Private>False</Private>
    109114    </Reference>
    110115    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    111116      <SpecificVersion>False</SpecificVersion>
    112117      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     118      <Private>False</Private>
    113119    </Reference>
    114120    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    115121      <SpecificVersion>False</SpecificVersion>
    116122      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
     123      <Private>False</Private>
    117124    </Reference>
    118125    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    119126      <SpecificVersion>False</SpecificVersion>
    120127      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Data-3.3.dll</HintPath>
     128      <Private>False</Private>
    121129    </Reference>
    122130    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    123131      <SpecificVersion>False</SpecificVersion>
    124132      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     133      <Private>False</Private>
    125134    </Reference>
    126135    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    127136      <SpecificVersion>False</SpecificVersion>
    128137      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     138      <Private>False</Private>
    129139    </Reference>
    130140    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    131141      <SpecificVersion>False</SpecificVersion>
    132142      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     143      <Private>False</Private>
    133144    </Reference>
    134145    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    135146      <SpecificVersion>False</SpecificVersion>
    136147      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     148      <Private>False</Private>
    137149    </Reference>
    138150    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    139151      <SpecificVersion>False</SpecificVersion>
    140152      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
     153      <Private>False</Private>
    141154    </Reference>
    142155    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    143156      <SpecificVersion>False</SpecificVersion>
    144157      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Random-3.3.dll</HintPath>
     158      <Private>False</Private>
    145159    </Reference>
    146160    <Reference Include="System" />
     
    181195    <Compile Include="Implementation\ConstantModel.cs" />
    182196    <Compile Include="Implementation\DataAnalysisModel.cs" />
     197    <Compile Include="Implementation\DataAnalysisTransformation.cs" />
    183198    <Compile Include="Implementation\Regression\ConfidenceBoundRegressionSolution.cs" />
    184199    <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" />
     
    191206    <Compile Include="Implementation\Regression\RegressionModel.cs" />
    192207    <Compile Include="Implementation\Regression\RegressionSolutionVariableImpactsCalculator.cs" />
     208    <Compile Include="Implementation\Regression\TransformedRegressionModel.cs" />
     209    <Compile Include="Implementation\Regression\TransformedRegressionSolution.cs" />
    193210    <Compile Include="Implementation\TimeSeriesPrognosis\Models\ConstantTimeSeriesPrognosisModel.cs" />
    194211    <Compile Include="Implementation\TimeSeriesPrognosis\Models\TimeSeriesPrognosisAutoRegressiveModel.cs" />
     
    198215    <Compile Include="Implementation\TimeSeriesPrognosis\TimeSeriesPrognosisSolution.cs" />
    199216    <Compile Include="Implementation\TimeSeriesPrognosis\TimeSeriesPrognosisSolutionBase.cs" />
    200     <Compile Include="Implementation\Transformations\CopyColumnTransformation.cs" />
     217    <None Include="Implementation\Transformations %28old%29\CopyColumnTransformation.cs" />
     218    <None Include="Implementation\Transformations %28old%29\ExponentialTransformation.cs" />
     219    <None Include="Implementation\Transformations %28old%29\LinearTransformation.cs" />
     220    <None Include="Implementation\Transformations %28old%29\LogarithmicTransformation.cs" />
     221    <None Include="Implementation\Transformations %28old%29\PowerTransformation.cs" />
     222    <None Include="Implementation\Transformations %28old%29\ReciprocalTransformation.cs" />
     223    <None Include="Implementation\Transformations %28old%29\ShiftStandardDistributionTransformation.cs" />
     224    <None Include="Implementation\Transformations %28old%29\ShiftToRangeTransformation.cs" />
     225    <None Include="Implementation\Transformations %28old%29\Transformation.cs" />
    201226    <Compile Include="Implementation\Transformations\ExponentialTransformation.cs" />
     227    <Compile Include="Implementation\Transformations\IdentityTransformation.cs" />
    202228    <Compile Include="Implementation\Transformations\LinearTransformation.cs" />
    203     <Compile Include="Implementation\Transformations\LogarithmicTransformation.cs" />
    204     <Compile Include="Implementation\Transformations\PowerTransformation.cs" />
    205     <Compile Include="Implementation\Transformations\ReciprocalTransformation.cs" />
    206     <Compile Include="Implementation\Transformations\ShiftStandardDistributionTransformation.cs" />
    207     <Compile Include="Implementation\Transformations\ShiftToRangeTransformation.cs" />
     229    <Compile Include="Implementation\Transformations\LogarithmTransformation.cs" />
    208230    <Compile Include="Implementation\Transformations\Transformation.cs" />
     231    <Compile Include="Implementation\Transformations\ZNormalizationTransformation.cs" />
    209232    <Compile Include="Interfaces\Classification\IClassificationEnsembleModel.cs">
    210233      <SubType>Code</SubType>
     
    215238    <Compile Include="Interfaces\Classification\IDiscriminantFunctionThresholdCalculator.cs" />
    216239    <Compile Include="Interfaces\IDataAnalysisSolutionExporter.cs" />
     240    <Compile Include="Interfaces\IDataAnalysisTransformation.cs" />
    217241    <Compile Include="Interfaces\IDataset.cs" />
    218242    <Compile Include="Interfaces\IDependencyCalculator.cs" />
    219243    <Compile Include="Interfaces\ITransformation.cs" />
    220244    <Compile Include="Interfaces\ITransformationMapper.cs" />
     245    <Compile Include="Interfaces\Regression\ITransformedRegressionModel.cs" />
     246    <Compile Include="Interfaces\Regression\ITransformedRegressionSolution.cs" />
    221247    <Compile Include="Interfaces\Regression\IConfidenceRegressionModel.cs" />
    222248    <Compile Include="Interfaces\Regression\IConfidenceRegressionSolution.cs" />
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs

    r15583 r15846  
    333333    }
    334334
    335     public ClassificationProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)
    336       : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) {
     335    public ClassificationProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<IDataAnalysisTransformation> transformations = null)
     336      : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<IDataAnalysisTransformation>()) {
    337337      var validTargetVariableValues = CheckVariablesForPossibleTargetVariables(dataset).Select(x => new StringValue(x).AsReadOnly()).ToList();
    338338      var target = validTargetVariableValues.Where(x => x.Value == targetVariable).DefaultIfEmpty(validTargetVariableValues.First()).First();
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblemData.cs

    r15583 r15846  
    8787    }
    8888
    89     public ClusteringProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<ITransformation> transformations = null)
    90       : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) {
     89    public ClusteringProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<IDataAnalysisTransformation> transformations = null)
     90      : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<IDataAnalysisTransformation>()) {
    9191    }
    9292  }
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs

    r15583 r15846  
    7474    }
    7575
    76     public IFixedValueParameter<ReadOnlyItemList<ITransformation>> TransformationsParameter {
    77       get { return (IFixedValueParameter<ReadOnlyItemList<ITransformation>>)Parameters[TransformationsParameterName]; }
     76    public IFixedValueParameter<ReadOnlyItemList<IDataAnalysisTransformation>> TransformationsParameter {
     77      get { return (IFixedValueParameter<ReadOnlyItemList<IDataAnalysisTransformation>>)Parameters[TransformationsParameterName]; }
    7878    }
    7979    #endregion
     
    122122    }
    123123
    124     public IEnumerable<ITransformation> Transformations {
     124    public IEnumerable<IDataAnalysisTransformation> Transformations {
    125125      get { return TransformationsParameter.Value; }
    126126    }
     
    148148    [StorableHook(HookType.AfterDeserialization)]
    149149    private void AfterDeserialization() {
    150       if (!Parameters.ContainsKey(TransformationsParameterName)) {
    151         Parameters.Add(new FixedValueParameter<ReadOnlyItemList<ITransformation>>(TransformationsParameterName, "", new ItemList<ITransformation>().AsReadOnly()));
    152         TransformationsParameter.Hidden = true;
    153       }
     150      if (Parameters[TransformationsParameterName] is FixedValueParameter<ReadOnlyItemList<ITransformation>>)
     151        Parameters.Remove(TransformationsParameterName);
     152      if (!Parameters.ContainsKey(TransformationsParameterName))
     153        Parameters.Add(new FixedValueParameter<ReadOnlyItemList<IDataAnalysisTransformation>>(TransformationsParameterName, new ItemList<IDataAnalysisTransformation>().AsReadOnly()) { Hidden = true });
     154
    154155      RegisterEventHandlers();
    155156    }
    156157
    157     protected DataAnalysisProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<ITransformation> transformations = null) {
     158    protected DataAnalysisProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<IDataAnalysisTransformation> transformations = null) {
    158159      if (dataset == null) throw new ArgumentNullException("The dataset must not be null.");
    159160      if (allowedInputVariables == null) throw new ArgumentNullException("The allowed input variables must not be null.");
     
    172173      int testPartitionEnd = dataset.Rows;
    173174
    174       var transformationsList = new ItemList<ITransformation>(transformations ?? Enumerable.Empty<ITransformation>());
     175      var transformationsList = new ItemList<IDataAnalysisTransformation>(transformations ?? Enumerable.Empty<IDataAnalysisTransformation>());
    175176
    176177      Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", (Dataset)dataset));
     
    178179      Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", new IntRange(trainingPartitionStart, trainingPartitionEnd)));
    179180      Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", new IntRange(testPartitionStart, testPartitionEnd)));
    180       Parameters.Add(new FixedValueParameter<ReadOnlyItemList<ITransformation>>(TransformationsParameterName, "", transformationsList.AsReadOnly()));
    181 
    182       TransformationsParameter.Hidden = true;
     181      Parameters.Add(new FixedValueParameter<ReadOnlyItemList<IDataAnalysisTransformation>>(TransformationsParameterName, "", transformationsList.AsReadOnly()) { Hidden = transformationsList.Count == 0 });
    183182
    184183      ((ValueParameter<Dataset>)DatasetParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r15583 r15846  
    141141    }
    142142    public RegressionProblemData(IRegressionProblemData regressionProblemData)
    143       : this(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable) {
     143      : this(regressionProblemData.Dataset, regressionProblemData.AllowedInputVariables, regressionProblemData.TargetVariable, regressionProblemData.Transformations) {
    144144      TrainingPartition.Start = regressionProblemData.TrainingPartition.Start;
    145145      TrainingPartition.End = regressionProblemData.TrainingPartition.End;
     
    148148    }
    149149
    150     public RegressionProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)
    151       : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) {
     150    public RegressionProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<IDataAnalysisTransformation> transformations = null)
     151      : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<IDataAnalysisTransformation>()) {
    152152      var variables = InputVariables.Select(x => x.AsReadOnly()).ToList();
    153153      Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First()));
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisProblemData.cs

    r15583 r15846  
    15821582      TrainingPartition.Start = 50;
    15831583    }
    1584     public TimeSeriesPrognosisProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)
    1585       : base(dataset, allowedInputVariables, targetVariable, transformations ?? Enumerable.Empty<ITransformation>()) {
     1584    public TimeSeriesPrognosisProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<IDataAnalysisTransformation> transformations = null)
     1585      : base(dataset, allowedInputVariables, targetVariable, transformations ?? Enumerable.Empty<IDataAnalysisTransformation>()) {
    15861586      Parameters.Add(new FixedValueParameter<IntValue>(TrainingHorizonParameterName, "Specifies the horizon (how far the prognosis reaches in the future) for each training sample.", new IntValue(1)));
    15871587      Parameters.Add(new FixedValueParameter<IntValue>(TestHorizonParameterName, "Specifies the horizon (how far the prognosis reaches in the future) for each test sample.", new IntValue(1)));
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs

    r15583 r15846  
    4343    IEnumerable<int> TestIndices { get; }
    4444
    45     IEnumerable<ITransformation> Transformations { get; }
     45    IEnumerable<IDataAnalysisTransformation> Transformations { get; }
    4646
    4747    bool IsTrainingSample(int index);
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/ITransformation.cs

    r15583 r15846  
    2424
    2525namespace HeuristicLab.Problems.DataAnalysis {
    26   public interface ITransformation : IParameterizedItem {
    27     string ShortName { get; }
    28     string Column { get; }
     26  public interface ITransformation : IParameterizedNamedItem {
    2927  }
    3028
    3129  public interface ITransformation<T> : ITransformation {
    32     void ConfigureParameters(IEnumerable<T> data);
    33     IEnumerable<T> ConfigureAndApply(IEnumerable<T> data);
     30    bool Check(IEnumerable<T> data, out string errorMessage);
     31
     32    void Configure(IEnumerable<T> data);
     33
    3434    IEnumerable<T> Apply(IEnumerable<T> data);
     35    IEnumerable<T> InverseApply(IEnumerable<T> data);
    3536  }
    3637}
  • branches/2906_Transformations/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/ITransformationMapper.cs

    r15583 r15846  
    2121
    2222
     23using System;
     24
    2325namespace HeuristicLab.Problems.DataAnalysis {
     26  [Obsolete]
    2427  public interface ITransformationMapper<out T> {
    2528    T GenerateModel(ITransformation transformation);
Note: See TracChangeset for help on using the changeset viewer.