Skip to content

Commit

Permalink
delete print_warning
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYuHui committed Jun 24, 2020
1 parent 145f093 commit 11f8db6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/shogun/labels/BinaryLabelEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace shogun
{
const auto result_vector = labs->as<DenseLabels>()->get_labels();
check_is_valid(result_vector);
if (print_warning && !can_convert_float_to_int(result_vector))
if (!can_convert_float_to_int(result_vector))
{
io::warn(
"({}, {}) have been converted to (-1, 1).",
Expand Down
4 changes: 0 additions & 4 deletions src/shogun/labels/LabelEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ namespace shogun
return "LabelEncoder";
}

void set_print_warning(bool print_warning){
print_warning = print_warning;
}
protected:
SGVector<float64_t> fit_impl(const SGVector<float64_t>& origin_vector)
{
Expand Down Expand Up @@ -116,7 +113,6 @@ namespace shogun
});
}

bool print_warning = true;
std::set<float64_t> unique_labels;
std::unordered_map<float64_t, float64_t> normalized_to_origin;
};
Expand Down
4 changes: 2 additions & 2 deletions src/shogun/labels/MulticlassLabelsEncoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ namespace shogun
SGVector<float64_t> fit(const std::shared_ptr<Labels>& labs) override
{
const auto result_vector = labs->as<DenseLabels>()->get_labels();
if (print_warning && !can_convert_float_to_int(result_vector))
if (!can_convert_float_to_int(result_vector))
{
std::set<float64_t> s(result_vector.begin(), result_vector.end());
io::warn(
"{} have been converted to 0...{}",
"({}) have been converted to (0...{})",
fmt::join(s, ", "),
result_vector.vlen - 1);
}
Expand Down

0 comments on commit 11f8db6

Please sign in to comment.