diff --git a/BinDisc.cpp b/BinDisc.cpp index 626b908..551192c 100644 --- a/BinDisc.cpp +++ b/BinDisc.cpp @@ -58,7 +58,7 @@ namespace mdlp { results.reserve(percentiles.size()); for (auto percentile : percentiles) { const size_t i = static_cast(std::floor(static_cast(data.size() - 1) * percentile / 100.)); - const auto indexLower = clip(i, 0, data.size() - 1); + const auto indexLower = clip(i, 0, data.size() - 2); const double percentI = static_cast(indexLower) / static_cast(data.size() - 1); const double fraction = (percentile / 100.0 - percentI) / diff --git a/Discretizer.h b/Discretizer.h index 2a8593c..9749af8 100644 --- a/Discretizer.h +++ b/Discretizer.h @@ -18,7 +18,7 @@ namespace mdlp { void fit_t(torch::Tensor& X_, torch::Tensor& y_); torch::Tensor transform_t(torch::Tensor& X_); torch::Tensor fit_transform_t(torch::Tensor& X_, torch::Tensor& y_); - static inline std::string version() { return "1.2.1"; }; + static inline std::string version() { return "1.2.2"; }; protected: labels_t discretizedData = labels_t(); cutPoints_t cutPoints;