You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include"bindings/Python/type_caster/label_vector_wrapper_caster.hpp"// a custom Pybind11 type caster for a plssvm::bindings::python::util::label_vector_wrapper
17
+
#include"bindings/Python/type_caster/matrix_type_caster.hpp"//a custom Pybind11 type caster for a plssvm::matrix
"create a new data set from the provided data and labels and additional optional parameters",
100
92
py::arg("X"),
101
93
py::arg("y"),
102
94
py::pos_only(),
103
95
py::arg("scaler") = std::nullopt)
104
96
.def("save", [](const classification_data_set_wrapper &self, const std::string &filename, const plssvm::file_format_type format) { std::visit([&filename, format](auto &&data) { data.save(filename, format); }, self.data_set); }, "save the data set to a file using the provided file format type", py::arg("filename"), py::pos_only(), py::arg("format") = plssvm::file_format_type::libsvm)
105
-
.def("data", [](const classification_data_set_wrapper &self) { returnstd::visit([](auto &&data) { returnplssvm::bindings::python::util::matrix_to_pyarray(data.data()); }, self.data_set); }, "the data saved as 2D vector")
97
+
.def("data", [](const classification_data_set_wrapper &self) { returnstd::visit([](auto &&data) { returnpy::cast(data.data()); }, self.data_set); }, "the data saved as 2D vector")
106
98
.def("has_labels", [](const classification_data_set_wrapper &self) { returnstd::visit([](auto &&data) { return data.has_labels(); }, self.data_set); }, "check whether the data set has labels")
throw py::value_error{ fmt::format("MinMaxScaler can only be created from two interval values (lower, upper), but {} were provided!", interval.size()) };
0 commit comments