Free cookie consent management tool by TermsFeed Policy Generator

# Changeset 15783

Ignore:
Timestamp:
02/16/18 11:35:54 (6 years ago)
Message:

#2902: Changed from Cast to Iterator and adapted all occurrences.

Location:
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4
Files:
12 edited

Unmodified
Removed
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/HeuristicLab.Algorithms.DataAnalysis-3.4.csproj

 r15532 Code
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearDiscriminantAnalysis.cs

 r15583 inputMatrix = factorMatrix.HorzCat(inputMatrix); if (inputMatrix.Cast().Any(x => double.IsNaN(x) || double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException("Linear discriminant analysis does not support NaN or infinity values in the input dataset.");
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearRegression.cs

 r15583 var inputMatrix = binaryMatrix.HorzCat(doubleVarMatrix); if (inputMatrix.Cast().Any(x => double.IsNaN(x) || double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException("Linear regression does not support NaN or infinity values in the input dataset."); int nVarCoeff = doubleVariables.Count(); var tree = LinearModelToTreeConverter.CreateTree(factorVariables, coefficients.Take(nFactorCoeff).ToArray(), doubleVariables.ToArray(), coefficients.Skip(nFactorCoeff).Take(nVarCoeff).ToArray(), doubleVariables.ToArray(), coefficients.Skip(nFactorCoeff).Take(nVarCoeff).ToArray(), @const: coefficients[nFeatures]); SymbolicRegressionSolution solution = new SymbolicRegressionSolution(new SymbolicRegressionModel(problemData.TargetVariable, tree, new SymbolicDataAnalysisExpressionTreeLinearInterpreter()), (IRegressionProblemData)problemData.Clone()); solution.Model.Name = "Linear Regression Model";
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/MultinomialLogitClassification.cs

 r15583 inputMatrix = factorMatrix.HorzCat(inputMatrix); if (inputMatrix.Cast().Any(x => double.IsNaN(x) || double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException("Multinomial logit classification does not support NaN or infinity values in the input dataset.");
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs

 r15583 } if (inputMatrix.Cast().Any(x => double.IsNaN(x) || double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException( "Nearest neighbour model does not support NaN or infinity values in the input dataset.");
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassification.cs

 r15583 public NeuralNetworkClassification() : base() { var validHiddenLayerValues = new ItemSet(new IntValue[] { (IntValue)new IntValue(0).AsReadOnly(), (IntValue)new IntValue(1).AsReadOnly(), var validHiddenLayerValues = new ItemSet(new IntValue[] { (IntValue)new IntValue(0).AsReadOnly(), (IntValue)new IntValue(1).AsReadOnly(), (IntValue)new IntValue(2).AsReadOnly() }); var selectedHiddenLayerValue = (from v in validHiddenLayerValues IEnumerable rows = problemData.TrainingIndices; double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); if (inputMatrix.Cast().Any(x => double.IsNaN(x) || double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException("Neural network classification does not support NaN or infinity values in the input dataset.");
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleClassification.cs

 r15583 IEnumerable rows = problemData.TrainingIndices; double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); if (inputMatrix.Cast().Any(x => double.IsNaN(x) || double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException("Neural network ensemble classification does not support NaN or infinity values in the input dataset.");
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleRegression.cs

 r15583 public NeuralNetworkEnsembleRegression() : base() { var validHiddenLayerValues = new ItemSet(new IntValue[] { (IntValue)new IntValue(0).AsReadOnly(), (IntValue)new IntValue(1).AsReadOnly(), var validHiddenLayerValues = new ItemSet(new IntValue[] { (IntValue)new IntValue(0).AsReadOnly(), (IntValue)new IntValue(1).AsReadOnly(), (IntValue)new IntValue(2).AsReadOnly() }); var selectedHiddenLayerValue = (from v in validHiddenLayerValues IEnumerable rows = problemData.TrainingIndices; double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); if (inputMatrix.Cast().Any(x => double.IsNaN(x) || double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException("Neural network ensemble regression does not support NaN or infinity values in the input dataset.");
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegression.cs

 r15583 public NeuralNetworkRegression() : base() { var validHiddenLayerValues = new ItemSet(new IntValue[] { (IntValue)new IntValue(0).AsReadOnly(), (IntValue)new IntValue(1).AsReadOnly(), var validHiddenLayerValues = new ItemSet(new IntValue[] { (IntValue)new IntValue(0).AsReadOnly(), (IntValue)new IntValue(1).AsReadOnly(), (IntValue)new IntValue(2).AsReadOnly() }); var selectedHiddenLayerValue = (from v in validHiddenLayerValues IEnumerable rows = problemData.TrainingIndices; double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); if (inputMatrix.Cast().Any(x => double.IsNaN(x) || double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException("Neural network regression does not support NaN or infinity values in the input dataset.");
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestModel.cs

 r15583 public static RandomForestModel CreateClassificationModel(IClassificationProblemData problemData, int nTrees, double r, double m, int seed, out double rmsError, out double outOfBagRmsError, out double relClassificationError, out double outOfBagRelClassificationError) { return CreateClassificationModel(problemData, problemData.TrainingIndices, nTrees, r, m, seed, return CreateClassificationModel(problemData, problemData.TrainingIndices, nTrees, r, m, seed, out rmsError, out outOfBagRmsError, out relClassificationError, out outOfBagRelClassificationError); } private static void AssertInputMatrix(double[,] inputMatrix) { if (inputMatrix.Cast().Any(x => Double.IsNaN(x) || Double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException("Random forest modeling does not support NaN or infinity values in the input dataset."); }
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/TimeSeries/AutoregressiveModeling.cs

 r15583 using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; using HeuristicLab.Optimization; using HeuristicLab.Parameters; inputMatrix[i, timeOffset] = targetValues[i + problemData.TrainingPartition.Start]; if (inputMatrix.Cast().Any(x => double.IsNaN(x) || double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException("Linear regression does not support NaN or infinity values in the input dataset.");
• ## trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/kMeans/KMeansClustering.cs

 r15583 int[] xyc; double[,] inputMatrix = dataset.ToArray(allowedInputVariables, rows); if (inputMatrix.Cast().Any(x => double.IsNaN(x) || double.IsInfinity(x))) if (inputMatrix.ContainsNanInf()) throw new NotSupportedException("k-Means clustering does not support NaN or infinity values in the input dataset.");
Note: See TracChangeset for help on using the changeset viewer.