Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README/ReleaseNotes/v642/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ The following people have contributed to this new version:
* The inclusion by external projects of Makefile templates contained within ROOT is deprecated in 6.42, a warning will be raised if you use them. These files will be removed in ROOT 7.
* The conversion from Python set to **RooArgSet** is deprecated and won't work anymore in ROOT 6.44. The problem is that Python sets are unordered while RooArgSets are ordered, and this mismatch can lead to subtle problems later on. Prefer conversion from Python lists or tuples, which are ordered too.
* The ROOT IO capability for the `TMVA::Experimental::SOFIE::RModel` has been removed. Users should not be encouraged to serialize models in experimental classes. For the serialization of ONNX models one can already use ONNX directly, and even serialize the ONNX bytes to a ROOT file if required.
* The ROOT IO capability for the `TMVA::Experimental::RBDT` class has been removed, along with the `TMVA.Experimental.SaveXGBoost` Python function. Users should not be encouraged to serialize models in experimental classes. An `RBDT` is now built directly from an XGBoost model in its native JSON serialization with the new `TMVA::Experimental::RBDT::LoadXGBoost(jsonPath)`, which works both from C++ and Python. To convert a trained model, save it first with XGBoost's `Booster.save_model("model.json")` and then load it with `LoadXGBoost`.
* The **JsMVA** feature for interactive TMVA training in Jupyter notebooks is now removed. It was not functional for years and was therefore already excluded from ROOT 6.38. This also removes the `TMVA::IPythonInteractive` class and the related interactive-training interfaces from the TMVA method and fitter classes, such as `MethodBase::ExitFromTraining()` or `FitterBase::SetIPythonInteractive()`.
* The **RooStats::DebuggingSampler** and **RooStats::DebuggingTestStat** classes are removed. They were mock implementations of the `TestStatSampler` and `TestStatistic` interfaces that returned uniform random numbers independent of the data, only meant for debugging the RooStats framework itself during its initial development.

Expand Down
1 change: 0 additions & 1 deletion bindings/pyroot/pythonizations/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ if(tmva)
ROOT/_pythonization/_tmva/__init__.py
ROOT/_pythonization/_tmva/_rbdt.py
ROOT/_pythonization/_tmva/_rtensor.py
ROOT/_pythonization/_tmva/_tree_inference.py
ROOT/_pythonization/_tmva/_utils.py
ROOT/_pythonization/_tmva/_gnn.py
ROOT/_pythonization/_tmva/_sofie/_parser/_keras/__init__.py
Expand Down
2 changes: 0 additions & 2 deletions bindings/pyroot/pythonizations/python/ROOT/_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,13 +567,11 @@ def TMVA(self):
from ._pythonization._tmva._rtensor import _AsRTensor
from ._pythonization._tmva._sofie._parser._keras.parser import PyKeras
from ._pythonization._tmva._sofie._parser._pytorch.parser import PyTorch
from ._pythonization._tmva._tree_inference import SaveXGBoost

setattr(ns.Experimental.SOFIE, "PyKeras", PyKeras)
setattr(ns.Experimental.SOFIE, "PyTorch", PyTorch)

ns.Experimental.AsRTensor = _AsRTensor
ns.Experimental.SaveXGBoost = SaveXGBoost
except ImportError:
# _tmva submodule not available (expected for tmva=OFF)
pass
Expand Down

This file was deleted.

2 changes: 2 additions & 0 deletions tmva/tmva/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ ROOT_STANDARD_LIBRARY_PACKAGE(TMVAUtils

${EXTRA_DICT_OPTS}
)
# RBDT::LoadXGBoost parses the XGBoost native JSON serialization.
target_link_libraries(TMVAUtils PRIVATE nlohmann_json::nlohmann_json)
endif()

ROOT_ADD_TEST_SUBDIRECTORY(test)
Expand Down
5 changes: 0 additions & 5 deletions tmva/tmva/inc/LinkDefUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@

#pragma link C++ nestedclass;

#ifdef R__HAS_DATAFRAME
// BDT inference
#pragma link C++ class TMVA::Experimental::RBDT+;
#endif

// RTensor will have its own streamer function
#pragma link C++ class TMVA::Experimental::RTensor<float,std::vector<float>>-;

Expand Down
13 changes: 2 additions & 11 deletions tmva/tmva/inc/TMVA/RBDT.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#ifndef TMVA_RBDT
#define TMVA_RBDT

#include <Rtypes.h>
#include <ROOT/RSpan.hxx>
#include <TMVA/RTensor.hxx>

Expand All @@ -38,12 +37,9 @@ class RBDT final {
public:
typedef float Value_t;

/// IO constructor (both for ROOT IO and LoadText()).
/// Default constructor, used by the LoadXGBoost() factory.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since a default-constructed RBDT on its own doesn't make much sense, maybe this is a good opportunity to reorganize the class such that LoadXGBoost is the only entry point to create an RBDT. Then there could be a private constructor taking all the arguments to fill the class data members.

RBDT() = default;

/// Construct backends from model in ROOT file.
RBDT(const std::string &key, const std::string &filename);

/// Compute model prediction on a single event.
///
/// The method is intended to be used with std::vectors-like containers,
Expand All @@ -62,8 +58,7 @@ public:

RTensor<Value_t> Compute(RTensor<Value_t> const &x) const;

static RBDT LoadText(std::string const &txtpath, std::vector<std::string> &features, int nClasses, bool logistic,
Value_t baseScore);
static RBDT LoadXGBoost(std::string const &jsonPath);

private:
/// Map from XGBoost to RBDT indices.
Expand All @@ -75,8 +70,6 @@ private:
static void correctIndices(std::span<int> indices, IndexMap const &nodeIndices, IndexMap const &leafIndices);
static void terminateTree(TMVA::Experimental::RBDT &ff, int &nPreviousNodes, int &nPreviousLeaves,
IndexMap &nodeIndices, IndexMap &leafIndices, int &treesSkipped);
static RBDT
LoadText(std::istream &is, std::vector<std::string> &features, int nClasses, bool logistic, Value_t baseScore);

std::vector<int> fRootIndices;
std::vector<unsigned int> fCutIndices;
Expand All @@ -88,8 +81,6 @@ private:
std::vector<Value_t> fBaseResponses;
Value_t fBaseScore = 0.0;
bool fLogistic = false;

ClassDefNV(RBDT, 1);
};

} // namespace Experimental
Expand Down
Loading
Loading