Skip to content

Commit 70f4a66

Browse files
committed
Merge branch 'regression' into spack
2 parents e516167 + d9b6778 commit 70f4a66

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

bindings/Python/sklearn_svc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,15 @@ void parse_provided_kwargs(svc &self, const py::kwargs &args) {
166166
plssvm::kernel_function_type kernel{};
167167
if (kernel_str == "linear") {
168168
kernel = plssvm::kernel_function_type::linear;
169-
} else if (kernel_str == "poly") {
169+
} else if (kernel_str == "poly" || kernel_str == "polynomial") {
170170
kernel = plssvm::kernel_function_type::polynomial;
171171
} else if (kernel_str == "rbf") {
172172
kernel = plssvm::kernel_function_type::rbf;
173173
} else if (kernel_str == "sigmoid") {
174174
kernel = plssvm::kernel_function_type::sigmoid;
175175
} else if (kernel_str == "laplacian") {
176176
kernel = plssvm::kernel_function_type::laplacian;
177-
} else if (kernel_str == "chi_squared") {
177+
} else if (kernel_str == "chi_squared" || kernel_str == "chi-squared") {
178178
kernel = plssvm::kernel_function_type::chi_squared;
179179
} else if (kernel_str == "precomputed") {
180180
throw py::value_error{ R"(The "kernel = 'precomputed'" parameter for the 'SVC' is not implemented yet!)" };

bindings/Python/sklearn_svr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ void parse_provided_kwargs(svr &self, const py::kwargs &args) {
122122
plssvm::kernel_function_type kernel{};
123123
if (kernel_str == "linear") {
124124
kernel = plssvm::kernel_function_type::linear;
125-
} else if (kernel_str == "poly") {
125+
} else if (kernel_str == "poly" || kernel_str == "polynomial") {
126126
kernel = plssvm::kernel_function_type::polynomial;
127127
} else if (kernel_str == "rbf") {
128128
kernel = plssvm::kernel_function_type::rbf;
129129
} else if (kernel_str == "sigmoid") {
130130
kernel = plssvm::kernel_function_type::sigmoid;
131131
} else if (kernel_str == "laplacian") {
132132
kernel = plssvm::kernel_function_type::laplacian;
133-
} else if (kernel_str == "chi_squared") {
133+
} else if (kernel_str == "chi_squared" || kernel_str == "chi-squared") {
134134
kernel = plssvm::kernel_function_type::chi_squared;
135135
} else if (kernel_str == "precomputed") {
136136
throw py::value_error{ R"(The "kernel = 'precomputed'" parameter for the 'SVR' is not implemented yet!)" };

bindings/Python/type_caster/matrix_type_caster.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct type_caster<plssvm::matrix<T, layout>> {
110110
const T *ptr = static_cast<T *>(buffer.ptr);
111111

112112
// check the memory layout of the Python Numpy array
113-
if constexpr (Flags & py::array::c_style) {
113+
if constexpr (static_cast<bool>(Flags & py::array::c_style)) {
114114
// the provided Python Numpy array has C style layout
115115
if constexpr (layout == plssvm::layout_type::aos) {
116116
// memory layout of Python Numpy array and PLSSVM matrix are the same -> can use memcpy to convert
@@ -130,7 +130,7 @@ struct type_caster<plssvm::matrix<T, layout>> {
130130
// unsupported PLSSVM matrix memory layout
131131
return false;
132132
}
133-
} else if constexpr (Flags & py::array::f_style) {
133+
} else if constexpr (static_cast<bool>(Flags & py::array::f_style)) {
134134
if constexpr (layout == plssvm::layout_type::aos) {
135135
// the memory layouts don't match -> must use loops to convert layouts
136136
#pragma omp parallel for collapse(2)

0 commit comments

Comments
 (0)