Changeset 12661 for branches/GBT-trunkintegration/Tests
- Timestamp:
- 07/07/15 17:58:01 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GBT-trunkintegration/Tests/Test.cs
r12658 r12661 76 76 {-1.5, 20, 1}, 77 77 {-1.5, 20, -1}, 78 { 0.5, 20, -1},78 {-0.5, 20, -1}, 79 79 {0.5, 10, -1}, 80 80 {1.5, 10, -1}, … … 257 257 258 258 #region helper 259 private void BuildTree(double[,] xy, string[] allVariables, int max Depth) {259 private void BuildTree(double[,] xy, string[] allVariables, int maxSize) { 260 260 int nRows = xy.GetLength(0); 261 261 var allowedInputs = allVariables.Skip(1); … … 266 266 problemData.TestPartition.Start = nRows; 267 267 problemData.TestPartition.End = nRows; 268 var rand = new MersenneTwister(31415); 269 var builder = new RegressionTreeBuilder(problemData, rand); 270 var model = (GradientBoostedTreesModel)builder.CreateRegressionTree(maxDepth, 1, 1); // maximal depth and use all rows and cols 268 var solution = GradientBoostedTreesAlgorithmStatic.TrainGbm(problemData, new SquaredErrorLoss(), maxSize, nu: 1, r: 1, m: 1, maxIterations: 1, randSeed: 31415); 269 var model = (GradientBoostedTreesModel)solution.Model; 271 270 var treeM = model.Models.Skip(1).First() as RegressionTreeModel; 272 271
Note: See TracChangeset
for help on using the changeset viewer.