Changeset 14027 for stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear
- Timestamp:
- 07/08/16 14:37:15 (8 years ago)
- Location:
- stable
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 13826,13921-13922,13941,13992-13993,14000
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Algorithms.DataAnalysis merged: 13921-13922,13941,13992-13993,14000
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs
r12708 r14027 111 111 IClassificationProblemData problemData, 112 112 IEnumerable<int> rows) { 113 var model = new SymbolicDiscriminantFunctionClassificationModel( tree, interpreter, new AccuracyMaximizationThresholdCalculator());113 var model = new SymbolicDiscriminantFunctionClassificationModel(problemData.TargetVariable, tree, interpreter, new AccuracyMaximizationThresholdCalculator()); 114 114 model.RecalculateModelParameters(problemData, rows); 115 115 return model; -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs
r13297 r14027 110 110 addition.AddSubtree(cNode); 111 111 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()); 113 113 solution.Model.Name = "Linear Regression Model"; 114 114 solution.Name = "Linear Regression Solution"; -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassification.cs
r13297 r14027 95 95 relClassError = alglib.mnlrelclserror(lm, inputMatrix, nRows); 96 96 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()); 98 98 return solution; 99 99 } -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassificationSolution.cs
r12009 r14027 43 43 : base(original, cloner) { 44 44 } 45 public MultinomialLogitClassificationSolution( IClassificationProblemData problemData, MultinomialLogitModel logitModel)45 public MultinomialLogitClassificationSolution( MultinomialLogitModel logitModel,IClassificationProblemData problemData) 46 46 : base(logitModel, problemData) { 47 47 } -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitModel.cs
r12702 r14027 34 34 [StorableClass] 35 35 [Item("Multinomial Logit Model", "Represents a multinomial logit model for classification.")] 36 public sealed class MultinomialLogitModel : NamedItem, IClassificationModel {36 public sealed class MultinomialLogitModel : ClassificationModel { 37 37 38 38 private alglib.logitmodel logitModel; … … 48 48 } 49 49 50 [Storable] 51 private string targetVariable; 50 public override IEnumerable<string> VariablesUsedForPrediction { 51 get { return allowedInputVariables; } 52 } 53 52 54 [Storable] 53 55 private string[] allowedInputVariables; … … 64 66 logitModel = new alglib.logitmodel(); 65 67 logitModel.innerobj.w = (double[])original.logitModel.innerobj.w.Clone(); 66 targetVariable = original.targetVariable;67 68 allowedInputVariables = (string[])original.allowedInputVariables.Clone(); 68 69 classValues = (double[])original.classValues.Clone(); 69 70 } 70 71 public MultinomialLogitModel(alglib.logitmodel logitModel, string targetVariable, IEnumerable<string> allowedInputVariables, double[] classValues) 71 : base( ) {72 : base(targetVariable) { 72 73 this.name = ItemName; 73 74 this.description = ItemDescription; 74 75 this.logitModel = logitModel; 75 this.targetVariable = targetVariable;76 76 this.allowedInputVariables = allowedInputVariables.ToArray(); 77 77 this.classValues = (double[])classValues.Clone(); … … 82 82 } 83 83 84 public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {84 public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 85 85 double[,] inputData = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables, rows); 86 86 … … 108 108 } 109 109 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)); 115 112 } 116 113 … … 135 132 } 136 133 #endregion 134 137 135 } 138 136 }
Note: See TracChangeset
for help on using the changeset viewer.