diff --git a/source/evaluator.cpp b/source/evaluator.cpp index c50f8f5..d815db4 100644 --- a/source/evaluator.cpp +++ b/source/evaluator.cpp @@ -122,11 +122,11 @@ void InitEval(py::module_ &m) }, py::arg("tree"), py::arg("dataset"), py::arg("range"), py::arg("target"), py::arg("metric") = "rsquared"); - m.def("PoissonLikelihood", [](py::array_t x, py::array_t y){ + m.def("PoissonLikelihood", [](py::array_t x, py::array_t y){ return detail::PoissonLikelihood(std::move(x), std::move(y)); }); - m.def("PoissonLikelihood", [](py::array_t x, py::array_t y, py::array_t w){ + m.def("PoissonLikelihood", [](py::array_t x, py::array_t y, py::array_t w){ return detail::PoissonLikelihood(std::move(x), std::move(y), std::move(w)); }); @@ -142,12 +142,12 @@ void InitEval(py::module_ &m) TDispatch dtable; - auto result = py::array_t(static_cast(trees.size())); + auto result = py::array_t(static_cast(trees.size())); auto buf = result.request(); auto values = d.GetValues(target).subspan(r.Start(), r.Size()); // TODO: make this run in parallel with taskflow - std::transform(trees.begin(), trees.end(), static_cast(buf.ptr), [&](auto const& t) -> double { + std::transform(trees.begin(), trees.end(), static_cast(buf.ptr), [&](auto const& t) -> double { auto estimated = TInterpreter{dtable, d, t}.Evaluate({}, r); return (*error)(estimated, values); });