- Timestamp:
- 07/27/11 16:30:49 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitModel.cs
r6576 r6604 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.IO;25 24 using System.Linq; 26 using System.Text;27 25 using HeuristicLab.Common; 28 26 using HeuristicLab.Core; 29 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 28 using HeuristicLab.Problems.DataAnalysis; 31 using SVM;32 29 33 30 namespace HeuristicLab.Algorithms.DataAnalysis { … … 111 108 } 112 109 110 public MultinomialLogitClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 111 return new MultinomialLogitClassificationSolution(problemData, this); 112 } 113 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { 114 return CreateClassificationSolution(problemData); 115 } 116 113 117 #region events 114 118 public event EventHandler Changed; -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs
r6603 r6604 183 183 return CreateRegressionSolution(problemData); 184 184 } 185 public INearestNeighbourClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 186 return new NearestNeighbourClassificationSolution(problemData, this); 187 } 188 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { 189 return CreateClassificationSolution(problemData); 190 } 185 191 186 192 #region events -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleModel.cs
r6603 r6604 150 150 return CreateRegressionSolution(problemData); 151 151 } 152 public INeuralNetworkEnsembleClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 153 return new NeuralNetworkEnsembleClassificationSolution(problemData, this); 154 } 155 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { 156 return CreateClassificationSolution(problemData); 157 } 152 158 153 159 #region events -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkModel.cs
r6603 r6604 143 143 return CreateRegressionSolution(problemData); 144 144 } 145 public INeuralNetworkClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 146 return new NeuralNetworkClassificationSolution(problemData, this); 147 } 148 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { 149 return CreateClassificationSolution(problemData); 150 } 145 151 146 152 #region events -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs
r6603 r6604 137 137 return CreateRegressionSolution(problemData); 138 138 } 139 public IRandomForestClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 140 return new RandomForestClassificationSolution(problemData, this); 141 } 142 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { 143 return CreateClassificationSolution(problemData); 144 } 139 145 140 146 #region events -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineModel.cs
r6603 r6604 154 154 } 155 155 } 156 157 public SupportVectorClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 158 return new SupportVectorClassificationSolution(this, problemData); 159 } 160 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { 161 return CreateClassificationSolution(problemData); 162 } 156 163 #endregion 157 164 // cache for predictions, which is cloned but not persisted, must be cleared when the model is changed -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationModel.cs
r5809 r6604 21 21 22 22 using System.Collections.Generic; 23 using System.Linq;24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Core; 26 using HeuristicLab.Data;27 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 28 using HeuristicLab.Operators;29 using HeuristicLab.Parameters;30 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.Optimization;32 using System;33 27 34 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification { … … 55 49 return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows); 56 50 } 51 52 public ISymbolicClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 53 return new SymbolicClassificationSolution(this, problemData); 54 } 55 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { 56 return CreateClassificationSolution(problemData); 57 } 58 59 57 60 } 58 61 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicDiscriminantFunctionClassificationModel.cs
r6234 r6604 104 104 } 105 105 106 public SymbolicDiscriminantFunctionClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 107 return new SymbolicDiscriminantFunctionClassificationSolution(this, problemData); 108 } 109 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { 110 return CreateClassificationSolution(problemData); 111 } 112 IDiscriminantFunctionClassificationSolution IDiscriminantFunctionClassificationModel.CreateDiscriminantFunctionClassificationSolution(IClassificationProblemData problemData) { 113 return CreateClassificationSolution(problemData); 114 } 115 106 116 #region events 107 117 public event EventHandler ThresholdsChanged; -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleModel.cs
r6520 r6604 89 89 } 90 90 91 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { 92 return new ClassificationEnsembleSolution(models, problemData); 93 } 91 94 #endregion 92 95 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationModel.cs
r5809 r6604 33 33 [StorableClass] 34 34 [Item("DiscriminantFunctionClassificationModel", "Represents a classification model that uses a discriminant function and classification thresholds.")] 35 public class DiscriminantFunctionClassificationModel : NamedItem, IDiscriminantFunctionClassificationModel {35 public abstract class DiscriminantFunctionClassificationModel : NamedItem, IDiscriminantFunctionClassificationModel { 36 36 [Storable] 37 37 private IRegressionModel model; … … 70 70 } 71 71 72 public override IDeepCloneable Clone(Cloner cloner) {73 return new DiscriminantFunctionClassificationModel(this, cloner);74 }75 76 72 public void SetThresholdsAndClassValues(IEnumerable<double> thresholds, IEnumerable<double> classValues) { 77 73 var classValuesArr = classValues.ToArray(); … … 106 102 } 107 103 #endregion 104 105 public abstract IDiscriminantFunctionClassificationSolution CreateDiscriminantFunctionClassificationSolution(IClassificationProblemData problemData); 106 public abstract IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData); 108 107 } 109 108 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationSolution.cs
r6589 r6604 39 39 : base(original, cloner) { 40 40 } 41 protected DiscriminantFunctionClassificationSolution(IRegressionModel model, IClassificationProblemData problemData)42 : this(new DiscriminantFunctionClassificationModel(model), problemData) {43 }44 41 protected DiscriminantFunctionClassificationSolution(IDiscriminantFunctionClassificationModel model, IClassificationProblemData problemData) 45 42 : base(model, problemData) { -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationSolutionBase.cs
r6589 r6604 78 78 : base(original, cloner) { 79 79 RegisterEventHandler(); 80 }81 protected DiscriminantFunctionClassificationSolutionBase(IRegressionModel model, IClassificationProblemData problemData)82 : this(new DiscriminantFunctionClassificationModel(model), problemData) {83 80 } 84 81 protected DiscriminantFunctionClassificationSolutionBase(IDiscriminantFunctionClassificationModel model, IClassificationProblemData problemData) -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationModel.cs
r5809 r6604 24 24 public interface IClassificationModel : IDataAnalysisModel { 25 25 IEnumerable<double> GetEstimatedClassValues(Dataset dataset, IEnumerable<int> rows); 26 IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData); 26 27 } 27 28 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IDiscriminantFunctionClassificationModel.cs
r5809 r6604 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 using System;24 24 namespace HeuristicLab.Problems.DataAnalysis { 25 25 public interface IDiscriminantFunctionClassificationModel : IClassificationModel { … … 27 27 IEnumerable<double> ClassValues { get; } 28 28 // class values and thresholds can only be assigned simultaniously 29 void SetThresholdsAndClassValues(IEnumerable<double> thresholds, IEnumerable<double> classValues); 29 void SetThresholdsAndClassValues(IEnumerable<double> thresholds, IEnumerable<double> classValues); 30 30 IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows); 31 31 32 32 event EventHandler ThresholdsChanged; 33 34 IDiscriminantFunctionClassificationSolution CreateDiscriminantFunctionClassificationSolution(IClassificationProblemData problemData); 33 35 } 34 36 }
Note: See TracChangeset
for help on using the changeset viewer.