From d3cb580387400c770df35dff7bdfb4452aa775cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Fri, 17 Nov 2023 10:10:31 +0100 Subject: [PATCH] Remove n_jobs from STree --- src/PyClassifiers/PyWrap.cc | 5 ++--- src/PyClassifiers/STree.cc | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/PyClassifiers/PyWrap.cc b/src/PyClassifiers/PyWrap.cc index a50c89e..836bcd3 100644 --- a/src/PyClassifiers/PyWrap.cc +++ b/src/PyClassifiers/PyWrap.cc @@ -61,7 +61,6 @@ namespace pywrap { void PyWrap::clean(const clfId_t id) { // Remove Python interpreter if no more modules imported left - // std::cout << "*Cleaning module " << id << std::endl; std::lock_guard lock(mutex); auto result = moduleClassMap.find(id); if (result == moduleClassMap.end()) { @@ -75,11 +74,11 @@ namespace pywrap { PyErr_Print(); errorAbort("Error cleaning module "); } + // With boost you can't remove the interpreter + // https://www.boost.org/doc/libs/1_83_0/libs/python/doc/html/tutorial/tutorial/embedding.html#tutorial.embedding.getting_started // if (moduleClassMap.empty()) { // RemoveInstance(); - // std::cout << "*Python interpreter cleaned" << std::endl; // } - // std::cout << "*Module " << id << " cleaned" << std::endl; } void PyWrap::errorAbort(const std::string& message) { diff --git a/src/PyClassifiers/STree.cc b/src/PyClassifiers/STree.cc index 1405ed7..db864bf 100644 --- a/src/PyClassifiers/STree.cc +++ b/src/PyClassifiers/STree.cc @@ -8,7 +8,7 @@ namespace pywrap { void STree::setHyperparameters(nlohmann::json& hyperparameters) { // Check if hyperparameters are valid - const std::vector validKeys = { "C", "n_jobs", "kernel", "max_iter", "max_depth", "random_state", "multiclass_strategy" }; + const std::vector validKeys = { "C", "kernel", "max_iter", "max_depth", "random_state", "multiclass_strategy" }; checkHyperparameters(validKeys, hyperparameters); this->hyperparameters = hyperparameters; }