Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/16 14:37:15 (8 years ago)
Author:
mkommend
Message:

#2604: Merged r13826,r13921, r13922, r13941, r13992, r13993, r14000 intos table.

Location:
stable
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.DataAnalysis

  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassification.cs

    r13297 r14027  
    220220
    221221      var problemDataClone = (IClassificationProblemData)problemData.Clone();
    222       return new NeuralNetworkClassificationSolution(problemDataClone, new NeuralNetworkModel(multiLayerPerceptron, targetVariable, allowedInputVariables, problemDataClone.ClassValues.ToArray()));
     222      return new NeuralNetworkClassificationSolution(new NeuralNetworkModel(multiLayerPerceptron, targetVariable, allowedInputVariables, problemDataClone.ClassValues.ToArray()), problemDataClone);
    223223    }
    224224    #endregion
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassificationSolution.cs

    r12009 r14027  
    4343      : base(original, cloner) {
    4444    }
    45     public NeuralNetworkClassificationSolution(IClassificationProblemData problemData, INeuralNetworkModel nnModel)
     45    public NeuralNetworkClassificationSolution(INeuralNetworkModel nnModel, IClassificationProblemData problemData)
    4646      : base(nnModel, problemData) {
    4747    }
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleClassification.cs

    r13297 r14027  
    204204      relClassError = alglib.mlperelclserror(mlpEnsemble, inputMatrix, nRows);
    205205      var problemDataClone = (IClassificationProblemData)problemData.Clone();
    206       return new NeuralNetworkEnsembleClassificationSolution(problemDataClone, new NeuralNetworkEnsembleModel(mlpEnsemble, targetVariable, allowedInputVariables, problemDataClone.ClassValues.ToArray()));
     206      return new NeuralNetworkEnsembleClassificationSolution(new NeuralNetworkEnsembleModel(mlpEnsemble, targetVariable, allowedInputVariables, problemDataClone.ClassValues.ToArray()), problemDataClone);
    207207    }
    208208    #endregion
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleClassificationSolution.cs

    r12009 r14027  
    4343      : base(original, cloner) {
    4444    }
    45     public NeuralNetworkEnsembleClassificationSolution(IClassificationProblemData problemData, INeuralNetworkEnsembleModel nnModel)
     45    public NeuralNetworkEnsembleClassificationSolution(INeuralNetworkEnsembleModel nnModel, IClassificationProblemData problemData)
    4646      : base(nnModel, problemData) {
    4747    }
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleModel.cs

    r12702 r14027  
    3434  [StorableClass]
    3535  [Item("NeuralNetworkEnsembleModel", "Represents a neural network ensemble for regression and classification.")]
    36   public sealed class NeuralNetworkEnsembleModel : NamedItem, INeuralNetworkEnsembleModel {
     36  public sealed class NeuralNetworkEnsembleModel : ClassificationModel, INeuralNetworkEnsembleModel {
    3737
    3838    private alglib.mlpensemble mlpEnsemble;
     
    4646        }
    4747      }
     48    }
     49
     50    public override IEnumerable<string> VariablesUsedForPrediction {
     51      get { return allowedInputVariables; }
    4852    }
    4953
     
    7276    }
    7377    public NeuralNetworkEnsembleModel(alglib.mlpensemble mlpEnsemble, string targetVariable, IEnumerable<string> allowedInputVariables, double[] classValues = null)
    74       : base() {
     78      : base(targetVariable) {
    7579      this.name = ItemName;
    7680      this.description = ItemDescription;
     
    103107    }
    104108
    105     public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
     109    public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
    106110      double[,] inputData = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables, rows);
    107111
     
    129133    }
    130134
    131     public INeuralNetworkEnsembleRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
    132       return new NeuralNetworkEnsembleRegressionSolution(new RegressionEnsembleProblemData(problemData), this);
    133     }
    134     IRegressionSolution IRegressionModel.CreateRegressionSolution(IRegressionProblemData problemData) {
    135       return CreateRegressionSolution(problemData);
    136     }
    137     public INeuralNetworkEnsembleClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
    138       return new NeuralNetworkEnsembleClassificationSolution(new ClassificationEnsembleProblemData(problemData), this);
    139     }
    140     IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) {
    141       return CreateClassificationSolution(problemData);
     135    public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
     136      return new NeuralNetworkEnsembleRegressionSolution(this, new RegressionEnsembleProblemData(problemData));
     137    }
     138    public override IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
     139      return new NeuralNetworkEnsembleClassificationSolution(this, new ClassificationEnsembleProblemData(problemData));
    142140    }
    143141
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleRegression.cs

    r13297 r14027  
    190190      avgRelError = alglib.mlpeavgrelerror(mlpEnsemble, inputMatrix, nRows);
    191191
    192       return new NeuralNetworkEnsembleRegressionSolution((IRegressionProblemData)problemData.Clone(), new NeuralNetworkEnsembleModel(mlpEnsemble, targetVariable, allowedInputVariables));
     192      return new NeuralNetworkEnsembleRegressionSolution(new NeuralNetworkEnsembleModel(mlpEnsemble, targetVariable, allowedInputVariables), (IRegressionProblemData)problemData.Clone());
    193193    }
    194194    #endregion
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleRegressionSolution.cs

    r12009 r14027  
    4343      : base(original, cloner) {
    4444    }
    45     public NeuralNetworkEnsembleRegressionSolution(IRegressionProblemData problemData, INeuralNetworkEnsembleModel nnModel)
     45    public NeuralNetworkEnsembleRegressionSolution(INeuralNetworkEnsembleModel nnModel, IRegressionProblemData problemData)
    4646      : base(nnModel, problemData) {
    4747      RecalculateResults();
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkModel.cs

    r12702 r14027  
    3434  [StorableClass]
    3535  [Item("NeuralNetworkModel", "Represents a neural network for regression and classification.")]
    36   public sealed class NeuralNetworkModel : NamedItem, INeuralNetworkModel {
     36  public sealed class NeuralNetworkModel : ClassificationModel, INeuralNetworkModel {
    3737
    3838    private alglib.multilayerperceptron multiLayerPerceptron;
     
    4848    }
    4949
    50     [Storable]
    51     private string targetVariable;
     50    public override IEnumerable<string> VariablesUsedForPrediction {
     51      get { return allowedInputVariables; }
     52    }
     53
    5254    [Storable]
    5355    private string[] allowedInputVariables;
     
    7476      multiLayerPerceptron.innerobj.x = (double[])original.multiLayerPerceptron.innerobj.x.Clone();
    7577      multiLayerPerceptron.innerobj.y = (double[])original.multiLayerPerceptron.innerobj.y.Clone();
    76       targetVariable = original.targetVariable;
    7778      allowedInputVariables = (string[])original.allowedInputVariables.Clone();
    7879      if (original.classValues != null)
     
    8081    }
    8182    public NeuralNetworkModel(alglib.multilayerperceptron multiLayerPerceptron, string targetVariable, IEnumerable<string> allowedInputVariables, double[] classValues = null)
    82       : base() {
     83      : base(targetVariable) {
    8384      this.name = ItemName;
    8485      this.description = ItemDescription;
    8586      this.multiLayerPerceptron = multiLayerPerceptron;
    86       this.targetVariable = targetVariable;
    8787      this.allowedInputVariables = allowedInputVariables.ToArray();
    8888      if (classValues != null)
     
    111111    }
    112112
    113     public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
     113    public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
    114114      double[,] inputData = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables, rows);
    115115
     
    137137    }
    138138
    139     public INeuralNetworkRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
    140       return new NeuralNetworkRegressionSolution(new RegressionProblemData(problemData), this);
    141     }
    142     IRegressionSolution IRegressionModel.CreateRegressionSolution(IRegressionProblemData problemData) {
    143       return CreateRegressionSolution(problemData);
    144     }
    145     public INeuralNetworkClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
    146       return new NeuralNetworkClassificationSolution(new ClassificationProblemData(problemData), this);
    147     }
    148     IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) {
    149       return CreateClassificationSolution(problemData);
     139    public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
     140      return new NeuralNetworkRegressionSolution(this, new RegressionProblemData(problemData));
     141    }
     142    public override IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
     143      return new NeuralNetworkClassificationSolution(this, new ClassificationProblemData(problemData));
    150144    }
    151145
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegression.cs

    r13297 r14027  
    207207      avgRelError = alglib.mlpavgrelerror(multiLayerPerceptron, inputMatrix, nRows);
    208208
    209       return new NeuralNetworkRegressionSolution((IRegressionProblemData)problemData.Clone(), new NeuralNetworkModel(multiLayerPerceptron, targetVariable, allowedInputVariables));
     209      return new NeuralNetworkRegressionSolution(new NeuralNetworkModel(multiLayerPerceptron, targetVariable, allowedInputVariables), (IRegressionProblemData)problemData.Clone());
    210210    }
    211211    #endregion
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegressionSolution.cs

    r12009 r14027  
    4343      : base(original, cloner) {
    4444    }
    45     public NeuralNetworkRegressionSolution(IRegressionProblemData problemData, INeuralNetworkModel nnModel)
     45    public NeuralNetworkRegressionSolution(INeuralNetworkModel nnModel, IRegressionProblemData problemData)
    4646      : base(nnModel, problemData) {
    4747    }
Note: See TracChangeset for help on using the changeset viewer.