Drools 5144 - Refactor PMML Decision Tree (#2836)

* [DROOLS-4933] Scheleton implementation.

* [DROOLS-4933] Add UMLs

* [DROOLS-4933] Refactor module layout to include KiePMMLRuntime implementation

* [DROOLS-4933] Refactoring

* [DROOLS_4933] Begin Regression model runtime implementation

* [DROOLS-4933] Implemented regression model test

* [DROOLS-4933] Add models

* [DROOLS-4933] Add PMML compiler test

* [DROOLS-4933] Implemented compiler and assembler, with tests

* [DROOLS-4933] Switched version. Moved ResourceHelper to kie-test-util package

* [DROOLS-4933] Implemented integration test module. Full roundtrip test for linear regression

* [DROOLS-4933] Implementing full roundtrip test with full kie integration - test not working

* [DROOLS-4933] Implementing PMMLWeaverService. Fixing integration test setup

* [DROOLS-4933] Begin implementation of drools-based Tree model

* [DROOLS-4933] Fixing old KieBaseTest

* [DROOLS-4933] Begin implementation of Tree model with tests

* [DROOLS-4933] Keep going with implementation of Tree model and tests

* [DROOLS-4933] Renaming previous implementation to kie-pmml-legacy. Updating dependant modules to reflect that

* [DROOLS-4933] Fixing linear regression roundtrip test. Implementing finder

* [DROOLS-4933] Commenting execution logic from Tree model. Begin model test implementation

* [DROOLS-4933] Done TreeModelImplementationProviderTest stub. Add True/False predicates.

* [DROOLS-4933] First TreeModel (drools) iteration done with empty rule

* [DROOLS-4933] TreeModel (drools) iteration done with golfing model example test

* [DROOLS-4933] Refactored builders. Begin MiningModel implementation

* [DROOLS-4933] Keep working on MiningModel implementation

* [DROOLS-4933] Begin kie-pmml-mining model

* [DROOLS-4933] Cleanup poms

* [DROOLS-4933] Created pmml-models archetype

* [DROOLS-4933] Created pmml-model-mining

* [DROOLS-4933] Refactoring

* [DROOLS-4933] Created pmml-runtime archetype

* [DROOLS-4933] Created pmml-runtime-mining

* [DROOLS-4933] Implemented library-commons module

* [DROOLS-4933] Refactored log. Keep working on mining model.

* [DROOLS-4933] Fixing archetypes' poms

* [DROOLS-4933] Add Tree model overall implementation strategy description

* [DROOLS-4933] Refactored log. Updated implementation.md

* [DROOLS-4933] First implmentation of KiePMMLDescrFactory

* [DROOLS-4933] Refactoring - reorganizing modules

* [DROOLS-4933] Fixed refactoring - Tree runtime broken

* [DROOLS-4933] Keep refactoring - moved models

* [DROOLS-4933] Adapting archetype. Not completely working

* [DROOLS-4933] Renamed kie-pmml to kie-pmml-refactoring

* [DROOLS-4933] Restored kie-pmml-legacy to kie-pmml

* [DROOLS-4933] Create PMML refactoring skeleton

* [DROOLS-4933] Add test utility methods. Fixed pom

* [DROOLS-3339] Begin refactoring of regression model with new architecture

* [DROOLS-4933] Add tests to kie-test-util

* [DROOLS-4933] Add assertions to tests inside kie-test-util

* [DROOLS-3339] Begin Regression model implementation

* [DROOLS-3339] Add tests to IsRegressionModel. Make KiePMMLRegressionModel constructor protected

* [DROOLS-3339] Add some fixes as per sonar suggestion

* [DROOLS-4933] Format

* [DROOLS-4933] Moving kie-pmml-api to kie-pmml-commons

* [DROOLS-4933] Renamed kie-pmml-refactoring to kie-pmml-new

* [WIP] Renamed modules

* [WIP] Keep renaming/refactoring

* [DROOLS-3339] Begin test implementation

* [DROOLS-3339] Merge refactoring

* [DROOLS-3339] Merge refactoring

* [DROOLS-3339] Begin integrationg of tests from previous implementation. Refactoring predictors.

* [DROOLS-3339] Reorganizing resources in integration test. Fixing broken pmmls

* [DROOLS-3339] Fixed regression. Begin fixing classification. Add outputfields

* [DROOLS-3339] Fixed classification and add some whole-model test. Start increasing unittesting

* [DROOLS-3339] Updated name refactoring

* [DROOLS-3339] Changed log level.

* [DROOLS-3339] Sync with base pr

* [DROOLS-3339] Update version

* [DROOLS-3339] Merging master

* [DROOLS-3339] Fixing merge with master

* [DROOLS-3339] Fixing merge with master

* [DROOLS-3339] Fixing merge with master

* [DROOLS-3339] Fix merge with master

* [DROOLS-3339] Fix merge with master

* [DROOLS-3339] Fixing merge with master

* Example of simple test for whole model

* [DROOLS-3339] Implementing factories unit tests

* [DROOLS-3339] Changed outputfield - target field to Optional

* [DROOLS-3339] Add tests

* [DROOLS-3339] Refactoring kie-pmml-models-regression-api -> kie-pmml-models-regression-model

* Parameterize and polish NumericVariablesLinearRegressionTest

* [DROOLS-3339] Keep testing

* Change package name for PMML regression tests

* [DROOLS-3339] Fixing/refactoring ClassificationModelEvaluator. Implemented tests

* [DROOLS-5099] PMML tests for regression with numeric inputs

* [DROOLS-3339] Done ClassificationModelEvaluator tests

* [DROOLS-3339] Refactored RegressionModelEvaluator; add tests

* [DROOLS-3339] Implemented PMMLRegressionModelUtilsTest

* [DROOLS-3339] Implemented PMMLRegressionModelExecutorTest

* [DROOLS-3339] Implemented Predictors tests

* [DROOLS-3339] Implement PMMLRegressionModelExecutorTest

* [DROOLS-3339] Fixing Sonar remarks

* [DROOLS-3339] Fixing Sonar remarks

* [DROOLS-3339] Removed "Optional" properties from model

* [DROOLS-5099] Tests for logistic regression

* [DROOLS-5099] Test also probabilities in logistic regression

* [DROOLS-3339] Simplify abstract hierarchy. Removing "Serializable" interfaces

* [DROOLS-3339] Simplify abstract hierarchy. Removing "Serializable" interfaces

* [DROOLS-3339] Fixed as per PR suggestions

* [DROOLS-5099] Test for normalization methods in regression

* [DROOLS-5099] WIP: Test logistic regression normalization methods

* [DROOLS-5099] Finish test for logistic regression normalization methods

* [DROOLS-5099] Improve PMML loading

* [DROOLS-3339] Generating RegressionTable source

* [DROOLS-3339] Compiling generated classes. Returned new instance of generated model

* [DROOLS-3339] Test working

* [DROOLS-3339] Fixing ClassificationTableTemplate - add missing import

* [DROOLS-3339] Begin benchmark implementation

* [DROOLS-3339] Updated codegen benchmark

* [DROOLS-3339] Refactoring inner compiler

* [DROOLS-3339] Refactoring inner compiler

* [DROOLS-3339] Keep working on Benchmarks

* [DROOLS-3339] Fix broken tests

* [DROOLS-3339] Fix benchmarks

* [DROOLS-3339] Fix import

* [DROOLS-3339] Fix benchmark

* [DROOLS-3339] Rename test classes. Minor fix inside Classification table generation. Remove stream from templates

* [DROOLS-5144] Bgin implementation of Tree model

* [DROOLS-3339] Fix benchmark. Fix model tests

* [DROOLS-3339] Fix as per PR suggestion

* [DROOLS-5144] Keep going with implementation of Tree model

* [DROOLS-5144] Fix poms and KiePMMLModel

* [DROOLS-5144] Refactored KiePMMLDescrFactory. Add tests

* [DROOLS-3339] Fix as per PR suggestion

* [DROOLS-3339] Missing bits. Completely remove use of optionals in factories

* [DROOLS-5144] Begin implementation of XOR

* [DROOLS-5144] Fix merge/tests

* [DROOLS-5144] Implementing XOR. Works for 2 elements, not for more.

* WIP: Tree model test module

* [DROOLS-5144] Populating PMML$Result inside drl. Implemented higher level missingValueReplacement

* [DROOLS-5144] Fixing dotted field name issue. Implementing "surrogate" compound predicate

* [DROOLS-5166] Finish tree model test for Iris data

* [DROOLS-5144] Minor refactoring in DescrFactory. Add some test

* [DROOLS-5144] Avoid automatic type inference. Surrogate still broken

* [DROOLS-5144] Avoid useless "update" call on PMML4Result. Set PPML4Result as global variable

* [DROOLS-5144] Update version

* [DROOLS-5166] Tree model test for Boston housing data

* [DROOLS-5166] Test for classification using simple tree

* [DROOLS-5166] Test for return last prediction strategy in trees

* [DROOLS-5166] Test for compound predicates in trees

* [DROOLS-5166] Test for simple set predicate in trees

* [DROOLS-5144] Implemented KiePMML drool' specific AST. Implemented TreeModel AST factory

* [DROOLS-5144] Refactored AST and Descr factories. Some integration test still failing

* [DROOLS-5144] Implementing SimpleSetPredicate.

* [DROOLS-5144] Implementing Surrogate predicates with agenda-group/activation-group.

* [DROOLS-5144] Refactored integration tests to avoid multiple model parsing/compilation for same test class

* [DROOLS-5144] Fixing PR comments

* [DROOLS-5144] Removed StringBuilder. Fixing correct type format for values and returns

* [DROOLS-5144] Integration tests running (without OutputField). Begin implementation of OutputFields

* [DROOLS-5144] Integration tests running withOutputField. Implemented OutputField (currently only predictedValue managed)

* [DROOLS-5144] Add "Release.md" file

* [DROOLS-5144] Fixed unit tests

* [DROOLS-5144] Minor cleanup

* [DROOLS-5144] Fix as per Sonar suggestion

* [DROOLS-5144] Refactored StatusCode to ResultCode. Moved "DONE" as String constant. Fixed som Sonar complains

* [DROOLS-5144] Storing missing values replaced inside PMMLContext

* [DROOLS-5144] Removing unused fields/classes

* [DROOLS-5144] Fix switches with illegal cases

* [DROOLS-5144] Refactor implementation for targetfields. Add javadoc

* [DROOLS-5144] Replaced Queue with List

* [DROOLS-5144] Autoformat sources

* [DROOLS-5144] Refactor overall drools-related models layout

* [DROOLS-5144] Package renaming

* [DROOLS-5144] Replaced Drooled with Drools

* [DROOLS-5144] Refactor agendaEventListener as private stataic final field

* [DROOLS-5144] Replaced use of "toString" with "getConstraintsAsString"

* [DROOLS-5144] Updated version. Isolated KieSession access inside KiePMMLSessionUtils

* [DROOLS-5144] Lowered logger level to trace

* [DROOLS-5144] Refactor due to PR comments

Co-authored-by: Jiri Petrlik <jiripetrlik@gmail.com>