Add AdaBoostPy
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
#include "AdaBoost.h"
|
||||
#include "AdaBoostPy.h"
|
||||
|
||||
namespace pywrap {
|
||||
AdaBoost::AdaBoost() : PyClassifier("sklearn.ensemble", "AdaBoostClassifier", true)
|
||||
AdaBoostPy::AdaBoostPy() : PyClassifier("sklearn.ensemble", "AdaBoostClassifier", true)
|
||||
{
|
||||
validHyperparameters = { "n_estimators", "n_jobs", "random_state" };
|
||||
}
|
||||
int AdaBoost::getNumberOfEdges() const
|
||||
int AdaBoostPy::getNumberOfEdges() const
|
||||
{
|
||||
return callMethodSumOfItems("get_n_leaves");
|
||||
}
|
||||
int AdaBoost::getNumberOfStates() const
|
||||
int AdaBoostPy::getNumberOfStates() const
|
||||
{
|
||||
return callMethodSumOfItems("get_depth");
|
||||
}
|
||||
int AdaBoost::getNumberOfNodes() const
|
||||
int AdaBoostPy::getNumberOfNodes() const
|
||||
{
|
||||
return callMethodSumOfItems("node_count");
|
||||
}
|
@@ -1,12 +1,12 @@
|
||||
#ifndef ADABOOST_H
|
||||
#define ADABOOST_H
|
||||
#ifndef ADABOOSTPY_H
|
||||
#define ADABOOSTPY_H
|
||||
#include "PyClassifier.h"
|
||||
|
||||
namespace pywrap {
|
||||
class AdaBoost : public PyClassifier {
|
||||
class AdaBoostPy : public PyClassifier {
|
||||
public:
|
||||
AdaBoost();
|
||||
~AdaBoost() = default;
|
||||
AdaBoostPy();
|
||||
~AdaBoostPy() = default;
|
||||
int getNumberOfEdges() const override;
|
||||
int getNumberOfStates() const override;
|
||||
int getNumberOfNodes() const override;
|
@@ -4,5 +4,5 @@ include_directories(
|
||||
${PyClassifiers_SOURCE_DIR}/lib/json/include
|
||||
${Bayesnet_INCLUDE_DIRS}
|
||||
)
|
||||
add_library(PyClassifiers ODTE.cc STree.cc SVC.cc RandomForest.cc XGBoost.cc AdaBoost.cc PyClassifier.cc PyWrap.cc)
|
||||
add_library(PyClassifiers ODTE.cc STree.cc SVC.cc RandomForest.cc XGBoost.cc AdaBoostPy.cc PyClassifier.cc PyWrap.cc)
|
||||
target_link_libraries(PyClassifiers nlohmann_json::nlohmann_json ${Python3_LIBRARIES} "${TORCH_LIBRARIES}" ${LIBTORCH_PYTHON} Boost::boost Boost::python Boost::numpy)
|
Reference in New Issue
Block a user