Changeset 14029 for branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation
- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 21 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleModel.cs
r12509 r14029 32 32 [StorableClass] 33 33 [Item("ClassificationEnsembleModel", "A classification model that contains an ensemble of multiple classification models")] 34 public class ClassificationEnsembleModel : NamedItem, IClassificationEnsembleModel { 34 public class ClassificationEnsembleModel : ClassificationModel, IClassificationEnsembleModel { 35 public override IEnumerable<string> VariablesUsedForPrediction { 36 get { return models.SelectMany(x => x.VariablesUsedForPrediction).Distinct().OrderBy(x => x); } 37 } 35 38 36 39 [Storable] … … 49 52 public ClassificationEnsembleModel() : this(Enumerable.Empty<IClassificationModel>()) { } 50 53 public ClassificationEnsembleModel(IEnumerable<IClassificationModel> models) 51 : base( ) {54 : base(string.Empty) { 52 55 this.name = ItemName; 53 56 this.description = ItemDescription; 54 57 this.models = new List<IClassificationModel>(models); 58 59 if (this.models.Any()) this.TargetVariable = this.models.First().TargetVariable; 55 60 } 56 61 … … 59 64 } 60 65 61 #region IClassificationEnsembleModel Members62 66 public void Add(IClassificationModel model) { 67 if (string.IsNullOrEmpty(TargetVariable)) TargetVariable = model.TargetVariable; 63 68 models.Add(model); 64 69 } 65 70 public void Remove(IClassificationModel model) { 66 71 models.Remove(model); 72 if (!models.Any()) TargetVariable = string.Empty; 67 73 } 68 74 … … 78 84 } 79 85 80 #endregion81 86 82 #region IClassificationModel Members 83 84 public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 87 public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 85 88 foreach (var estimatedValuesVector in GetEstimatedClassValueVectors(dataset, rows)) { 86 89 // return the class which is most often occuring … … 94 97 } 95 98 96 IClassificationSolution IClassificationModel.CreateClassificationSolution(IClassificationProblemData problemData) {99 public override IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 97 100 return new ClassificationEnsembleSolution(models, new ClassificationEnsembleProblemData(problemData)); 98 101 } 99 #endregion 102 103 100 104 } 101 105 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationPerformanceMeasures.cs
r12012 r14029 37 37 protected const string TrainingFalsePositiveRateResultName = "False positive rate (training)"; 38 38 protected const string TrainingFalseDiscoveryRateResultName = "False discovery rate (training)"; 39 protected const string TrainingF1ScoreResultName = "F1 score (training)"; 40 protected const string TrainingMatthewsCorrelationResultName = "Matthews Correlation (training)"; 39 41 protected const string TestTruePositiveRateResultName = "True positive rate (test)"; 40 42 protected const string TestTrueNegativeRateResultName = "True negative rate (test)"; … … 43 45 protected const string TestFalsePositiveRateResultName = "False positive rate (test)"; 44 46 protected const string TestFalseDiscoveryRateResultName = "False discovery rate (test)"; 47 protected const string TestF1ScoreResultName = "F1 score (test)"; 48 protected const string TestMatthewsCorrelationResultName = "Matthews Correlation (test)"; 45 49 #endregion 46 50 … … 89 93 set { ((DoubleValue)this[TrainingFalseDiscoveryRateResultName].Value).Value = value; } 90 94 } 95 public double TrainingF1Score { 96 get { return ((DoubleValue)this[TrainingF1ScoreResultName].Value).Value; } 97 set { ((DoubleValue)this[TrainingF1ScoreResultName].Value).Value = value; } 98 } 99 public double TrainingMatthewsCorrelation { 100 get { return ((DoubleValue)this[TrainingMatthewsCorrelationResultName].Value).Value; } 101 set { ((DoubleValue)this[TrainingMatthewsCorrelationResultName].Value).Value = value; } 102 } 91 103 public double TestTruePositiveRate { 92 104 get { return ((DoubleValue)this[TestTruePositiveRateResultName].Value).Value; } … … 112 124 get { return ((DoubleValue)this[TestFalseDiscoveryRateResultName].Value).Value; } 113 125 set { ((DoubleValue)this[TestFalseDiscoveryRateResultName].Value).Value = value; } 126 } 127 public double TestF1Score { 128 get { return ((DoubleValue)this[TestF1ScoreResultName].Value).Value; } 129 set { ((DoubleValue)this[TestF1ScoreResultName].Value).Value = value; } 130 } 131 public double TestMatthewsCorrelation { 132 get { return ((DoubleValue)this[TestMatthewsCorrelationResultName].Value).Value; } 133 set { ((DoubleValue)this[TestMatthewsCorrelationResultName].Value).Value = value; } 114 134 } 115 135 #endregion … … 123 143 Add(new Result(TrainingFalsePositiveRateResultName, "The false positive rate is the complement of the true negative rate of the model on the training partition.", new PercentValue())); 124 144 Add(new Result(TrainingFalseDiscoveryRateResultName, "The false discovery rate is the complement of the positive predictive value of the model on the training partition.", new PercentValue())); 145 Add(new Result(TrainingF1ScoreResultName, "The F1 score of the model on the training partition.", new DoubleValue())); 146 Add(new Result(TrainingMatthewsCorrelationResultName, "The Matthews correlation value of the model on the training partition.", new DoubleValue())); 125 147 Add(new Result(TestTruePositiveRateResultName, "Sensitivity/True positive rate of the model on the test partition\n(TP/(TP+FN)).", new PercentValue())); 126 148 Add(new Result(TestTrueNegativeRateResultName, "Specificity/True negative rate of the model on the test partition\n(TN/(FP+TN)).", new PercentValue())); … … 129 151 Add(new Result(TestFalsePositiveRateResultName, "The false positive rate is the complement of the true negative rate of the model on the test partition.", new PercentValue())); 130 152 Add(new Result(TestFalseDiscoveryRateResultName, "The false discovery rate is the complement of the positive predictive value of the model on the test partition.", new PercentValue())); 153 Add(new Result(TestF1ScoreResultName, "The F1 score of the model on the test partition.", new DoubleValue())); 154 Add(new Result(TestMatthewsCorrelationResultName, "The Matthews correlation value of the model on the test partition.", new DoubleValue())); 155 156 Reset(); 157 } 158 159 160 public void Reset() { 131 161 TrainingTruePositiveRate = double.NaN; 132 162 TrainingTrueNegativeRate = double.NaN; … … 135 165 TrainingFalsePositiveRate = double.NaN; 136 166 TrainingFalseDiscoveryRate = double.NaN; 167 TrainingF1Score = double.NaN; 168 TrainingMatthewsCorrelation = double.NaN; 137 169 TestTruePositiveRate = double.NaN; 138 170 TestTrueNegativeRate = double.NaN; … … 141 173 TestFalsePositiveRate = double.NaN; 142 174 TestFalseDiscoveryRate = double.NaN; 175 TestF1Score = double.NaN; 176 TestMatthewsCorrelation = double.NaN; 143 177 } 144 178 -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs
r12504 r14029 35 35 public override IDeepCloneable Clone(Cloner cloner) { return new ClassificationProblem(this, cloner); } 36 36 37 public ClassificationProblem() 38 : base() { 39 ProblemData = new ClassificationProblemData(); 40 } 37 public ClassificationProblem() : base(new ClassificationProblemData()) { } 41 38 } 42 39 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
r12509 r14029 283 283 private void AfterDeserialization() { 284 284 RegisterParameterEvents(); 285 286 classNamesCache = new List<string>(); 287 for (int i = 0; i < ClassNamesParameter.Value.Rows; i++) 288 classNamesCache.Add(ClassNamesParameter.Value[i, 0]); 289 285 290 // BackwardsCompatibility3.4 286 291 #region Backwards compatible code, remove with 3.5 … … 297 302 : base(original, cloner) { 298 303 RegisterParameterEvents(); 304 classNamesCache = new List<string>(); 305 for (int i = 0; i < ClassNamesParameter.Value.Rows; i++) 306 classNamesCache.Add(ClassNamesParameter.Value[i, 0]); 299 307 } 300 308 public override IDeepCloneable Clone(Cloner cloner) { -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationSolutionBase.cs
r12012 r14029 26 26 using HeuristicLab.Optimization; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Problems.DataAnalysis.OnlineCalculators; 28 29 29 30 namespace HeuristicLab.Problems.DataAnalysis { … … 128 129 TestNormalizedGiniCoefficient = testNormalizedGini; 129 130 131 ClassificationPerformanceMeasures.Reset(); 132 130 133 trainingPerformanceCalculator.Calculate(originalTrainingClassValues, estimatedTrainingClassValues); 131 134 if (trainingPerformanceCalculator.ErrorState == OnlineCalculatorError.None) … … 135 138 if (testPerformanceCalculator.ErrorState == OnlineCalculatorError.None) 136 139 ClassificationPerformanceMeasures.SetTestResults(testPerformanceCalculator); 140 141 if (ProblemData.Classes == 2) { 142 var f1Training = FOneScoreCalculator.Calculate(originalTrainingClassValues, estimatedTrainingClassValues, out errorState); 143 if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TrainingF1Score = f1Training; 144 var f1Test = FOneScoreCalculator.Calculate(originalTestClassValues, estimatedTestClassValues, out errorState); 145 if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TestF1Score = f1Test; 146 } 147 148 var mccTraining = MatthewsCorrelationCoefficientCalculator.Calculate(originalTrainingClassValues, estimatedTrainingClassValues, out errorState); 149 if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TrainingMatthewsCorrelation = mccTraining; 150 var mccTest = MatthewsCorrelationCoefficientCalculator.Calculate(originalTestClassValues, estimatedTestClassValues, out errorState); 151 if (errorState == OnlineCalculatorError.None) ClassificationPerformanceMeasures.TestMatthewsCorrelation = mccTest; 137 152 } 138 153 -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationModel.cs
r12509 r14029 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 class DiscriminantFunctionClassificationModel : ClassificationModel, IDiscriminantFunctionClassificationModel { 36 public override IEnumerable<string> VariablesUsedForPrediction { 37 get { return model.VariablesUsedForPrediction; } 38 } 39 36 40 [Storable] 37 41 private IRegressionModel model; … … 73 77 74 78 public DiscriminantFunctionClassificationModel(IRegressionModel model, IDiscriminantFunctionThresholdCalculator thresholdCalculator) 75 : base( ) {79 : base(model.TargetVariable) { 76 80 this.name = ItemName; 77 81 this.description = ItemDescription; 82 78 83 this.model = model; 79 84 this.classValues = new double[0]; … … 115 120 } 116 121 117 public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {122 public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 118 123 if (!Thresholds.Any() && !ClassValues.Any()) throw new ArgumentException("No thresholds and class values were set for the current classification model."); 119 124 foreach (var x in GetEstimatedValues(dataset, rows)) { … … 135 140 #endregion 136 141 137 public virtual IDiscriminantFunctionClassificationSolution CreateDiscriminantFunctionClassificationSolution(IClassificationProblemData problemData) { 142 public override IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) { 143 return CreateDiscriminantFunctionClassificationSolution(problemData); 144 } 145 public virtual IDiscriminantFunctionClassificationSolution CreateDiscriminantFunctionClassificationSolution( 146 IClassificationProblemData problemData) { 138 147 return new DiscriminantFunctionClassificationSolution(this, new ClassificationProblemData(problemData)); 139 }140 141 public virtual IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData) {142 return CreateDiscriminantFunctionClassificationSolution(problemData);143 148 } 144 149 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblem.cs
r12504 r14029 33 33 public override IDeepCloneable Clone(Cloner cloner) { return new ClusteringProblem(this, cloner); } 34 34 35 public ClusteringProblem() 36 : base() { 37 ProblemData = new ClusteringProblemData(); 38 } 35 public ClusteringProblem() : base(new ClusteringProblemData()) { } 39 36 } 40 37 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs
r12012 r14029 49 49 public T ProblemData { 50 50 get { return ProblemDataParameter.Value; } 51 protected set { 52 ProblemDataParameter.Value = value; 53 } 51 set { ProblemDataParameter.Value = value; } 54 52 } 55 53 #endregion … … 60 58 [StorableConstructor] 61 59 protected DataAnalysisProblem(bool deserializing) : base(deserializing) { } 62 public DataAnalysisProblem()63 : base() {64 Parameters.Add(new ValueParameter<T>(ProblemDataParameterName, ProblemDataParameterDescription));65 RegisterEventHandlers();66 }67 60 68 61 protected DataAnalysisProblem(T problemData) 69 : this() { 70 ProblemData = problemData; 62 : base() { 63 Parameters.Add(new ValueParameter<T>(ProblemDataParameterName, ProblemDataParameterDescription, problemData)); 64 RegisterEventHandlers(); 71 65 } 72 66 -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
r12509 r14029 80 80 } 81 81 82 public virtual IEnumerable<int> AllIndices { 83 get { return Enumerable.Range(0, Dataset.Rows); } 84 } 82 85 public virtual IEnumerable<int> TrainingIndices { 83 86 get { -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
r12509 r14029 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 26 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 29 … … 29 31 [StorableClass] 30 32 [Item("Constant Regression Model", "A model that always returns the same constant value regardless of the presented input data.")] 31 public class ConstantRegressionModel : NamedItem, IRegressionModel { 33 [Obsolete] 34 public class ConstantRegressionModel : RegressionModel, IStringConvertibleValue { 35 public override IEnumerable<string> VariablesUsedForPrediction { get { return Enumerable.Empty<string>(); } } 36 32 37 [Storable] 33 pr otecteddouble constant;38 private double constant; 34 39 public double Constant { 35 40 get { return constant; } 41 // setter not implemented because manipulation of the constant is not allowed 36 42 } 37 43 … … 42 48 this.constant = original.constant; 43 49 } 50 44 51 public override IDeepCloneable Clone(Cloner cloner) { return new ConstantRegressionModel(this, cloner); } 45 52 46 public ConstantRegressionModel(double constant )47 : base( ) {53 public ConstantRegressionModel(double constant, string targetVariable) 54 : base(targetVariable) { 48 55 this.name = ItemName; 49 56 this.description = ItemDescription; 50 57 this.constant = constant; 58 this.ReadOnly = true; // changing a constant regression model is not supported 51 59 } 52 60 53 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) {61 public override IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 54 62 return rows.Select(row => Constant); 55 63 } 56 64 57 public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {58 return new ConstantRegressionSolution( this, new RegressionProblemData(problemData));65 public override IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) { 66 return new ConstantRegressionSolution(new ConstantModel(constant, TargetVariable), new RegressionProblemData(problemData)); 59 67 } 68 69 public override string ToString() { 70 return string.Format("Constant: {0}", GetValue()); 71 } 72 73 #region IStringConvertibleValue 74 public bool ReadOnly { get; private set; } 75 public bool Validate(string value, out string errorMessage) { 76 throw new NotSupportedException(); // changing a constant regression model is not supported 77 } 78 79 public string GetValue() { 80 return string.Format("{0:E4}", constant); 81 } 82 83 public bool SetValue(string value) { 84 throw new NotSupportedException(); // changing a constant regression model is not supported 85 } 86 87 public event EventHandler ValueChanged; 88 #endregion 60 89 } 61 90 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionSolution.cs
r12012 r14029 28 28 [Item(Name = "Constant Regression Solution", Description = "Represents a constant regression solution (model + data).")] 29 29 public class ConstantRegressionSolution : RegressionSolution { 30 public new Constant RegressionModel Model {31 get { return (Constant RegressionModel)base.Model; }30 public new ConstantModel Model { 31 get { return (ConstantModel)base.Model; } 32 32 set { base.Model = value; } 33 33 } … … 36 36 protected ConstantRegressionSolution(bool deserializing) : base(deserializing) { } 37 37 protected ConstantRegressionSolution(ConstantRegressionSolution original, Cloner cloner) : base(original, cloner) { } 38 public ConstantRegressionSolution(Constant RegressionModel model, IRegressionProblemData problemData)38 public ConstantRegressionSolution(ConstantModel model, IRegressionProblemData problemData) 39 39 : base(model, problemData) { 40 40 RecalculateResults(); -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs
r12509 r14029 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; … … 32 33 [StorableClass] 33 34 [Item("RegressionEnsembleModel", "A regression model that contains an ensemble of multiple regression models")] 34 public class RegressionEnsembleModel : NamedItem, IRegressionEnsembleModel { 35 public sealed class RegressionEnsembleModel : RegressionModel, IRegressionEnsembleModel { 36 public override IEnumerable<string> VariablesUsedForPrediction { 37 get { return models.SelectMany(x => x.VariablesUsedForPrediction).Distinct().OrderBy(x => x); } 38 } 35 39 36 40 private List<IRegressionModel> models; … … 45 49 } 46 50 51 private List<double> modelWeights; 52 public IEnumerable<double> ModelWeights { 53 get { return modelWeights; } 54 } 55 56 [Storable(Name = "ModelWeights")] 57 private IEnumerable<double> StorableModelWeights { 58 get { return modelWeights; } 59 set { modelWeights = value.ToList(); } 60 } 61 62 [Storable] 63 private bool averageModelEstimates = true; 64 public bool AverageModelEstimates { 65 get { return averageModelEstimates; } 66 set { 67 if (averageModelEstimates != value) { 68 averageModelEstimates = value; 69 OnChanged(); 70 } 71 } 72 } 73 47 74 #region backwards compatiblity 3.3.5 48 75 [Storable(Name = "models", AllowOneWay = true)] … … 52 79 #endregion 53 80 81 [StorableHook(HookType.AfterDeserialization)] 82 private void AfterDeserialization() { 83 // BackwardsCompatibility 3.3.14 84 #region Backwards compatible code, remove with 3.4 85 if (modelWeights == null || !modelWeights.Any()) 86 modelWeights = new List<double>(models.Select(m => 1.0)); 87 #endregion 88 } 89 54 90 [StorableConstructor] 55 pr otectedRegressionEnsembleModel(bool deserializing) : base(deserializing) { }56 pr otectedRegressionEnsembleModel(RegressionEnsembleModel original, Cloner cloner)91 private RegressionEnsembleModel(bool deserializing) : base(deserializing) { } 92 private RegressionEnsembleModel(RegressionEnsembleModel original, Cloner cloner) 57 93 : base(original, cloner) { 58 this.models = original.Models.Select(m => cloner.Clone(m)).ToList(); 94 this.models = original.Models.Select(cloner.Clone).ToList(); 95 this.modelWeights = new List<double>(original.ModelWeights); 96 this.averageModelEstimates = original.averageModelEstimates; 97 } 98 public override IDeepCloneable Clone(Cloner cloner) { 99 return new RegressionEnsembleModel(this, cloner); 59 100 } 60 101 61 102 public RegressionEnsembleModel() : this(Enumerable.Empty<IRegressionModel>()) { } 62 public RegressionEnsembleModel(IEnumerable<IRegressionModel> models) 63 : base() { 103 public RegressionEnsembleModel(IEnumerable<IRegressionModel> models) : this(models, models.Select(m => 1.0)) { } 104 public RegressionEnsembleModel(IEnumerable<IRegressionModel> models, IEnumerable<double> modelWeights) 105 : base(string.Empty) { 64 106 this.name = ItemName; 65 107 this.description = ItemDescription; 108 66 109 this.models = new List<IRegressionModel>(models); 67 } 68 69 public override IDeepCloneable Clone(Cloner cloner) { 70 return new RegressionEnsembleModel(this, cloner); 71 } 72 73 #region IRegressionEnsembleModel Members 110 this.modelWeights = new List<double>(modelWeights); 111 112 if (this.models.Any()) this.TargetVariable = this.models.First().TargetVariable; 113 } 74 114 75 115 public void Add(IRegressionModel model) { 116 if (string.IsNullOrEmpty(TargetVariable)) TargetVariable = model.TargetVariable; 117 Add(model, 1.0); 118 } 119 public void Add(IRegressionModel model, double weight) { 120 if (string.IsNullOrEmpty(TargetVariable)) TargetVariable = model.TargetVariable; 121 76 122 models.Add(model); 77 } 123 modelWeights.Add(weight); 124 OnChanged(); 125 } 126 127 public void AddRange(IEnumerable<IRegressionModel> models) { 128 AddRange(models, models.Select(m => 1.0)); 129 } 130 public void AddRange(IEnumerable<IRegressionModel> models, IEnumerable<double> weights) { 131 if (string.IsNullOrEmpty(TargetVariable)) TargetVariable = models.First().TargetVariable; 132 133 this.models.AddRange(models); 134 modelWeights.AddRange(weights); 135 OnChanged(); 136 } 137 78 138 public void Remove(IRegressionModel model) { 79 models.Remove(model); 80 } 81 139 var index = models.IndexOf(model); 140 models.RemoveAt(index); 141 modelWeights.RemoveAt(index); 142 143 if (!models.Any()) TargetVariable = string.Empty; 144 OnChanged(); 145 } 146 public void RemoveRange(IEnumerable<IRegressionModel> models) { 147 foreach (var model in models) { 148 var index = this.models.IndexOf(model); 149 this.models.RemoveAt(index); 150 modelWeights.RemoveAt(index); 151 } 152 153 if (!models.Any()) TargetVariable = string.Empty; 154 OnChanged(); 155 } 156 157 public double GetModelWeight(IRegressionModel model) { 158 var index = models.IndexOf(model); 159 return modelWeights[index]; 160 } 161 public void SetModelWeight(IRegressionModel model, double weight) { 162 var index = models.IndexOf(model); 163 modelWeights[index] = weight; 164 OnChanged(); 165 } 166 167 #region evaluation 82 168 public IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(IDataset dataset, IEnumerable<int> rows) { 83 169 var estimatedValuesEnumerators = (from model in models 84 select model.GetEstimatedValues(dataset, rows).GetEnumerator()) 85 .ToList(); 170 let weight = GetModelWeight(model) 171 select model.GetEstimatedValues(dataset, rows).Select(e => weight * e) 172 .GetEnumerator()).ToList(); 86 173 87 174 while (estimatedValuesEnumerators.All(en => en.MoveNext())) { … … 91 178 } 92 179 180 public override IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 181 double weightsSum = modelWeights.Sum(); 182 var summedEstimates = from estimatedValuesVector in GetEstimatedValueVectors(dataset, rows) 183 select estimatedValuesVector.DefaultIfEmpty(double.NaN).Sum(); 184 185 if (AverageModelEstimates) 186 return summedEstimates.Select(v => v / weightsSum); 187 else 188 return summedEstimates; 189 190 } 191 192 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows, Func<int, IRegressionModel, bool> modelSelectionPredicate) { 193 var estimatedValuesEnumerators = GetEstimatedValueVectors(dataset, rows).GetEnumerator(); 194 var rowsEnumerator = rows.GetEnumerator(); 195 196 while (rowsEnumerator.MoveNext() & estimatedValuesEnumerators.MoveNext()) { 197 var estimatedValueEnumerator = estimatedValuesEnumerators.Current.GetEnumerator(); 198 int currentRow = rowsEnumerator.Current; 199 double weightsSum = 0.0; 200 double filteredEstimatesSum = 0.0; 201 202 for (int m = 0; m < models.Count; m++) { 203 estimatedValueEnumerator.MoveNext(); 204 var model = models[m]; 205 if (!modelSelectionPredicate(currentRow, model)) continue; 206 207 filteredEstimatesSum += estimatedValueEnumerator.Current; 208 weightsSum += modelWeights[m]; 209 } 210 211 if (AverageModelEstimates) 212 yield return filteredEstimatesSum / weightsSum; 213 else 214 yield return filteredEstimatesSum; 215 } 216 } 217 93 218 #endregion 94 219 95 #region IRegressionModel Members 96 97 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 98 foreach (var estimatedValuesVector in GetEstimatedValueVectors(dataset, rows)) { 99 yield return estimatedValuesVector.Average(); 100 } 101 } 102 103 public RegressionEnsembleSolution CreateRegressionSolution(IRegressionProblemData problemData) { 104 return new RegressionEnsembleSolution(this.Models, new RegressionEnsembleProblemData(problemData)); 105 } 106 IRegressionSolution IRegressionModel.CreateRegressionSolution(IRegressionProblemData problemData) { 107 return CreateRegressionSolution(problemData); 108 } 109 110 #endregion 220 public event EventHandler Changed; 221 private void OnChanged() { 222 var handler = Changed; 223 if (handler != null) 224 handler(this, EventArgs.Empty); 225 } 226 227 228 public override IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) { 229 return new RegressionEnsembleSolution(this, new RegressionEnsembleProblemData(problemData)); 230 } 111 231 } 112 232 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
r12820 r14029 79 79 } 80 80 } 81 82 RegisterModelEvents(); 81 83 RegisterRegressionSolutionsEventHandler(); 82 84 } … … 93 95 } 94 96 97 evaluationCache = new Dictionary<int, double>(original.ProblemData.Dataset.Rows); 95 98 trainingEvaluationCache = new Dictionary<int, double>(original.ProblemData.TrainingIndices.Count()); 96 99 testEvaluationCache = new Dictionary<int, double>(original.ProblemData.TestIndices.Count()); 97 100 98 101 regressionSolutions = cloner.Clone(original.regressionSolutions); 102 RegisterModelEvents(); 99 103 RegisterRegressionSolutionsEventHandler(); 100 104 } … … 106 110 regressionSolutions = new ItemCollection<IRegressionSolution>(); 107 111 112 RegisterModelEvents(); 108 113 RegisterRegressionSolutionsEventHandler(); 109 114 } 110 115 111 116 public RegressionEnsembleSolution(IRegressionProblemData problemData) 112 : this(Enumerable.Empty<IRegressionModel>(), problemData) { 113 } 114 115 public RegressionEnsembleSolution(IEnumerable<IRegressionModel> models, IRegressionProblemData problemData) 116 : this(models, problemData, 117 models.Select(m => (IntRange)problemData.TrainingPartition.Clone()), 118 models.Select(m => (IntRange)problemData.TestPartition.Clone()) 119 ) { } 120 121 public RegressionEnsembleSolution(IEnumerable<IRegressionModel> models, IRegressionProblemData problemData, IEnumerable<IntRange> trainingPartitions, IEnumerable<IntRange> testPartitions) 122 : base(new RegressionEnsembleModel(Enumerable.Empty<IRegressionModel>()), new RegressionEnsembleProblemData(problemData)) { 123 this.trainingPartitions = new Dictionary<IRegressionModel, IntRange>(); 124 this.testPartitions = new Dictionary<IRegressionModel, IntRange>(); 125 this.regressionSolutions = new ItemCollection<IRegressionSolution>(); 126 127 List<IRegressionSolution> solutions = new List<IRegressionSolution>(); 128 var modelEnumerator = models.GetEnumerator(); 129 var trainingPartitionEnumerator = trainingPartitions.GetEnumerator(); 130 var testPartitionEnumerator = testPartitions.GetEnumerator(); 131 132 while (modelEnumerator.MoveNext() & trainingPartitionEnumerator.MoveNext() & testPartitionEnumerator.MoveNext()) { 133 var p = (IRegressionProblemData)problemData.Clone(); 134 p.TrainingPartition.Start = trainingPartitionEnumerator.Current.Start; 135 p.TrainingPartition.End = trainingPartitionEnumerator.Current.End; 136 p.TestPartition.Start = testPartitionEnumerator.Current.Start; 137 p.TestPartition.End = testPartitionEnumerator.Current.End; 138 139 solutions.Add(modelEnumerator.Current.CreateRegressionSolution(p)); 140 } 141 if (modelEnumerator.MoveNext() | trainingPartitionEnumerator.MoveNext() | testPartitionEnumerator.MoveNext()) { 142 throw new ArgumentException(); 143 } 144 117 : this(new RegressionEnsembleModel(), problemData) { 118 } 119 120 public RegressionEnsembleSolution(IRegressionEnsembleModel model, IRegressionProblemData problemData) 121 : base(model, new RegressionEnsembleProblemData(problemData)) { 122 trainingPartitions = new Dictionary<IRegressionModel, IntRange>(); 123 testPartitions = new Dictionary<IRegressionModel, IntRange>(); 124 regressionSolutions = new ItemCollection<IRegressionSolution>(); 125 126 evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows); 145 127 trainingEvaluationCache = new Dictionary<int, double>(problemData.TrainingIndices.Count()); 146 128 testEvaluationCache = new Dictionary<int, double>(problemData.TestIndices.Count()); 147 129 130 131 var solutions = model.Models.Select(m => m.CreateRegressionSolution((IRegressionProblemData)problemData.Clone())); 132 foreach (var solution in solutions) { 133 regressionSolutions.Add(solution); 134 trainingPartitions.Add(solution.Model, solution.ProblemData.TrainingPartition); 135 testPartitions.Add(solution.Model, solution.ProblemData.TestPartition); 136 } 137 138 RecalculateResults(); 139 RegisterModelEvents(); 148 140 RegisterRegressionSolutionsEventHandler(); 149 regressionSolutions.AddRange(solutions);150 } 141 } 142 151 143 152 144 public override IDeepCloneable Clone(Cloner cloner) { 153 145 return new RegressionEnsembleSolution(this, cloner); 146 } 147 148 private void RegisterModelEvents() { 149 Model.Changed += Model_Changed; 154 150 } 155 151 private void RegisterRegressionSolutionsEventHandler() { … … 168 164 var rows = ProblemData.TrainingIndices; 169 165 var rowsToEvaluate = rows.Except(trainingEvaluationCache.Keys); 166 170 167 var rowsEnumerator = rowsToEvaluate.GetEnumerator(); 171 var valuesEnumerator = GetEstimatedValues(rowsToEvaluate, (r, m) => RowIsTrainingForModel(r, m) && !RowIsTestForModel(r, m)).GetEnumerator();168 var valuesEnumerator = Model.GetEstimatedValues(ProblemData.Dataset, rowsToEvaluate, (r, m) => RowIsTrainingForModel(r, m) && !RowIsTestForModel(r, m)).GetEnumerator(); 172 169 173 170 while (rowsEnumerator.MoveNext() & valuesEnumerator.MoveNext()) { … … 184 181 var rowsToEvaluate = rows.Except(testEvaluationCache.Keys); 185 182 var rowsEnumerator = rowsToEvaluate.GetEnumerator(); 186 var valuesEnumerator = GetEstimatedValues(rowsToEvaluate, RowIsTestForModel).GetEnumerator();183 var valuesEnumerator = Model.GetEstimatedValues(ProblemData.Dataset, rowsToEvaluate, RowIsTestForModel).GetEnumerator(); 187 184 188 185 while (rowsEnumerator.MoveNext() & valuesEnumerator.MoveNext()) { … … 193 190 } 194 191 } 195 196 private IEnumerable<double> GetEstimatedValues(IEnumerable<int> rows, Func<int, IRegressionModel, bool> modelSelectionPredicate) {197 var estimatedValuesEnumerators = (from model in Model.Models198 select new { Model = model, EstimatedValuesEnumerator = model.GetEstimatedValues(ProblemData.Dataset, rows).GetEnumerator() })199 .ToList();200 var rowsEnumerator = rows.GetEnumerator();201 // aggregate to make sure that MoveNext is called for all enumerators202 while (rowsEnumerator.MoveNext() & estimatedValuesEnumerators.Select(en => en.EstimatedValuesEnumerator.MoveNext()).Aggregate(true, (acc, b) => acc & b)) {203 int currentRow = rowsEnumerator.Current;204 205 var selectedEnumerators = from pair in estimatedValuesEnumerators206 where modelSelectionPredicate(currentRow, pair.Model)207 select pair.EstimatedValuesEnumerator;208 209 yield return AggregateEstimatedValues(selectedEnumerators.Select(x => x.Current));210 }211 }212 213 192 private bool RowIsTrainingForModel(int currentRow, IRegressionModel model) { 214 193 return trainingPartitions == null || !trainingPartitions.ContainsKey(model) || 215 194 (trainingPartitions[model].Start <= currentRow && currentRow < trainingPartitions[model].End); 216 195 } 217 218 196 private bool RowIsTestForModel(int currentRow, IRegressionModel model) { 219 197 return testPartitions == null || !testPartitions.ContainsKey(model) || … … 224 202 var rowsToEvaluate = rows.Except(evaluationCache.Keys); 225 203 var rowsEnumerator = rowsToEvaluate.GetEnumerator(); 226 var valuesEnumerator = (from xs in GetEstimatedValueVectors(ProblemData.Dataset, rowsToEvaluate) 227 select AggregateEstimatedValues(xs)) 228 .GetEnumerator(); 204 var valuesEnumerator = Model.GetEstimatedValues(ProblemData.Dataset, rowsToEvaluate).GetEnumerator(); 229 205 230 206 while (rowsEnumerator.MoveNext() & valuesEnumerator.MoveNext()) { … … 235 211 } 236 212 237 public IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(IDataset dataset, IEnumerable<int> rows) { 238 if (!Model.Models.Any()) yield break; 239 var estimatedValuesEnumerators = (from model in Model.Models 240 select model.GetEstimatedValues(dataset, rows).GetEnumerator()) 241 .ToList(); 242 243 while (estimatedValuesEnumerators.All(en => en.MoveNext())) { 244 yield return from enumerator in estimatedValuesEnumerators 245 select enumerator.Current; 246 } 247 } 248 249 private double AggregateEstimatedValues(IEnumerable<double> estimatedValues) { 250 return estimatedValues.DefaultIfEmpty(double.NaN).Average(); 213 public IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(IEnumerable<int> rows) { 214 return Model.GetEstimatedValueVectors(ProblemData.Dataset, rows); 251 215 } 252 216 #endregion … … 282 246 } 283 247 284 public void AddRegressionSolutions(IEnumerable<IRegressionSolution> solutions) { 285 regressionSolutions.AddRange(solutions); 248 private void Model_Changed(object sender, EventArgs e) { 249 var modelSet = new HashSet<IRegressionModel>(Model.Models); 250 foreach (var model in Model.Models) { 251 if (!trainingPartitions.ContainsKey(model)) trainingPartitions.Add(model, ProblemData.TrainingPartition); 252 if (!testPartitions.ContainsKey(model)) testPartitions.Add(model, ProblemData.TrainingPartition); 253 } 254 foreach (var model in trainingPartitions.Keys) { 255 if (modelSet.Contains(model)) continue; 256 trainingPartitions.Remove(model); 257 testPartitions.Remove(model); 258 } 286 259 287 260 trainingEvaluationCache.Clear(); 288 261 testEvaluationCache.Clear(); 289 262 evaluationCache.Clear(); 263 264 OnModelChanged(); 265 } 266 267 public void AddRegressionSolutions(IEnumerable<IRegressionSolution> solutions) { 268 regressionSolutions.AddRange(solutions); 290 269 } 291 270 public void RemoveRegressionSolutions(IEnumerable<IRegressionSolution> solutions) { 292 271 regressionSolutions.RemoveRange(solutions); 293 294 trainingEvaluationCache.Clear();295 testEvaluationCache.Clear();296 evaluationCache.Clear();297 272 } 298 273 299 274 private void regressionSolutions_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRegressionSolution> e) { 300 foreach (var solution in e.Items) AddRegressionSolution(solution); 301 RecalculateResults(); 275 foreach (var solution in e.Items) { 276 trainingPartitions.Add(solution.Model, solution.ProblemData.TrainingPartition); 277 testPartitions.Add(solution.Model, solution.ProblemData.TestPartition); 278 } 279 Model.AddRange(e.Items.Select(s => s.Model)); 302 280 } 303 281 private void regressionSolutions_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRegressionSolution> e) { 304 foreach (var solution in e.Items) RemoveRegressionSolution(solution); 305 RecalculateResults(); 282 foreach (var solution in e.Items) { 283 trainingPartitions.Remove(solution.Model); 284 testPartitions.Remove(solution.Model); 285 } 286 Model.RemoveRange(e.Items.Select(s => s.Model)); 306 287 } 307 288 private void regressionSolutions_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRegressionSolution> e) { 308 foreach (var solution in e.OldItems) RemoveRegressionSolution(solution); 309 foreach (var solution in e.Items) AddRegressionSolution(solution); 310 RecalculateResults(); 311 } 312 313 private void AddRegressionSolution(IRegressionSolution solution) { 314 if (Model.Models.Contains(solution.Model)) throw new ArgumentException(); 315 Model.Add(solution.Model); 316 trainingPartitions[solution.Model] = solution.ProblemData.TrainingPartition; 317 testPartitions[solution.Model] = solution.ProblemData.TestPartition; 318 319 trainingEvaluationCache.Clear(); 320 testEvaluationCache.Clear(); 321 evaluationCache.Clear(); 322 } 323 324 private void RemoveRegressionSolution(IRegressionSolution solution) { 325 if (!Model.Models.Contains(solution.Model)) throw new ArgumentException(); 326 Model.Remove(solution.Model); 327 trainingPartitions.Remove(solution.Model); 328 testPartitions.Remove(solution.Model); 329 330 trainingEvaluationCache.Clear(); 331 testEvaluationCache.Clear(); 332 evaluationCache.Clear(); 289 foreach (var solution in e.OldItems) { 290 trainingPartitions.Remove(solution.Model); 291 testPartitions.Remove(solution.Model); 292 } 293 Model.RemoveRange(e.OldItems.Select(s => s.Model)); 294 295 foreach (var solution in e.Items) { 296 trainingPartitions.Add(solution.Model, solution.ProblemData.TrainingPartition); 297 testPartitions.Add(solution.Model, solution.ProblemData.TestPartition); 298 } 299 Model.AddRange(e.Items.Select(s => s.Model)); 333 300 } 334 301 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r12509 r14029 110 110 } 111 111 112 public IEnumerable<double> TargetVariableValues { 113 get { return Dataset.GetDoubleValues(TargetVariable); } 114 } 115 public IEnumerable<double> TargetVariableTrainingValues { 116 get { return Dataset.GetDoubleValues(TargetVariable, TrainingIndices); } 117 } 118 public IEnumerable<double> TargetVariableTestValues { 119 get { return Dataset.GetDoubleValues(TargetVariable, TestIndices); } 120 } 121 122 112 123 [StorableConstructor] 113 124 protected RegressionProblemData(bool deserializing) : base(deserializing) { } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/ConstantTimeSeriesPrognosisModel.cs
r12509 r14029 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; … … 29 30 [StorableClass] 30 31 [Item("Constant TimeSeries Model", "A time series model that returns for all prediciton the same constant value.")] 32 [Obsolete] 31 33 public class ConstantTimeSeriesPrognosisModel : ConstantRegressionModel, ITimeSeriesPrognosisModel { 32 34 [StorableConstructor] … … 37 39 } 38 40 39 public ConstantTimeSeriesPrognosisModel(double constant ) : base(constant) { }41 public ConstantTimeSeriesPrognosisModel(double constant, string targetVariable) : base(constant, targetVariable) { } 40 42 41 43 public IEnumerable<IEnumerable<double>> GetPrognosedValues(IDataset dataset, IEnumerable<int> rows, IEnumerable<int> horizons) { -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/TimeSeriesPrognosisAutoRegressiveModel.cs
r12509 r14029 30 30 [StorableClass] 31 31 [Item("Autoregressive TimeSeries Model", "A linear autoregressive time series model used to predict future values.")] 32 public class TimeSeriesPrognosisAutoRegressiveModel : NamedItem, ITimeSeriesPrognosisModel { 32 public class TimeSeriesPrognosisAutoRegressiveModel : RegressionModel, ITimeSeriesPrognosisModel { 33 public override IEnumerable<string> VariablesUsedForPrediction { 34 get { return new[] { TargetVariable }; } 35 } 36 33 37 [Storable] 34 38 public double[] Phi { get; private set; } 35 39 [Storable] 36 40 public double Constant { get; private set; } 37 [Storable]38 public string TargetVariable { get; private set; }39 41 40 42 public int TimeOffset { get { return Phi.Length; } } … … 46 48 this.Phi = (double[])original.Phi.Clone(); 47 49 this.Constant = original.Constant; 48 this.TargetVariable = original.TargetVariable;49 50 } 50 51 public override IDeepCloneable Clone(Cloner cloner) { … … 52 53 } 53 54 public TimeSeriesPrognosisAutoRegressiveModel(string targetVariable, double[] phi, double constant) 54 : base( "AR(1) Model") {55 : base(targetVariable, "AR(1) Model") { 55 56 Phi = (double[])phi.Clone(); 56 57 Constant = constant; 57 TargetVariable = targetVariable;58 58 } 59 59 … … 91 91 } 92 92 93 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) {93 public override IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 94 94 var targetVariables = dataset.GetReadOnlyDoubleValues(TargetVariable); 95 95 foreach (int row in rows) { … … 111 111 return new TimeSeriesPrognosisSolution(this, new TimeSeriesPrognosisProblemData(problemData)); 112 112 } 113 public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {113 public override IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) { 114 114 throw new NotSupportedException(); 115 115 } -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisResults.cs
r12641 r14029 373 373 //mean model 374 374 double trainingMean = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).Average(); 375 var meanModel = new Constant TimeSeriesPrognosisModel(trainingMean);375 var meanModel = new ConstantModel(trainingMean, problemData.TargetVariable); 376 376 377 377 //AR1 model … … 395 395 PrognosisTrainingMeanAbsoluteError = errorState == OnlineCalculatorError.None ? trainingMAE : double.NaN; 396 396 double trainingR = OnlinePearsonsRCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState); 397 PrognosisTrainingRSquared = errorState == OnlineCalculatorError.None ? trainingR *trainingR : double.NaN;397 PrognosisTrainingRSquared = errorState == OnlineCalculatorError.None ? trainingR * trainingR : double.NaN; 398 398 double trainingRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState); 399 399 PrognosisTrainingRelativeError = errorState == OnlineCalculatorError.None ? trainingRelError : double.NaN; … … 431 431 PrognosisTestMeanAbsoluteError = errorState == OnlineCalculatorError.None ? testMAE : double.NaN; 432 432 double testR = OnlinePearsonsRCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState); 433 PrognosisTestRSquared = errorState == OnlineCalculatorError.None ? testR *testR : double.NaN;433 PrognosisTestRSquared = errorState == OnlineCalculatorError.None ? testR * testR : double.NaN; 434 434 double testRelError = OnlineMeanAbsolutePercentageErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState); 435 435 PrognosisTestRelativeError = errorState == OnlineCalculatorError.None ? testRelError : double.NaN; … … 448 448 //mean model 449 449 double trainingMean = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).Average(); 450 var meanModel = new Constant TimeSeriesPrognosisModel(trainingMean);450 var meanModel = new ConstantModel(trainingMean, problemData.TargetVariable); 451 451 452 452 //AR1 model -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionBase.cs
r12012 r14029 150 150 OnlineCalculatorError errorState; 151 151 double trainingMean = ProblemData.TrainingIndices.Any() ? ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average() : double.NaN; 152 var meanModel = new Constant TimeSeriesPrognosisModel(trainingMean);152 var meanModel = new ConstantModel(trainingMean,ProblemData.TargetVariable); 153 153 154 154 double alpha, beta; -
branches/crossvalidation-2434/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Transformations/Transformation.cs
r12612 r14029 31 31 32 32 [Item("Transformation", "Represents the base class for a transformation.")] 33 [StorableClass] 33 34 public abstract class Transformation : ParameterizedNamedItem, ITransformation { 34 35 protected const string ColumnParameterName = "Column";
Note: See TracChangeset
for help on using the changeset viewer.