From fe32ed4b2ae8c4d09b408fe02201df9d4c4d440e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Thu, 15 Dec 2022 12:12:44 +0100 Subject: [PATCH] Update algorithm type to compute cut points --- samples/sample.cpp | 2 +- src/cppmdlp | 2 +- src/fimdlp/_version.py | 2 +- src/fimdlp/cfimdlp.pyx | 2 +- src/fimdlp/mdlp.py | 7 ++++++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/samples/sample.cpp b/samples/sample.cpp index d838bb9..9f18db0 100644 --- a/samples/sample.cpp +++ b/samples/sample.cpp @@ -41,7 +41,7 @@ int main(int argc, char** argv) } cout << y[i] << endl; } - mdlp::CPPFImdlp test = mdlp::CPPFImdlp(false); + mdlp::CPPFImdlp test = mdlp::CPPFImdlp(0); for (auto i = 0; i < attributes.size(); i++) { cout << "Cut points for " << get<0>(attributes[i]) << endl; cout << "--------------------------" << setprecision(3) << endl; diff --git a/src/cppmdlp b/src/cppmdlp index e214829..50543e4 160000 --- a/src/cppmdlp +++ b/src/cppmdlp @@ -1 +1 @@ -Subproject commit e21482900bdf307c50b0e0b0647458cf2bb32ad5 +Subproject commit 50543e492125754875becba45d1bd7d66ac88a7a diff --git a/src/fimdlp/_version.py b/src/fimdlp/_version.py index d69d16e..a2fecb4 100644 --- a/src/fimdlp/_version.py +++ b/src/fimdlp/_version.py @@ -1 +1 @@ -__version__ = "0.9.1" +__version__ = "0.9.2" diff --git a/src/fimdlp/cfimdlp.pyx b/src/fimdlp/cfimdlp.pyx index c831389..83812ac 100644 --- a/src/fimdlp/cfimdlp.pyx +++ b/src/fimdlp/cfimdlp.pyx @@ -6,7 +6,7 @@ from libcpp cimport bool cdef extern from "../cppmdlp/CPPFImdlp.h" namespace "mdlp": ctypedef float precision_t cdef cppclass CPPFImdlp: - CPPFImdlp(bool) except + + CPPFImdlp(int) except + CPPFImdlp& fit(vector[precision_t]&, vector[int]&) vector[precision_t] getCutPoints() diff --git a/src/fimdlp/mdlp.py b/src/fimdlp/mdlp.py index b8f11e7..86441e7 100644 --- a/src/fimdlp/mdlp.py +++ b/src/fimdlp/mdlp.py @@ -7,7 +7,7 @@ from joblib import Parallel, delayed class FImdlp(TransformerMixin, BaseEstimator): - def __init__(self, n_jobs=-1, proposal=False): + def __init__(self, n_jobs=-1, proposal=0): self.n_jobs = n_jobs self.proposal = proposal @@ -19,6 +19,11 @@ class FImdlp(TransformerMixin, BaseEstimator): The number of jobs to run in parallel. :meth:`fit` and :meth:`transform`, are parallelized over the features. ``-1`` means using all cores available. + proposal : int, default=0 + The type of algorithm to use computing the cut points. + 0 - Normal implementation + 1 - JA Proposal + 2 - Original proposal Attributes ----------