Changeset 15437 for branches/MCTS-SymbReg-2796/Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/MctsSymbolicRegressionTest.cs
- Timestamp:
- 10/27/17 18:42:04 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MCTS-SymbReg-2796/Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/MctsSymbolicRegressionTest.cs
r15426 r15437 535 535 } 536 536 { 537 // possible solutions with max 4 variable references: 538 // without exp, log and inv 539 // x 540 // x*x 541 // x*x*x 542 // x+x*x 543 // x+x*x*x 544 // x*x*x*x 545 546 TestMctsNumberOfSolutions(regProblem, 4, 6, allowLog: false, allowInv: false, allowExp: false); 547 } 548 { 549 // possible solutions with max 5 variable references: 550 // without exp, log and inv 551 // x 552 // xx 553 // xxx 554 // x+xx 555 // xxxx 556 // x+xxx 557 // xxxxx 558 // x+xxxx 559 // xx+xxx 560 TestMctsNumberOfSolutions(regProblem, 5, 9, allowLog: false, allowInv: false, allowExp: false); 561 } 562 { 537 563 // possible solutions with max two variable references: 538 // TODO: equal terms should not be allowed (see ConstraintHandler)539 564 // x 540 // log(x )565 // log(x+c) 541 566 // exp(x) 542 // 1/ x567 // 1/(x+c) 543 568 // -- 4 544 569 // x * x 545 // x * log(x )570 // x * log(x+c) 546 571 // x * exp(x) 547 // x * 1/x 548 // x + x ? 549 // x + log(x) 572 // x * 1/(x + c) 573 // x + log(x+c) 550 574 // x + exp(x) 551 // x + 1/ x552 // -- 8553 // log(x ) * log(x)554 // log(x ) * exp(x)555 // log(x ) * 1/x556 // log(x ) + log(x) ?557 // log(x ) + exp(x) ?558 // log(x ) + 1/x575 // x + 1/(x+c) 576 // -- 7 577 // log(x + c) * log(x + c) 578 // log(x + c) * exp(x) 579 // log(x + c) * 1/(x + c) 580 // log(x + c) + log(x + c) // TODO 581 // log(x + c) + exp(x) 582 // log(x + c) + 1/(x+c) 559 583 // -- 6 560 // exp(x) * exp(x) 561 // exp(x) * 1/x 562 // exp(x) + exp(x) ? 563 // exp(x) + 1/x 564 // -- 4 565 // 1/x * 1/x 566 // 1/x + 1/x ? 584 // exp(x) * 1/(x+c) 585 // exp(cx) + exp(cx) // TODO 586 // exp(cx) + 1/(x+c) 587 // -- 3 588 // 1/(x+c) * 1/(x+c) // TODO 589 // 1/(x+c) + 1/(x+c) // TODO 567 590 // -- 2 568 // log(x+x) ?569 591 // log(x*x) 570 592 // exp(x*x) 571 // 1/(x+x) ? 572 // 1/(x*x) 573 // -- 5 574 575 576 TestMctsNumberOfSolutions(regProblem, 2, 29); 593 // inv(x*x+c) 594 // -- 3 595 596 597 TestMctsNumberOfSolutions(regProblem, 2, 27); 577 598 } 578 599 { … … 616 637 // -- 1 617 638 TestMctsNumberOfSolutions(regProblem, 3, 2 + 7 + 13 + 3 + 2 + 1, allowLog: false, allowInv: false); 618 } 619 { 620 // possible solutions with max 4 variable references: 621 // without exp, log and inv 622 // x 623 // x*x 624 // x+x ? 625 // x*x*x 626 // x+x*x 627 // x+x+x ? 628 // x*x*x*x 629 // x+x*x*x 630 // x*x+x*x ? 631 // x+x+x*x ? 632 // x+x+x+x ? 633 634 TestMctsNumberOfSolutions(regProblem, 4, 11, allowLog: false, allowInv: false, allowExp: false); 635 } 636 { 637 // possible solutions with max 5 variable references: 638 // without exp, log and inv 639 // x 640 // xx 641 // x+x ? 642 // xxx 643 // x+xx 644 // x+x+x ? 645 // xxxx 646 // x+xxx 647 // xx+xx ? 648 // x+x+xx ? 649 // x+x+x+x ? 650 // xxxxx 651 // x+xxxx 652 // xx+xxx 653 // x+x+xxx ? 654 // x+xx+xx ? 655 // x+x+x+xx ? 656 // x+x+x+x+x ? 657 TestMctsNumberOfSolutions(regProblem, 5, 18, allowLog: false, allowInv: false, allowExp: false); 658 } 639 } 659 640 } 660 641 … … 1384 1365 mctsSymbReg.ConstantOptimizationIterations = -1; 1385 1366 1386 // random policy1387 // var epsPolicy = new EpsilonGreedy();1388 // epsPolicy.Eps = 1.0;1389 // mctsSymbReg.Policy = epsPolicy;1390 1391 // UCB tuned1392 var ucbTuned = new UcbTuned();1393 ucbTuned.C = 1;1394 mctsSymbReg.Policy = ucbTuned;1395 1396 1367 1397 1368 #endregion … … 1421 1392 mctsSymbReg.Iterations = int.MaxValue; // stopping when all solutions have been enumerated 1422 1393 mctsSymbReg.MaxVariableReferences = maxNumberOfVariables; 1423 var ucbPolicy = new Ucb();1424 ucbPolicy.C = 1000; // essentially breadth first search1425 mctsSymbReg.Policy = ucbPolicy;1426 1394 mctsSymbReg.AllowedFactors.SetItemCheckedState(mctsSymbReg.AllowedFactors.Single(s => s.Value.StartsWith("x * y * ...")), allowProd); 1427 1395 mctsSymbReg.AllowedFactors.SetItemCheckedState(mctsSymbReg.AllowedFactors.Single(s => s.Value.Contains("exp(c * x * y ...)")), allowExp);
Note: See TracChangeset
for help on using the changeset viewer.