Changeset 16892 for branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DataAnalysis/3.4/Implementation
- Timestamp:
- 05/04/19 08:22:42 (6 years ago)
- Location:
- branches/2925_AutoDiffForDynamicalModels
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2925_AutoDiffForDynamicalModels
- Property svn:mergeinfo changed
-
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
-
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationModel.cs
r16662 r16892 75 75 var classificationProblemData = problemData as IClassificationProblemData; 76 76 if (classificationProblemData == null) 77 throw new ArgumentException("The problem data is not a regression problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");77 throw new ArgumentException("The problem data is not compatible with this classification model. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData"); 78 78 return IsProblemDataCompatible(classificationProblemData, out errorMessage); 79 79 } -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationModel.cs
r16662 r16892 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HEAL.Attic; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; 27 using HEAL.Attic;28 28 29 29 namespace HeuristicLab.Problems.DataAnalysis { … … 121 121 122 122 public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 123 var estimatedValues = GetEstimatedValues(dataset, rows); 124 return GetEstimatedClassValues(estimatedValues); 125 } 126 127 public virtual IEnumerable<double> GetEstimatedClassValues(IEnumerable<double> estimatedValues) { 123 128 if (!Thresholds.Any() && !ClassValues.Any()) throw new ArgumentException("No thresholds and class values were set for the current classification model."); 124 foreach (var x in GetEstimatedValues(dataset, rows)) {129 foreach (var x in estimatedValues) { 125 130 int classIndex = 0; 126 131 // find first threshold value which is larger than x => class index = threshold index + 1 … … 132 137 } 133 138 } 139 134 140 #region events 135 141 public event EventHandler ThresholdsChanged; -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/ConstantModel.cs
r16662 r16892 98 98 return IsProblemDataCompatible(classificationProblemData, out errorMessage); 99 99 100 throw new ArgumentException("The problem data is not a regression nor a classification problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");100 throw new ArgumentException("The problem data is compatible with this model. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData"); 101 101 } 102 102 -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Interval.cs
r16662 r16892 167 167 } 168 168 public static Interval Cosine(Interval a) { 169 return Interval.Sine(Interval. Subtract(a, new Interval(Math.PI / 2, Math.PI / 2)));169 return Interval.Sine(Interval.Add(a, new Interval(Math.PI / 2, Math.PI / 2))); 170 170 } 171 171 public static Interval Tangens(Interval a) { 172 172 return Interval.Divide(Interval.Sine(a), Interval.Cosine(a)); 173 } 174 public static Interval HyperbolicTangent(Interval a) { 175 return new Interval(Math.Tanh(a.LowerBound), Math.Tanh(a.UpperBound)); 173 176 } 174 177 … … 203 206 if (a.UpperBound <= 0) return new Interval(a.UpperBound * a.UpperBound, a.LowerBound * a.LowerBound); // interval is negative 204 207 else if (a.LowerBound >= 0) return new Interval(a.LowerBound * a.LowerBound, a.UpperBound * a.UpperBound); // interval is positive 205 else return new Interval(0, Math.Max(a.LowerBound *a.LowerBound, a.UpperBound*a.UpperBound)); // interval goes over zero208 else return new Interval(0, Math.Max(a.LowerBound * a.LowerBound, a.UpperBound * a.UpperBound)); // interval goes over zero 206 209 } 207 210 … … 224 227 public static Interval CubicRoot(Interval a) { 225 228 if (a.LowerBound < 0) return new Interval(double.NaN, double.NaN); 226 return new Interval(Math.Pow(a.LowerBound, 1.0 /3), Math.Pow(a.UpperBound, 1.0/3));229 return new Interval(Math.Pow(a.LowerBound, 1.0 / 3), Math.Pow(a.UpperBound, 1.0 / 3)); 227 230 } 228 231 #endregion -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs
r16662 r16892 73 73 74 74 #region backwards compatiblity 3.3.5 75 [Storable( Name = "models", AllowOneWay = true)]75 [Storable(OldName = "models")] 76 76 private List<IRegressionModel> OldStorableModels { 77 77 set { models = value; } -
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionModel.cs
r16662 r16892 76 76 var regressionProblemData = problemData as IRegressionProblemData; 77 77 if (regressionProblemData == null) 78 throw new ArgumentException("The problem data is not a regression problem data. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData");78 throw new ArgumentException("The problem data is not compatible with this regression model. Instead a " + problemData.GetType().GetPrettyName() + " was provided.", "problemData"); 79 79 return IsProblemDataCompatible(regressionProblemData, out errorMessage); 80 80 }
Note: See TracChangeset
for help on using the changeset viewer.