Changeset 16086
- Timestamp:
- 08/23/18 09:56:09 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NearestNeighbour/NearestNeighbourModel.cs
r15786 r16086 130 130 // automatic determination of weights (all features should have variance = 1) 131 131 this.weights = this.allowedInputVariables 132 .Select(name => 1.0 / dataset.GetDoubleValues(name, rows).StandardDeviationPop()) 132 .Select(name => { 133 var pop = dataset.GetDoubleValues(name, rows).StandardDeviationPop(); 134 return pop.IsAlmost(0) ? 1.0 : 1.0/pop; 135 }) 133 136 .Concat(new double[] { 1.0 }) // no scaling for target variable 134 137 .ToArray();
Note: See TracChangeset
for help on using the changeset viewer.