Fix Error in percentile method

This commit is contained in:
2024-06-24 10:55:26 +02:00
parent b3fc598c29
commit a1346e1943
2 changed files with 2 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ namespace mdlp {
results.reserve(percentiles.size());
for (auto percentile : percentiles) {
const size_t i = static_cast<size_t>(std::floor(static_cast<double>(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<double>(indexLower) / static_cast<double>(data.size() - 1);
const double fraction =
(percentile / 100.0 - percentI) /

View File

@@ -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;