mirror of
https://github.com/Doctorado-ML/FImdlp.git
synced 2025-08-18 08:55:51 +00:00
Update discretizer to new library
This commit is contained in:
Submodule src/cppmdlp updated: 32a6fd9ba0...964555de20
@@ -3,18 +3,22 @@
|
|||||||
from libcpp.vector cimport vector
|
from libcpp.vector cimport vector
|
||||||
from libcpp.string cimport string
|
from libcpp.string cimport string
|
||||||
|
|
||||||
|
cdef extern from "limits.h":
|
||||||
|
cdef int INT_MAX
|
||||||
cdef extern from "../cppmdlp/CPPFImdlp.h" namespace "mdlp":
|
cdef extern from "../cppmdlp/CPPFImdlp.h" namespace "mdlp":
|
||||||
ctypedef float precision_t
|
ctypedef float precision_t
|
||||||
cdef cppclass CPPFImdlp:
|
cdef cppclass CPPFImdlp:
|
||||||
CPPFImdlp() except +
|
CPPFImdlp() except +
|
||||||
|
CPPFImdlp(int, int) except +
|
||||||
CPPFImdlp& fit(vector[precision_t]&, vector[int]&)
|
CPPFImdlp& fit(vector[precision_t]&, vector[int]&)
|
||||||
|
int get_depth()
|
||||||
vector[precision_t] getCutPoints()
|
vector[precision_t] getCutPoints()
|
||||||
string version()
|
string version()
|
||||||
|
|
||||||
cdef class CFImdlp:
|
cdef class CFImdlp:
|
||||||
cdef CPPFImdlp *thisptr
|
cdef CPPFImdlp *thisptr
|
||||||
def __cinit__(self):
|
def __cinit__(self, int min_length=3, int max_depth=INT_MAX):
|
||||||
self.thisptr = new CPPFImdlp()
|
self.thisptr = new CPPFImdlp(min_length, max_depth)
|
||||||
def __dealloc__(self):
|
def __dealloc__(self):
|
||||||
del self.thisptr
|
del self.thisptr
|
||||||
def fit(self, X, y):
|
def fit(self, X, y):
|
||||||
@@ -24,6 +28,8 @@ cdef class CFImdlp:
|
|||||||
return self.thisptr.getCutPoints()
|
return self.thisptr.getCutPoints()
|
||||||
def get_version(self):
|
def get_version(self):
|
||||||
return self.thisptr.version()
|
return self.thisptr.version()
|
||||||
|
def get_depth(self):
|
||||||
|
return self.thisptr.get_depth()
|
||||||
def __reduce__(self):
|
def __reduce__(self):
|
||||||
return (CFImdlp, ())
|
return (CFImdlp, ())
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user