Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2130


Ignore:
Timestamp:
07/02/09 13:17:14 (15 years ago)
Author:
gkronber
Message:
  • Removed "AutoRegressive" parameter for GP completely. User is responsible to set allowed features correctly (including the target variable for auto regression)
  • Setting allowed features correctly in the CEDMA dispatcher (this fixes the problem of incorrect input variables in SVM)

#683 (nu-SVR engine doesn't filter allowed features to remove the target variable)

Location:
trunk/sources
Files:
6 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs

    r2119 r2130  
    167167      algo.ProblemInjector.GetVariable("TestSamplesEnd").GetValue<IntData>().Data = problem.TestSamplesEnd;
    168168      ItemList<IntData> allowedFeatures = algo.ProblemInjector.GetVariable("AllowedFeatures").GetValue<ItemList<IntData>>();
    169       foreach (int inputVariable in inputVariables) allowedFeatures.Add(new IntData(inputVariable));
     169      foreach (int inputVariable in inputVariables) {
     170        if (inputVariable != targetVariable) {
     171          allowedFeatures.Add(new IntData(inputVariable));
     172        }
     173      }
    170174
    171175      if (problem.LearningTask == LearningTask.TimeSeries) {
     
    173177        algo.ProblemInjector.GetVariable("MinTimeOffset").GetValue<IntData>().Data = problem.MinTimeOffset;
    174178        algo.ProblemInjector.GetVariable("MaxTimeOffset").GetValue<IntData>().Data = problem.MaxTimeOffset;
     179        if (problem.AutoRegressive) {
     180          allowedFeatures.Add(new IntData(targetVariable));
     181        }
    175182      } else if (problem.LearningTask == LearningTask.Classification) {
    176183        ItemList<DoubleData> classValues = algo.ProblemInjector.GetVariable("TargetClassValues").GetValue<ItemList<DoubleData>>();
  • trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/HeuristicLab.GP.StructureIdentification.TimeSeries-3.3.csproj

    r1908 r2130  
    8585    <Compile Include="HeuristicLabGPTimeSeriesPlugin.cs" />
    8686    <Compile Include="OffspringSelectionGP.cs" />
    87     <Compile Include="OffspringSelectionGpEditor.cs">
    88       <SubType>UserControl</SubType>
    89     </Compile>
    90     <Compile Include="OffspringSelectionGpEditor.Designer.cs">
    91       <DependentUpon>OffspringSelectionGpEditor.cs</DependentUpon>
    92     </Compile>
    9387    <Compile Include="ProfitEvaluator.cs" />
    9488    <Compile Include="Properties\AssemblyInfo.cs" />
    9589    <Compile Include="StandardGP.cs" />
    96     <Compile Include="StandardGpEditor.cs">
    97       <SubType>UserControl</SubType>
    98     </Compile>
    99     <Compile Include="StandardGpEditor.Designer.cs">
    100       <DependentUpon>StandardGpEditor.cs</DependentUpon>
    101     </Compile>
    10290    <Compile Include="TheilInequalityCoefficientEvaluator.cs" />
    10391  </ItemGroup>
     
    148136    <None Include="Properties\AssemblyInfo.frame" />
    149137  </ItemGroup>
    150   <ItemGroup>
    151     <EmbeddedResource Include="OffspringSelectionGpEditor.resx">
    152       <DependentUpon>OffspringSelectionGpEditor.cs</DependentUpon>
    153     </EmbeddedResource>
    154     <EmbeddedResource Include="StandardGpEditor.resx">
    155       <DependentUpon>StandardGpEditor.cs</DependentUpon>
    156     </EmbeddedResource>
    157   </ItemGroup>
    158138  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    159139  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/OffspringSelectionGP.cs

    r1857 r2130  
    3535namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
    3636  public class OffspringSelectionGP : HeuristicLab.GP.StructureIdentification.OffspringSelectionGP, ITimeSeriesAlgorithm {
    37     public virtual bool Autoregressive {
    38       get { return ProblemInjector.GetVariable("Autoregressive").GetValue<BoolData>().Data; }
    39       set { ProblemInjector.GetVariable("Autoregressive").GetValue<BoolData>().Data = value; }
    40     }
    41 
    4237    protected override IOperator CreateFunctionLibraryInjector() {
    4338      return new FunctionLibraryInjector();
  • trunk/sources/HeuristicLab.GP.StructureIdentification.TimeSeries/3.3/StandardGP.cs

    r1857 r2130  
    3535namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
    3636  public class StandardGP : HeuristicLab.GP.StructureIdentification.StandardGP, ITimeSeriesAlgorithm {
    37     public bool Autoregressive {
    38       get { return ProblemInjector.GetVariable("Autoregressive").GetValue<BoolData>().Data; }
    39       set { ProblemInjector.GetVariable("Autoregressive").GetValue<BoolData>().Data = value; }
    40     }
    41 
    4237    protected override IOperator CreateFunctionLibraryInjector() {
    4338      return new FunctionLibraryInjector();
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/GPEvaluatorBase.cs

    r2038 r2130  
    4444      AddVariableInfo(new VariableInfo("SamplesStart", "Start index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
    4545      AddVariableInfo(new VariableInfo("SamplesEnd", "End index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
    46       AddVariableInfo(new VariableInfo("UseEstimatedTargetValue", "Wether to use the original (measured) or the estimated (calculated) value for the targat variable when doing autoregressive modelling", typeof(BoolData), VariableKind.In));
     46      AddVariableInfo(new VariableInfo("UseEstimatedTargetValue", "Wether to use the original (measured) or the estimated (calculated) value for the target variable for autoregressive modelling", typeof(BoolData), VariableKind.In));
    4747    }
    4848
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/FunctionLibraryInjector.cs

    r1911 r2130  
    3535    private const string TARGETVARIABLE = "TargetVariable";
    3636    private const string ALLOWEDFEATURES = "AllowedFeatures";
    37     private const string AUTOREGRESSIVE = "Autoregressive";
    3837    private const string MINTIMEOFFSET = "MinTimeOffset";
    3938    private const string MAXTIMEOFFSET = "MaxTimeOffset";
     
    7372      AddVariableInfo(new VariableInfo(TARGETVARIABLE, "The target variable", typeof(IntData), VariableKind.In));
    7473      AddVariableInfo(new VariableInfo(ALLOWEDFEATURES, "List of indexes of allowed features", typeof(ItemList<IntData>), VariableKind.In));
    75       AddVariableInfo(new Core.VariableInfo(AUTOREGRESSIVE, "Switch to turn on/off autoregressive modeling (wether to allow the target variable as input)", typeof(BoolData), Core.VariableKind.In));
    7674      AddVariableInfo(new Core.VariableInfo(MINTIMEOFFSET, "Minimal time offset for all features", typeof(IntData), Core.VariableKind.In));
    7775      AddVariableInfo(new Core.VariableInfo(MAXTIMEOFFSET, "Maximal time offset for all feature", typeof(IntData), Core.VariableKind.In));
     
    123121      IItem maxTimeOffsetItem = GetVariableValue(MAXTIMEOFFSET, scope, true, false);
    124122      int maxTimeOffset = maxTimeOffsetItem == null ? 0 : ((IntData)maxTimeOffsetItem).Data;
    125       // try to get flag autoregressive (use false as default if not available)
    126       IItem autoRegItem = GetVariableValue(AUTOREGRESSIVE, scope, true, false);
    127       bool autoregressive = autoRegItem == null ? false : ((BoolData)autoRegItem).Data;
    128 
    129       if (autoregressive) {
    130         // make sure the target-variable occures in list of allowed features
    131         if (!allowedFeatures.Exists(d => d.Data == targetVariable)) allowedFeatures.Add(new IntData(targetVariable));
    132       } else {
    133         // remove the target-variable in case it occures in allowed features
    134         List<IntData> ts = allowedFeatures.FindAll(d => d.Data == targetVariable);
    135         foreach (IntData t in ts) allowedFeatures.Remove(t);
    136       }
    137123
    138124      variable = new StructId.Variable();
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/OffspringSelectionGP.cs

    r1857 r2130  
    7575      PopulationSize = 1000;
    7676      Parents = 20;
    77       MaxEvaluatedSolutions = 1000000;
    78       SelectionPressureLimit = 300;
     77      MaxEvaluatedSolutions = 5000000;
     78      SelectionPressureLimit = 400;
    7979      ComparisonFactor = 1.0;
    8080      SuccessRatioLimit = 1.0;
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/StandardGP.cs

    r1922 r2130  
    9999      : base() {
    100100      PopulationSize = 10000;
    101       MaxGenerations = 100;
     101      MaxGenerations = 500;
    102102      TournamentSize = 7;
    103103      MutationRate = 0.15;
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.4/Evaluators/GPEvaluatorBase.cs

    r1891 r2130  
    4242      AddVariableInfo(new VariableInfo("SamplesStart", "Start index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
    4343      AddVariableInfo(new VariableInfo("SamplesEnd", "End index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
    44       AddVariableInfo(new VariableInfo("UseEstimatedTargetValue", "Wether to use the original (measured) or the estimated (calculated) value for the targat variable when doing autoregressive modelling", typeof(BoolData), VariableKind.In));
     44      AddVariableInfo(new VariableInfo("UseEstimatedTargetValue", "Wether to use the original (measured) or the estimated (calculated) value for the target variable for autoregressive modelling", typeof(BoolData), VariableKind.In));
    4545    }
    4646
  • trunk/sources/HeuristicLab.Modeling/3.2/TimeSeriesProblemInjector.cs

    r1856 r2130  
    3939    public TimeSeriesProblemInjector()
    4040      : base() {
    41       AddVariableInfo(new Core.VariableInfo("Autoregressive", "Autoregressive modelling includes previous values of the target variable to predict future values.", typeof(BoolData), Core.VariableKind.New));
    42       GetVariableInfo("Autoregressive").Local = true;
    43       AddVariable(new Core.Variable("Autoregressive", new BoolData()));
    44 
    4541      AddVariableInfo(new Core.VariableInfo("MaxTimeOffset", "MaxTimeOffset", typeof(IntData), Core.VariableKind.New));
    4642      GetVariableInfo("MaxTimeOffset").Local = true;
  • trunk/sources/HeuristicLab.Modeling/3.3/TimeSeriesProblemInjector.cs

    r1856 r2130  
    3939    public TimeSeriesProblemInjector()
    4040      : base() {
    41       AddVariableInfo(new Core.VariableInfo("Autoregressive", "Autoregressive modelling includes previous values of the target variable to predict future values.", typeof(BoolData), Core.VariableKind.New));
    42       GetVariableInfo("Autoregressive").Local = true;
    43       AddVariable(new Core.Variable("Autoregressive", new BoolData()));
    44 
    4541      AddVariableInfo(new Core.VariableInfo("MaxTimeOffset", "MaxTimeOffset", typeof(IntData), Core.VariableKind.New));
    4642      GetVariableInfo("MaxTimeOffset").Local = true;
Note: See TracChangeset for help on using the changeset viewer.