Changeset 15783
- Timestamp:
- 02/16/18 11:35:54 (7 years ago)
- Location:
- trunk/HeuristicLab.Algorithms.DataAnalysis/3.4
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj
r15532 r15783 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" /> -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs
r15583 r15783 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.ContainsNanInf()) 83 83 throw new NotSupportedException("Linear discriminant analysis does not support NaN or infinity values in the input dataset."); 84 84 -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs
r15583 r15783 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.ContainsNanInf()) 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"; -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassification.cs
r15583 r15783 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.ContainsNanInf()) 81 81 throw new NotSupportedException("Multinomial logit classification does not support NaN or infinity values in the input dataset."); 82 82 -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs
r15583 r15783 142 142 } 143 143 144 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))144 if (inputMatrix.ContainsNanInf()) 145 145 throw new NotSupportedException( 146 146 "Nearest neighbour model does not support NaN or infinity values in the input dataset."); -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassification.cs
r15583 r15783 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.ContainsNanInf()) 188 188 throw new NotSupportedException("Neural network classification does not support NaN or infinity values in the input dataset."); 189 189 -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleClassification.cs
r15583 r15783 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.ContainsNanInf()) 174 174 throw new NotSupportedException("Neural network ensemble classification does not support NaN or infinity values in the input dataset."); 175 175 -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleRegression.cs
r15583 r15783 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.ContainsNanInf()) 173 173 throw new NotSupportedException("Neural network ensemble regression does not support NaN or infinity values in the input dataset."); 174 174 -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegression.cs
r15583 r15783 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.ContainsNanInf()) 189 189 throw new NotSupportedException("Neural network regression does not support NaN or infinity values in the input dataset."); 190 190 -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs
r15583 r15783 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.ContainsNanInf()) 373 373 throw new NotSupportedException("Random forest modeling does not support NaN or infinity values in the input dataset."); 374 374 } -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/TimeSeries/AutoregressiveModeling.cs
r15583 r15783 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.ContainsNanInf()) 100 99 throw new NotSupportedException("Linear regression does not support NaN or infinity values in the input dataset."); 101 100 -
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClustering.cs
r15583 r15783 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.ContainsNanInf()) 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.