Add nodes/leaves/depth to STree & ODTE

This commit is contained in:
2023-11-27 10:57:57 +01:00
parent 4fefe9a1d2
commit 82964190f6
8 changed files with 53 additions and 2 deletions

View File

@@ -110,6 +110,21 @@ namespace pywrap {
Py_XDECREF(result);
return value;
}
int PyWrap::callMethodInt(const clfId_t id, const std::string& method)
{
PyObject* instance = getClass(id);
PyObject* result;
try {
if (!(result = PyObject_CallMethod(instance, method.c_str(), NULL)))
errorAbort("Couldn't call method " + method);
}
catch (const std::exception& e) {
errorAbort(e.what());
}
int value = PyLong_AsLong(result);
Py_XDECREF(result);
return value;
}
std::string PyWrap::sklearnVersion()
{
return "1.0";