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:
7 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Algorithms.DataAnalysis

  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs

    r12708 r14027  
    111111      IClassificationProblemData problemData,
    112112      IEnumerable<int> rows) {
    113       var model = new SymbolicDiscriminantFunctionClassificationModel(tree, interpreter, new AccuracyMaximizationThresholdCalculator());
     113      var model = new SymbolicDiscriminantFunctionClassificationModel(problemData.TargetVariable, tree, interpreter, new AccuracyMaximizationThresholdCalculator());
    114114      model.RecalculateModelParameters(problemData, rows);
    115115      return model;
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs

    r13297 r14027  
    110110      addition.AddSubtree(cNode);
    111111
    112       SymbolicRegressionSolution solution = new SymbolicRegressionSolution(new SymbolicRegressionModel(tree, new SymbolicDataAnalysisExpressionTreeInterpreter()), (IRegressionProblemData)problemData.Clone());
     112      SymbolicRegressionSolution solution = new SymbolicRegressionSolution(new SymbolicRegressionModel(problemData.TargetVariable, tree, new SymbolicDataAnalysisExpressionTreeInterpreter()), (IRegressionProblemData)problemData.Clone());
    113113      solution.Model.Name = "Linear Regression Model";
    114114      solution.Name = "Linear Regression Solution";
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassification.cs

    r13297 r14027  
    9595      relClassError = alglib.mnlrelclserror(lm, inputMatrix, nRows);
    9696
    97       MultinomialLogitClassificationSolution solution = new MultinomialLogitClassificationSolution((IClassificationProblemData)problemData.Clone(), new MultinomialLogitModel(lm, targetVariable, allowedInputVariables, classValues));
     97      MultinomialLogitClassificationSolution solution = new MultinomialLogitClassificationSolution(new MultinomialLogitModel(lm, targetVariable, allowedInputVariables, classValues), (IClassificationProblemData)problemData.Clone());
    9898      return solution;
    9999    }
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassificationSolution.cs

    r12009 r14027  
    4343      : base(original, cloner) {
    4444    }
    45     public MultinomialLogitClassificationSolution(IClassificationProblemData problemData, MultinomialLogitModel logitModel)
     45    public MultinomialLogitClassificationSolution( MultinomialLogitModel logitModel,IClassificationProblemData problemData)
    4646      : base(logitModel, problemData) {
    4747    }
  • stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitModel.cs

    r12702 r14027  
    3434  [StorableClass]
    3535  [Item("Multinomial Logit Model", "Represents a multinomial logit model for classification.")]
    36   public sealed class MultinomialLogitModel : NamedItem, IClassificationModel {
     36  public sealed class MultinomialLogitModel : ClassificationModel {
    3737
    3838    private alglib.logitmodel logitModel;
     
    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;
     
    6466      logitModel = new alglib.logitmodel();
    6567      logitModel.innerobj.w = (double[])original.logitModel.innerobj.w.Clone();
    66       targetVariable = original.targetVariable;
    6768      allowedInputVariables = (string[])original.allowedInputVariables.Clone();
    6869      classValues = (double[])original.classValues.Clone();
    6970    }
    7071    public MultinomialLogitModel(alglib.logitmodel logitModel, string targetVariable, IEnumerable<string> allowedInputVariables, double[] classValues)
    71       : base() {
     72      : base(targetVariable) {
    7273      this.name = ItemName;
    7374      this.description = ItemDescription;
    7475      this.logitModel = logitModel;
    75       this.targetVariable = targetVariable;
    7676      this.allowedInputVariables = allowedInputVariables.ToArray();
    7777      this.classValues = (double[])classValues.Clone();
     
    8282    }
    8383
    84     public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
     84    public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
    8585      double[,] inputData = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables, rows);
    8686
     
    108108    }
    109109
    110     public MultinomialLogitClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
    111       return new MultinomialLogitClassificationSolution(new ClassificationProblemData(problemData), this);
    112     }
    113     IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) {
    114       return CreateClassificationSolution(problemData);
     110    public override IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {
     111      return new MultinomialLogitClassificationSolution(this, new ClassificationProblemData(problemData));
    115112    }
    116113
     
    135132    }
    136133    #endregion
     134
    137135  }
    138136}
Note: See TracChangeset for help on using the changeset viewer.