37 using RetType = std::conditional_t<
38 std::is_same_v<T,Reg>, ArrayXf,
39 std::conditional_t<std::is_same_v<T,Cls>,
ArrayXb,
40 std::conditional_t<std::is_same_v<T,MCls>,
ArrayXi, ArrayXXf>>>;
42 py::class_<T>
engine(m, name.data() );
47 .def_property(
"params", &T::get_params, &T::set_params)
48 .def_property_readonly(
"is_fitted", &T::get_is_fitted)
49 .def_property_readonly(
"best_ind", &T::get_best_ind)
52 static_cast<T &(T::*)(
Dataset &
d)
>(&T::fit),
53 py::call_guard<py::gil_scoped_release>(),
54 "fit from Dataset object")
57 py::call_guard<py::gil_scoped_release>(),
60 static_cast<RetType (T::*)(
const Dataset &
d)
>(&T::predict),
61 "predict from Dataset object")
64 "predict from X data")
65 .
def(
"predict_archive",
66 static_cast<RetType (T::*)(
int id,
const Dataset &
d)
>(&T::predict_archive),
67 "predict from individual in archive")
68 .
def(
"predict_archive",
70 "predict from individual in archive")
71 .
def(
"get_archive", &T::get_archive, py::arg(
"front") =
false)
87 if constexpr (std::is_same_v<T,Cls>)
89 engine.def(
"predict_proba",
90 static_cast<ArrayXf (T::*)(
const Dataset &
d)
>(&T::predict_proba),
91 "predict from Dataset object")
94 "predict from X data")
95 .
def(
"predict_proba_archive",
96 static_cast<ArrayXf (T::*)(
int id,
const Dataset &
d)
>(&T::predict_proba_archive),
97 "predict from individual in archive")
98 .
def(
"predict_proba_archive",
100 "predict from individual in archive")