Fix spelling in documents (#6948)

* Update roxygen2 doc.

Co-authored-by: fis <jm.yuan@outlook.com>
This commit is contained in:
Andrew Ziem
2021-05-11 06:44:36 -06:00
committed by GitHub
parent 2a9979e256
commit 3e7e426b36
100 changed files with 284 additions and 284 deletions

View File

@@ -17,7 +17,7 @@ namespace xgboost {
/*!
* \brief Feature interaction constraint implementation for CPU tree updaters.
*
* The interface is similiar to the one for GPU Hist.
* The interface is similar to the one for GPU Hist.
*/
class FeatureInteractionConstraintHost {
protected:

View File

@@ -125,7 +125,7 @@ struct UpdateNumeric {
EvaluateSplitInputs<GradientSumT> const &inputs,
DeviceSplitCandidate *best_split) {
// Use pointer from cut to indicate begin and end of bins for each feature.
uint32_t gidx_begin = inputs.feature_segments[fidx]; // begining bin
uint32_t gidx_begin = inputs.feature_segments[fidx]; // beginning bin
int split_gidx = (scan_begin + threadIdx.x) - 1;
float fvalue;
if (split_gidx < static_cast<int>(gidx_begin)) {
@@ -152,7 +152,7 @@ __device__ void EvaluateFeature(
TempStorageT* temp_storage // temp memory for cub operations
) {
// Use pointer from cut to indicate begin and end of bins for each feature.
uint32_t gidx_begin = inputs.feature_segments[fidx]; // begining bin
uint32_t gidx_begin = inputs.feature_segments[fidx]; // beginning bin
uint32_t gidx_end =
inputs.feature_segments[fidx + 1]; // end bin for i^th feature
auto feature_hist = inputs.gradient_histogram.subspan(gidx_begin, gidx_end - gidx_begin);

View File

@@ -124,7 +124,7 @@ class ExternalMemoryGradientBasedSampling : public SamplingStrategy {
* Processing Systems (pp. 3146-3154).
* \see Zhu, R. (2016). Gradient-based sampling: An adaptive importance sampling for least-squares.
* In Advances in Neural Information Processing Systems (pp. 406-414).
* \see Ohlsson, E. (1998). Sequential poisson sampling. Journal of official Statistics, 14(2), 149.
* \see Ohlsson, E. (1998). Sequential Poisson sampling. Journal of official Statistics, 14(2), 149.
*/
class GradientBasedSampler {
public:

View File

@@ -17,7 +17,7 @@
namespace xgboost {
namespace tree {
// Following 2 functions are slightly modifed version of fbcuda.
// Following 2 functions are slightly modified version of fbcuda.
/* \brief Constructs a rounding factor used to truncate elements in a sum such that the
sum of the truncated elements is the same no matter what the order of the sum is.

View File

@@ -76,7 +76,7 @@ struct TrainParam : public XGBoostParameter<TrainParam> {
// the criteria to use for ranking splits
std::string split_evaluator;
// ------ From cpu quantile histogram -------.
// ------ From CPU quantile histogram -------.
// percentage threshold for treating a feature as sparse
// e.g. 0.2 indicates a feature with fewer than 20% nonzeros is considered sparse
double sparse_threshold;
@@ -316,7 +316,7 @@ XGBOOST_DEVICE inline T CalcGain(const TrainingParams &p, StatT stat) {
return CalcGain(p, stat.GetGrad(), stat.GetHess());
}
// Used in gpu code where GradientPair is used for gradient sum, not GradStats.
// Used in GPU code where GradientPair is used for gradient sum, not GradStats.
template <typename TrainingParams, typename GpairT>
XGBOOST_DEVICE inline float CalcWeight(const TrainingParams &p, GpairT sum_grad) {
return CalcWeight(p, sum_grad.GetGrad(), sum_grad.GetHess());
@@ -484,7 +484,7 @@ using SplitEntry = SplitEntryContainer<GradStats>;
/*
* \brief Parse the interaction constraints from string.
* \param constraint_str String storing the interfaction constraints:
* \param constraint_str String storing the interaction constraints:
*
* Example input string:
*

View File

@@ -157,7 +157,7 @@ TreeGenerator* TreeGenerator::Create(std::string const& attrs, FeatureMap const&
if (pos != std::string::npos) {
name = attrs.substr(0, pos);
params = attrs.substr(pos+1, attrs.length() - pos - 1);
// Eliminate all occurances of single quote string.
// Eliminate all occurrences of single quote string.
size_t pos = std::string::npos;
while ((pos = params.find('\'')) != std::string::npos) {
params.replace(pos, 1, "\"");
@@ -1069,7 +1069,7 @@ void RegTree::CalculateContributionsApprox(const RegTree::FVec &feat,
// Used by TreeShap
// data we keep about our decision path
// note that pweight is included for convenience and is not tied with the other attributes
// the pweight of the i'th path element is the permuation weight of paths with i-1 ones in them
// the pweight of the i'th path element is the permutation weight of paths with i-1 ones in them
struct PathElement {
int feature_index;
bst_float zero_fraction;
@@ -1123,7 +1123,7 @@ void UnwindPath(PathElement *unique_path, unsigned unique_depth,
}
}
// determine what the total permuation weight would be if
// determine what the total permutation weight would be if
// we unwound a previous extension in the decision path
bst_float UnwoundPathSum(const PathElement *unique_path, unsigned unique_depth,
unsigned path_index) {

View File

@@ -196,8 +196,8 @@ class BaseMaker: public TreeUpdater {
}
}
/*!
* \brief this is helper function uses column based data structure,
* reset the positions to the lastest one
* \brief This is a helper function that uses a column based data structure
* and reset the positions to the latest one
* \param nodes the set of nodes that contains the split to be used
* \param p_fmat feature matrix needed for tree construction
* \param tree the regression tree structure

View File

@@ -549,7 +549,7 @@ struct GPUHistMakerDevice {
bst_float weight = evaluator.CalcWeight(
pos, param_d, GradStats{d_node_sum_gradients[pos]});
static_assert(!std::is_const<decltype(out_preds_d)>::value, "");
auto v_predt = out_preds_d; // for some reaon out_preds_d is const by both nvcc and clang.
auto v_predt = out_preds_d; // for some reason out_preds_d is const by both nvcc and clang.
v_predt[d_ridx[local_idx]] += weight * param_d.learning_rate;
});
row_partitioner.reset();

View File

@@ -401,7 +401,7 @@ class CQHistMaker: public HistMaker {
for (auto& sketch : sketchs_) {
sketch.Init(info.num_row_, this->param_.sketch_eps);
}
// intitialize the summary array
// initialize the summary array
summary_array_.resize(sketchs_.size());
// setup maximum size
unsigned max_size = this->param_.MaxSketchSize();
@@ -409,7 +409,7 @@ class CQHistMaker: public HistMaker {
summary_array_[i].Reserve(max_size);
}
{
// get smmary
// get summary
thread_sketch_.resize(omp_get_max_threads());
// TWOPASS: use the real set + split set in the column iteration.

View File

@@ -441,7 +441,7 @@ class QuantileHistMaker: public TreeUpdater {
std::unique_ptr<ExpandQueue> qexpand_loss_guided_;
std::vector<ExpandEntry> qexpand_depth_wise_;
// key is the node id which should be calculated by Subtraction Trick, value is the node which
// provides the evidence for substracts
// provides the evidence for subtraction
std::vector<ExpandEntry> nodes_for_subtraction_trick_;
// list of nodes whose histograms would be built explicitly.
std::vector<ExpandEntry> nodes_for_explicit_hist_build_;

View File

@@ -123,7 +123,7 @@ class TreeRefresher: public TreeUpdater {
// start from groups that belongs to current data
auto pid = 0;
gstats[pid].Add(gpair[ridx]);
// tranverse tree
// traverse tree
while (!tree[pid].IsLeaf()) {
unsigned split_index = tree[pid].SplitIndex();
pid = tree.GetNext(pid, feat.GetFvalue(split_index), feat.IsMissing(split_index));