Skip to content

Conversation

@behrenhoff
Copy link
Contributor

@behrenhoff behrenhoff commented Apr 13, 2019

Please have a look at this simplification commit.

I am not 100% happy with the new names I have introduced.

A similiar commit should be made for Classification as well. The EvaluateAllMethods functions is still a monster.

As for the modification in the AdaBoost: that is the only untested change in this commit (please test the change).

For easier reviewing, I have separated this pull in 4 commits. The clang-format just changes whitespace. The main commit is "[TMVA] Simplify code for regression summary".

Why this commit?
##############
Reason was the wrong order of results. There were not ordered by RMS. Looking at the code revealed the mess :-)

Next commit will modify some files in TMVA. This commit formats the
files to be changed in the following commit.
The EvaluateAllMethods in Factory.cxx is a monster. This commit starts
a simplification for the regression methods.

Mainly, the many vectors of vectors can be replaces with a single
vector of a struct. The same struct can be used for Training/Testing,
therefore reducing code duplication.

The "UsefulSort" function (a bubble sort, used in combination with a lot
of copies of vectors) isn't needed any longer and can be replaced with
a simple std::sort.

Furthermore, the methods will now be sorted correctly. Before this
commit, the methods were sorted by absolute deviation even though
the label said "sorted by RMS". This caused a "sorted mostly correct"
effect.

To allow this, the 10-argument (9 out, 1 in) void function 'TestRegression'
has been changed to only one argument. It now returns a struct of the 9
former outout values instead.
Simplifies AdaBoostR2 code, avoids "UsefulSort..." function.
@phsft-bot
Copy link

Can one of the admins verify this patch?

@behrenhoff behrenhoff changed the title Tmva regressionoutput simplifications TMVA regressionoutput simplifications Apr 13, 2019
@behrenhoff behrenhoff changed the title TMVA regressionoutput simplifications TMVA regression output code simplification Apr 13, 2019
@eguiraud eguiraud added the stale label Mar 10, 2020
@guitargeek
Copy link
Contributor

Thank you very much for the PR! Sorry for the very late reply 🙁 The PR also has merge conflicts by now.

TMVA (all parts except for SOFIE) is in maintenance mode, so I would refrain from large scale refactoring at this point.

Thank you for your understanding, and let me know if I miss some context about why this refactor is beneficial for ROOT users!

@guitargeek guitargeek closed this Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants