Changeset 16852
- Timestamp:
- 04/19/19 15:45:45 (6 years ago)
- Location:
- branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/LeafModels/PreconstructedLinearModel.cs
r16847 r16852 117 117 alglib.spdmatrixcholeskysolve(aTa, n + 1, true, aTyVector, out info, out report, out coefficients); 118 118 119 //if cholesky calculation fails fall back to classic linear regresseion119 //if Cholesky calculation fails fall back to classic linear regresseion 120 120 if (info != 1) { 121 121 alglib.linearmodel lm; -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/LeafTypes/LinearLeaf.cs
r16847 r16852 44 44 #region IModelType 45 45 public override bool ProvidesConfidence { 46 get { return false; }46 get { return true; } 47 47 } 48 48 public override IRegressionModel Build(IRegressionProblemData pd, IRandom random, CancellationToken cancellationToken, out int numberOfParameters) { -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/LeafTypes/M5Leaf.cs
r16847 r16852 169 169 } 170 170 while (!success && tries < 100); 171 if (coefficients == null ) throw new ArgumentException("No linear model could be built");171 if (coefficients == null || coefficients.Length != n) throw new ArgumentException("No linear model could be built"); 172 172 173 173 intercept = yMean; -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/LeafTypes/M5regLeaf.cs
r16847 r16852 45 45 #region IModelType 46 46 public override bool ProvidesConfidence { 47 get { return true; }47 get { return false; } 48 48 } 49 49 -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/M5Utilities/RegressionTreeAnalyzer.cs
r16847 r16852 104 104 var training = pd.TrainingIndices.Where(x => !regressionRuleModel.Covers(pd.Dataset, x)).ToArray(); 105 105 var test = pd.TestIndices.Where(x => !regressionRuleModel.Covers(pd.Dataset, x)).ToArray(); 106 var data = new Dataset(pd.Dataset.DoubleVariables, pd.Dataset.DoubleVariables.Select(v => pd.Dataset.GetDoubleValues(v, training.Concat(test)).ToArray())); 107 notCovered = new RegressionProblemData(data, pd.AllowedInputVariables, pd.TargetVariable); 108 notCovered.TestPartition.Start = notCovered.TrainingPartition.End = training.Length; 109 notCovered.TestPartition.End = training.Length + test.Length; 106 if (training.Length > 0 || test.Length > 0) { 107 var data = new Dataset(pd.Dataset.DoubleVariables, pd.Dataset.DoubleVariables.Select(v => pd.Dataset.GetDoubleValues(v, training.Concat(test)).ToArray())); 108 notCovered = new RegressionProblemData(data, pd.AllowedInputVariables, pd.TargetVariable); 109 notCovered.TestPartition.Start = notCovered.TrainingPartition.End = training.Length; 110 notCovered.TestPartition.End = training.Length + test.Length; 111 } else notCovered = null; 110 112 111 113 var training2 = pd.TrainingIndices.Where(x => regressionRuleModel.Covers(pd.Dataset, x)).ToArray(); -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/Splitting/M5Splitter.cs
r16847 r16852 55 55 protected override void AttributeSplit(IReadOnlyList<double> attValues, IReadOnlyList<double> targetValues, int minLeafSize, out int position, out double maxImpurity, out double splitValue) { 56 56 position = 0; 57 maxImpurity = -1E20;57 maxImpurity = double.NegativeInfinity; 58 58 splitValue = 0.0; 59 59 var length = targetValues.Count; -
branches/2847_M5Regression/HeuristicLab.Algorithms.DataAnalysis/3.4/M5Regression/Splitting/SplitterBase.cs
r16847 r16852 33 33 [Item("SplitterBase", "Abstract base class for splitters")] 34 34 public abstract class SplitterBase : ParameterizedNamedItem, ISplitter { 35 public const string SplittingStateVariableName = " RuleSetState";35 public const string SplittingStateVariableName = "SplittingState"; 36 36 37 37 #region Constructors & Cloning … … 80 80 81 81 protected virtual bool DecideSplit(IRegressionProblemData splitData, int minLeafSize, out string splitAttr, out double splitValue) { 82 var bestPos = 0;82 var bestPos = -1; 83 83 var bestImpurity = double.MinValue; 84 84 var bestSplitValue = 0.0;
Note: See TracChangeset
for help on using the changeset viewer.