Skip to content

Commit

Permalink
add notes for ArgMaxAtK and MaxK
Browse files Browse the repository at this point in the history
  • Loading branch information
guolinke committed Jan 15, 2018
1 parent 0f0eb69 commit d90369a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/LightGBM/utils/array_args.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class ArrayArgs {
*r = i;
};

// Note: k refer to index here. e.g. k=0 means get max number.
// Note: k refer to index here. e.g. k=0 means get the max number.
inline static int ArgMaxAtK(std::vector<VAL_T>* arr, int start, int end, int k) {
if (start >= end - 1) {
return start;
Expand All @@ -144,6 +144,7 @@ class ArrayArgs {
}
}

// Note: k is 1-based here. e.g. k=3 means get the top-3 numbers.
inline static void MaxK(const std::vector<VAL_T>& array, int k, std::vector<VAL_T>* out) {
out->clear();
if (k <= 0) {
Expand Down

0 comments on commit d90369a

Please sign in to comment.