mirror of
https://github.com/rmontanana/mdlp.git
synced 2025-08-15 23:45:57 +00:00
Fix Error in percentile method
This commit is contained in:
@@ -58,7 +58,7 @@ namespace mdlp {
|
|||||||
results.reserve(percentiles.size());
|
results.reserve(percentiles.size());
|
||||||
for (auto percentile : percentiles) {
|
for (auto percentile : percentiles) {
|
||||||
const size_t i = static_cast<size_t>(std::floor(static_cast<double>(data.size() - 1) * percentile / 100.));
|
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 percentI = static_cast<double>(indexLower) / static_cast<double>(data.size() - 1);
|
||||||
const double fraction =
|
const double fraction =
|
||||||
(percentile / 100.0 - percentI) /
|
(percentile / 100.0 - percentI) /
|
||||||
|
@@ -18,7 +18,7 @@ namespace mdlp {
|
|||||||
void fit_t(torch::Tensor& X_, torch::Tensor& y_);
|
void fit_t(torch::Tensor& X_, torch::Tensor& y_);
|
||||||
torch::Tensor transform_t(torch::Tensor& X_);
|
torch::Tensor transform_t(torch::Tensor& X_);
|
||||||
torch::Tensor fit_transform_t(torch::Tensor& X_, torch::Tensor& y_);
|
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:
|
protected:
|
||||||
labels_t discretizedData = labels_t();
|
labels_t discretizedData = labels_t();
|
||||||
cutPoints_t cutPoints;
|
cutPoints_t cutPoints;
|
||||||
|
Reference in New Issue
Block a user