Changeset 15788
- Timestamp:
- 02/20/18 09:09:32 (7 years ago)
- Location:
- stable
- Files:
-
- 15 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk (added) merged: 15783,15786
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.DataAnalysis (added) merged: 15783,15786
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Algorithms.DataAnalysis/3.4 (added) merged: 15783,15786
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/DoubleArrayExtensions.cs
r15783 r15788 1 1 namespace HeuristicLab.Algorithms.DataAnalysis { 2 2 public static class DoubleArrayExtensions { 3 public static bool ContainsNan Inf(this double[,] array) {3 public static bool ContainsNanOrInfinity(this double[,] array) { 4 4 foreach (var entry in array) { 5 5 if (double.IsNaN(entry) || double.IsInfinity(entry)) { -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r15571 r15788 131 131 <SubType>Code</SubType> 132 132 </Compile> 133 <Compile Include="DoubleArrayExtensions.cs" /> 133 134 <Compile Include="FixedDataAnalysisAlgorithm.cs" /> 134 135 <Compile Include="GaussianProcess\CovarianceFunctions\CovarianceSpectralMixture.cs" /> … … 320 321 <Compile Include="TSNE\Distances\IndexedItemDistance.cs" /> 321 322 <Compile Include="TSNE\Distances\ManhattanDistance.cs" /> 322 323 <Compile Include="TSNE\Distances\WeightedEuclideanDistance.cs" /> 323 324 <Compile Include="TSNE\Distances\IDistance.cs" /> 324 325 <Compile Include="TSNE\PriorityQueue.cs" /> -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs
r15584 r15788 80 80 inputMatrix = factorMatrix.HorzCat(inputMatrix); 81 81 82 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))82 if (inputMatrix.ContainsNanOrInfinity()) 83 83 throw new NotSupportedException("Linear discriminant analysis does not support NaN or infinity values in the input dataset."); 84 84 -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs
r15584 r15788 80 80 var inputMatrix = binaryMatrix.HorzCat(doubleVarMatrix); 81 81 82 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))82 if (inputMatrix.ContainsNanOrInfinity()) 83 83 throw new NotSupportedException("Linear regression does not support NaN or infinity values in the input dataset."); 84 84 … … 100 100 int nVarCoeff = doubleVariables.Count(); 101 101 var tree = LinearModelToTreeConverter.CreateTree(factorVariables, coefficients.Take(nFactorCoeff).ToArray(), 102 doubleVariables.ToArray(), coefficients.Skip(nFactorCoeff).Take(nVarCoeff).ToArray(), 102 doubleVariables.ToArray(), coefficients.Skip(nFactorCoeff).Take(nVarCoeff).ToArray(), 103 103 @const: coefficients[nFeatures]); 104 104 105 105 SymbolicRegressionSolution solution = new SymbolicRegressionSolution(new SymbolicRegressionModel(problemData.TargetVariable, tree, new SymbolicDataAnalysisExpressionTreeLinearInterpreter()), (IRegressionProblemData)problemData.Clone()); 106 106 solution.Model.Name = "Linear Regression Model"; -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassification.cs
r15584 r15788 78 78 inputMatrix = factorMatrix.HorzCat(inputMatrix); 79 79 80 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))80 if (inputMatrix.ContainsNanOrInfinity()) 81 81 throw new NotSupportedException("Multinomial logit classification does not support NaN or infinity values in the input dataset."); 82 82 -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs
r15584 r15788 142 142 } 143 143 144 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))144 if (inputMatrix.ContainsNanOrInfinity()) 145 145 throw new NotSupportedException( 146 146 "Nearest neighbour model does not support NaN or infinity values in the input dataset."); -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassification.cs
r15584 r15788 115 115 public NeuralNetworkClassification() 116 116 : base() { 117 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 118 (IntValue)new IntValue(0).AsReadOnly(), 119 (IntValue)new IntValue(1).AsReadOnly(), 117 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 118 (IntValue)new IntValue(0).AsReadOnly(), 119 (IntValue)new IntValue(1).AsReadOnly(), 120 120 (IntValue)new IntValue(2).AsReadOnly() }); 121 121 var selectedHiddenLayerValue = (from v in validHiddenLayerValues … … 185 185 IEnumerable<int> rows = problemData.TrainingIndices; 186 186 double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); 187 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))187 if (inputMatrix.ContainsNanOrInfinity()) 188 188 throw new NotSupportedException("Neural network classification does not support NaN or infinity values in the input dataset."); 189 189 -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleClassification.cs
r15584 r15788 171 171 IEnumerable<int> rows = problemData.TrainingIndices; 172 172 double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); 173 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))173 if (inputMatrix.ContainsNanOrInfinity()) 174 174 throw new NotSupportedException("Neural network ensemble classification does not support NaN or infinity values in the input dataset."); 175 175 -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleRegression.cs
r15584 r15788 125 125 public NeuralNetworkEnsembleRegression() 126 126 : base() { 127 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 128 (IntValue)new IntValue(0).AsReadOnly(), 129 (IntValue)new IntValue(1).AsReadOnly(), 127 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 128 (IntValue)new IntValue(0).AsReadOnly(), 129 (IntValue)new IntValue(1).AsReadOnly(), 130 130 (IntValue)new IntValue(2).AsReadOnly() }); 131 131 var selectedHiddenLayerValue = (from v in validHiddenLayerValues … … 170 170 IEnumerable<int> rows = problemData.TrainingIndices; 171 171 double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); 172 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))172 if (inputMatrix.ContainsNanOrInfinity()) 173 173 throw new NotSupportedException("Neural network ensemble regression does not support NaN or infinity values in the input dataset."); 174 174 -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegression.cs
r15584 r15788 115 115 public NeuralNetworkRegression() 116 116 : base() { 117 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 118 (IntValue)new IntValue(0).AsReadOnly(), 119 (IntValue)new IntValue(1).AsReadOnly(), 117 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 118 (IntValue)new IntValue(0).AsReadOnly(), 119 (IntValue)new IntValue(1).AsReadOnly(), 120 120 (IntValue)new IntValue(2).AsReadOnly() }); 121 121 var selectedHiddenLayerValue = (from v in validHiddenLayerValues … … 186 186 IEnumerable<int> rows = problemData.TrainingIndices; 187 187 double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); 188 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))188 if (inputMatrix.ContainsNanOrInfinity()) 189 189 throw new NotSupportedException("Neural network regression does not support NaN or infinity values in the input dataset."); 190 190 -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs
r15584 r15788 310 310 public static RandomForestModel CreateClassificationModel(IClassificationProblemData problemData, int nTrees, double r, double m, int seed, 311 311 out double rmsError, out double outOfBagRmsError, out double relClassificationError, out double outOfBagRelClassificationError) { 312 return CreateClassificationModel(problemData, problemData.TrainingIndices, nTrees, r, m, seed, 312 return CreateClassificationModel(problemData, problemData.TrainingIndices, nTrees, r, m, seed, 313 313 out rmsError, out outOfBagRmsError, out relClassificationError, out outOfBagRelClassificationError); 314 314 } … … 370 370 371 371 private static void AssertInputMatrix(double[,] inputMatrix) { 372 if (inputMatrix.C ast<double>().Any(x => Double.IsNaN(x) || Double.IsInfinity(x)))372 if (inputMatrix.ContainsNanOrInfinity()) 373 373 throw new NotSupportedException("Random forest modeling does not support NaN or infinity values in the input dataset."); 374 374 } -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/TimeSeries/AutoregressiveModeling.cs
r15584 r15788 26 26 using HeuristicLab.Core; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;29 28 using HeuristicLab.Optimization; 30 29 using HeuristicLab.Parameters; … … 97 96 inputMatrix[i, timeOffset] = targetValues[i + problemData.TrainingPartition.Start]; 98 97 99 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))98 if (inputMatrix.ContainsNanOrInfinity()) 100 99 throw new NotSupportedException("Linear regression does not support NaN or infinity values in the input dataset."); 101 100 -
stable/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClustering.cs
r15584 r15788 91 91 int[] xyc; 92 92 double[,] inputMatrix = dataset.ToArray(allowedInputVariables, rows); 93 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))93 if (inputMatrix.ContainsNanOrInfinity()) 94 94 throw new NotSupportedException("k-Means clustering does not support NaN or infinity values in the input dataset."); 95 95
Note: See TracChangeset
for help on using the changeset viewer.