-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLibsvmExtractor_pybind.cpp
More file actions
31 lines (21 loc) · 887 Bytes
/
Copy pathLibsvmExtractor_pybind.cpp
File metadata and controls
31 lines (21 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/// file: LibsvmExtractor_pybind.cpp
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "../LibsvmExtractor_pybind.h"
namespace py = pybind11;
namespace feather {
void LibsvmExtractor_pybind(py::module &m) {
py::class_<LibsvmExtractor>(m, "LibsvmExtractor")
.def(py::init<>())
.def(py::init<const std::string&, const std::string&, const bool, uint16_t>(),
py::arg("feahash_conf"), py::arg("label"), py::arg("index"), py::arg("hash_type") = 0)
.def("Extract",
static_cast<std::string (LibsvmExtractor::*)(const std::string&, const bool)>(
&LibsvmExtractor::Extract))
.def("BatchExtract",
static_cast<
std::vector<std::string> (LibsvmExtractor::*)(const std::vector<std::string>&, const bool)
>(
&LibsvmExtractor::BatchExtract));
}
} // namespace feather