Changeset 14110


Ignore:
Timestamp:
07/19/16 14:47:39 (13 months ago)
Author:
mkommend
Message:

#2618: Removed obsolete code in friedman random functions and variable networks instance providers.

Location:
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Friedman/FriedmanRandomFunction.cs

    r13939 r14110  
    2929namespace HeuristicLab.Problems.Instances.DataAnalysis {
    3030  public class FriedmanRandomFunction : ArtificialRegressionDataDescriptor {
    31     private int nTrainingSamples;
    32     private int nTestSamples;
     31    private readonly int nTrainingSamples;
     32    private readonly int nTestSamples;
    3333
    34     private int numberOfFeatures;
    35     private double noiseRatio;
    36     private IRandom random;
     34    private readonly int numberOfFeatures;
     35    private readonly double noiseRatio;
     36    private readonly IRandom random;
    3737
    3838    public override string Name { get { return string.Format("FriedmanRandomFunction-{0:0%} ({1} dim)", noiseRatio, numberOfFeatures); } }
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Friedman/FriedmanRandomFunctionInstanceProvider.cs

    r13939 r14110  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Linq;                                                         
     24using System.Linq;
    2525using HeuristicLab.Problems.DataAnalysis;
    2626using HeuristicLab.Random;
     
    5353
    5454    public override IRegressionProblemData LoadData(IDataDescriptor descriptor) {
    55       var varNetwork = descriptor as FriedmanRandomFunction;
    56       if (varNetwork == null) throw new ArgumentException("FriedmanRandomFunctionInstanceProvider expects an FriedmanRandomFunction data descriptor.");
     55      var frfDescriptor = descriptor as FriedmanRandomFunction;
     56      if (frfDescriptor == null) throw new ArgumentException("FriedmanRandomFunctionInstanceProvider expects an FriedmanRandomFunction data descriptor.");
    5757      // base call generates a regression problem data
    58       var regProblemData = base.LoadData(varNetwork);
    59       var problemData =
    60         new RegressionProblemData(
    61           regProblemData.Dataset, regProblemData.AllowedInputVariables, regProblemData.TargetVariable);
    62 
    63       // copy values from regProblemData to feature selection problem data
    64       problemData.Name = regProblemData.Name;
    65       problemData.Description = regProblemData.Description;
    66       problemData.TrainingPartition.Start = regProblemData.TrainingPartition.Start;
    67       problemData.TrainingPartition.End = regProblemData.TrainingPartition.End;
    68       problemData.TestPartition.Start = regProblemData.TestPartition.Start;
    69       problemData.TestPartition.End = regProblemData.TestPartition.End;
    70 
     58      var problemData = base.LoadData(frfDescriptor);
    7159      return problemData;
    7260    }
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VariableNetworks/VariableNetwork.cs

    r13963 r14110  
    2323using System.Collections.Generic;
    2424using System.Linq;
    25 using System.Text;
    26 using System.Windows.Forms;
    2725using HeuristicLab.Common;
    2826using HeuristicLab.Core;
     
    8785
    8886    protected override List<List<double>> GenerateValues() {
    89       // var shuffledIdx = Enumerable.Range(0, numberOfFeatures).Shuffle(random).ToList();
    90 
    9187      // variable names are shuffled in the beginning (and sorted at the end)
    9288      variableNames = variableNames.Shuffle(random).ToArray();
    9389
    94       // a third of all variables are independen vars
     90      // a third of all variables are independent vars
    9591      List<List<double>> lvl0 = new List<List<double>>();
    9692      int numLvl0 = (int)Math.Ceiling(numberOfFeatures * 0.33);
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VariableNetworks/VariableNetworkInstanceProvider.cs

    r13939 r14110  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Linq;                                                         
     24using System.Linq;
    2525using HeuristicLab.Problems.DataAnalysis;
    2626using HeuristicLab.Random;
     
    5656      if (varNetwork == null) throw new ArgumentException("VariableNetworkInstanceProvider expects an VariableNetwork data descriptor.");
    5757      // base call generates a regression problem data
    58       var regProblemData = base.LoadData(varNetwork);
    59       var problemData =
    60         new RegressionProblemData(
    61           regProblemData.Dataset, regProblemData.AllowedInputVariables, regProblemData.TargetVariable);
    62 
    63       // copy values from regProblemData to feature selection problem data
    64       problemData.Name = regProblemData.Name;
     58      var problemData = base.LoadData(varNetwork);
    6559      problemData.Description = varNetwork.Description + Environment.NewLine + varNetwork.NetworkDefinition;
    66       problemData.TrainingPartition.Start = regProblemData.TrainingPartition.Start;
    67       problemData.TrainingPartition.End = regProblemData.TrainingPartition.End;
    68       problemData.TestPartition.Start = regProblemData.TestPartition.Start;
    69       problemData.TestPartition.End = regProblemData.TestPartition.End;
    70 
    7160      return problemData;
    7261    }
Note: See TracChangeset for help on using the changeset viewer.