Changeset 13921 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis
- Timestamp:
- 06/19/16 19:56:11 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/BaselineClassifiers/OneRClassificationModel.cs
r13098 r13921 32 32 [Item("OneR Classification Model", "A model that uses intervals for one variable to determine the class.")] 33 33 public class OneRClassificationModel : NamedItem, IClassificationModel { 34 public IEnumerable<string> VariablesUsedForPrediction { 35 get { return Enumerable.Empty<string>(); } 36 } 37 38 public string TargetVariable { 39 get { return variable; } 40 } 41 34 42 [Storable] 35 43 protected string variable; -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs
r13784 r13921 35 35 [Item("GaussianProcessModel", "Represents a Gaussian process posterior.")] 36 36 public sealed class GaussianProcessModel : NamedItem, IGaussianProcessModel { 37 public IEnumerable<string> VariablesUsedForPrediction { get; } 38 37 39 [Storable] 38 40 private double negativeLogLikelihood; … … 392 394 } 393 395 } 396 394 397 } 395 398 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/StudentTProcessModel.cs
r13784 r13921 35 35 [Item("StudentTProcessModel", "Represents a Student-t process posterior.")] 36 36 public sealed class StudentTProcessModel : NamedItem, IGaussianProcessModel { 37 public IEnumerable<string> VariablesUsedForPrediction { 38 get { return allowedInputVariables; } 39 } 40 37 41 [Storable] 38 42 private double negativeLogLikelihood; -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModel.cs
r13157 r13921 58 58 #endregion 59 59 60 public string TargetVariable { 61 get { return models.First().TargetVariable; } 62 } 63 64 public IEnumerable<string> VariablesUsedForPrediction { 65 get { return models.SelectMany(x => x.VariablesUsedForPrediction).Distinct().OrderBy(x => x); } 66 } 67 60 68 private readonly IList<IRegressionModel> models; 61 69 public IEnumerable<IRegressionModel> Models { get { return models; } } … … 108 116 return new RegressionSolution(this, (IRegressionProblemData)problemData.Clone()); 109 117 } 118 110 119 } 111 120 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesModelSurrogate.cs
r13157 r13921 22 22 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 54 55 private int maxSize; 55 56 57 public string TargetVariable { 58 get { return trainingProblemData.TargetVariable; } 59 } 60 61 public IEnumerable<string> VariablesUsedForPrediction { 62 get { return actualModel.Models.SelectMany(x => x.VariablesUsedForPrediction).Distinct().OrderBy(x => x); } 63 } 56 64 57 65 [StorableConstructor] … … 73 81 74 82 // create only the surrogate model without an actual model 75 public GradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed, ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu) 83 public GradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed, 84 ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu) 76 85 : base("Gradient boosted tree model", string.Empty) { 77 86 this.trainingProblemData = trainingProblemData; … … 86 95 87 96 // wrap an actual model in a surrograte 88 public GradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed, ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu, IGradientBoostedTreesModel model) 97 public GradientBoostedTreesModelSurrogate(IRegressionProblemData trainingProblemData, uint seed, 98 ILossFunction lossFunction, int iterations, int maxSize, double r, double m, double nu, 99 IGradientBoostedTreesModel model) 89 100 : this(trainingProblemData, seed, lossFunction, iterations, maxSize, r, m, nu) { 90 101 this.actualModel = model; … … 104 115 return new RegressionSolution(this, (IRegressionProblemData)problemData.Clone()); 105 116 } 106 107 117 108 118 private IGradientBoostedTreesModel RecalculateModel() { -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeModel.cs
r13895 r13921 35 35 [Item("RegressionTreeModel", "Represents a decision tree for regression.")] 36 36 public sealed class RegressionTreeModel : NamedItem, IRegressionModel { 37 public IEnumerable<string> VariablesUsedForPrediction { 38 get { return Enumerable.Empty<string>(); } 39 } 40 41 public string TargetVariable { 42 get { return string.Empty; } 43 } 37 44 38 45 // trees are represented as a flat array -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitModel.cs
r12509 r13921 46 46 } 47 47 } 48 } 49 50 public IEnumerable<string> VariablesUsedForPrediction { 51 get { return allowedInputVariables; } 52 } 53 54 public string TargetVariable { 55 get { return targetVariable; } 48 56 } 49 57 … … 111 119 return new MultinomialLogitClassificationSolution(new ClassificationProblemData(problemData), this); 112 120 } 121 122 123 113 124 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) { 114 125 return CreateClassificationSolution(problemData); … … 135 146 } 136 147 #endregion 148 137 149 } 138 150 } -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Nca/NcaModel.cs
r12509 r13921 31 31 [StorableClass] 32 32 public class NcaModel : NamedItem, INcaModel { 33 public IEnumerable<string> VariablesUsedForPrediction { 34 get { return allowedInputVariables; } 35 } 36 37 public string TargetVariable { 38 get { return targetVariable; } 39 } 33 40 34 41 [Storable] -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs
r12509 r13921 46 46 } 47 47 } 48 } 49 50 public IEnumerable<string> VariablesUsedForPrediction { 51 get { return allowedInputVariables; } 52 } 53 54 public string TargetVariable { 55 get { return targetVariable; } 48 56 } 49 57 -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleModel.cs
r12509 r13921 46 46 } 47 47 } 48 } 49 50 public string TargetVariable { 51 get { return targetVariable; } 52 } 53 54 public IEnumerable<string> VariablesUsedForPrediction { 55 get { return allowedInputVariables; } 48 56 } 49 57 -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkModel.cs
r12817 r13921 46 46 } 47 47 } 48 } 49 50 public IEnumerable<string> VariablesUsedForPrediction { 51 get { return allowedInputVariables; } 52 } 53 54 public string TargetVariable { 55 get { return targetVariable; } 48 56 } 49 57 -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs
r12509 r13921 45 45 } 46 46 47 public IEnumerable<string> VariablesUsedForPrediction { 48 get { return originalTrainingData.AllowedInputVariables; } 49 } 50 51 public string TargetVariable { 52 get { 53 var regressionProblemData = originalTrainingData as IRegressionProblemData; 54 var classificationProblemData = originalTrainingData as IClassificationProblemData; 55 if (classificationProblemData != null) 56 return classificationProblemData.TargetVariable; 57 if (regressionProblemData != null) 58 return regressionProblemData.TargetVariable; 59 throw new InvalidOperationException("Getting the target variable requires either a regression or a classification problem data."); 60 } 61 } 62 47 63 // instead of storing the data of the model itself 48 64 // we instead only store data necessary to recalculate the same model lazily on demand -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/SupportVectorMachine/SupportVectorMachineModel.cs
r12509 r13921 38 38 [Item("SupportVectorMachineModel", "Represents a support vector machine model.")] 39 39 public sealed class SupportVectorMachineModel : NamedItem, ISupportVectorMachineModel { 40 public IEnumerable<string> VariablesUsedForPrediction { 41 get { return allowedInputVariables; } 42 } 43 44 public string TargetVariable { 45 get { return targetVariable; } 46 } 40 47 41 48 private svm_model model; -
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClusteringModel.cs
r12509 r13921 37 37 public static new Image StaticItemImage { 38 38 get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; } 39 } 40 41 public IEnumerable<string> VariablesUsedForPrediction { 42 get { return allowedInputVariables; } 39 43 } 40 44
Note: See TracChangeset
for help on using the changeset viewer.