Refactor Hyperparameters management

This commit is contained in:
2023-11-19 22:36:27 +01:00
parent 89c4613591
commit 4f3a04058f
21 changed files with 1070 additions and 78 deletions

View File

@@ -1,15 +1,12 @@
#include "STree.h"
namespace pywrap {
STree::STree() : PyClassifier("stree", "Stree")
{
validHyperparameters = { "C", "kernel", "max_iter", "max_depth", "random_state", "multiclass_strategy", "gamma", "max_features", "degree" };
};
std::string STree::graph()
{
return callMethodString("graph");
}
void STree::setHyperparameters(const nlohmann::json& hyperparameters)
{
// Check if hyperparameters are valid
const std::vector<std::string> validKeys = { "C", "kernel", "max_iter", "max_depth", "random_state", "multiclass_strategy" };
checkHyperparameters(validKeys, hyperparameters);
this->hyperparameters = hyperparameters;
}
} /* namespace pywrap */