Changeset 6719 for trunk/sources/HeuristicLab.Algorithms.DataAnalysis
- Timestamp:
- 09/08/11 11:31:45 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegression.cs
r6649 r6719 155 155 throw new NotSupportedException("Neural network regression does not support NaN or infinity values in the input dataset."); 156 156 157 double targetMin = problemData.Dataset.GetEnumeratedVariableValues(targetVariable).Min();158 targetMin = targetMin - targetMin * 0.1; // -10%159 double targetMax = problemData.Dataset.GetEnumeratedVariableValues(targetVariable).Max();160 targetMax = targetMax + targetMax * 0.1; // + 10%161 162 157 alglib.multilayerperceptron multiLayerPerceptron = null; 163 158 if (nLayers == 0) { 164 alglib.mlpcreate r0(allowedInputVariables.Count(), 1, targetMin, targetMax, out multiLayerPerceptron);159 alglib.mlpcreate0(allowedInputVariables.Count(), 1, out multiLayerPerceptron); 165 160 } else if (nLayers == 1) { 166 alglib.mlpcreate r1(allowedInputVariables.Count(), nHiddenNodes1, 1, targetMin, targetMax, out multiLayerPerceptron);161 alglib.mlpcreate1(allowedInputVariables.Count(), nHiddenNodes1, 1, out multiLayerPerceptron); 167 162 } else if (nLayers == 2) { 168 alglib.mlpcreate r2(allowedInputVariables.Count(), nHiddenNodes1, nHiddenNodes2, 1, targetMin, targetMax, out multiLayerPerceptron);163 alglib.mlpcreate2(allowedInputVariables.Count(), nHiddenNodes1, nHiddenNodes2, 1, out multiLayerPerceptron); 169 164 } else throw new ArgumentException("Number of layers must be zero, one, or two.", "nLayers"); 170 165 alglib.mlpreport rep; … … 177 172 178 173 rmsError = alglib.mlprmserror(multiLayerPerceptron, inputMatrix, nRows); 179 avgRelError = alglib.mlpavgrelerror(multiLayerPerceptron, inputMatrix, nRows); 174 avgRelError = alglib.mlpavgrelerror(multiLayerPerceptron, inputMatrix, nRows); 180 175 181 176 return new NeuralNetworkRegressionSolution((IRegressionProblemData)problemData.Clone(), new NeuralNetworkModel(multiLayerPerceptron, targetVariable, allowedInputVariables));
Note: See TracChangeset
for help on using the changeset viewer.