Refactor Hyperparameters management
This commit is contained in:
@@ -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 */
|
Reference in New Issue
Block a user