Medial Code Documentation
|
namespace of xgboost More...
Namespaces | |
namespace | _typing |
namespace | callback |
namespace | collective |
namespace | common |
Copyright 2017-2023, XGBoost Contributors. | |
namespace | compat |
namespace | config |
namespace | core |
namespace | dask |
namespace | data |
Copyright 2019-2023, XGBoost Contributors. | |
namespace | error |
Copyright 2023 by XGBoost contributors. | |
namespace | federated |
namespace | gbm |
Copyright 2019-2023, XGBoost Contributors. | |
namespace | libpath |
namespace | linalg |
Copyright 2021-2023 by XGBoost Contributors. | |
namespace | linear |
Copyright 2018-2023 by XGBoost Contributors. | |
namespace | ltr |
Copyright 2023 by XGBoost contributors. | |
namespace | metric |
Copyright 2016-2023 by XGBoost Contributors. | |
namespace | obj |
Copyright 2022-2023 by XGBoost contributors. | |
namespace | plotting |
namespace | predictor |
Copyright 2017-2023 by XGBoost Contributors. | |
namespace | rabit |
namespace | sklearn |
namespace | spark |
namespace | testing |
namespace | tracker |
namespace | training |
namespace | tree |
Copyright 2021-2023 by XGBoost Contributors. | |
Data Structures | |
class | ArrayInterface |
A type erased view over array_interface protocol defined by numpy. More... | |
struct | ArrayInterfaceErrors |
class | ArrayInterfaceHandler |
Utilities for consuming array interface. More... | |
class | ArrayIterForTest |
class | BaseFederatedTest |
class | BaseLogger |
class | BaseMGPUTest |
class | BatchIterator |
class | BatchIteratorImpl |
struct | BatchParam |
Parameters for constructing histogram index batches. More... | |
class | BatchSet |
struct | BitFieldContainer |
A non-owning type with auxiliary methods defined for manipulating bits. More... | |
class | CLI |
struct | CLIParam |
struct | Configurable |
class | ConsoleLogger |
struct | Context |
Runtime context for XGBoost. More... | |
class | CopyUniquePtr |
Helper for defining copyable data structure that contains unique pointers. More... | |
class | CSCPage |
class | CSRIterForTest |
class | CudaArrayIterForTest |
struct | DeviceOrd |
A type for device ordinal. More... | |
struct | DeviceSym |
class | DMatrix |
Internal data structured used by XGBoost during training. More... | |
class | DMatrixCache |
Thread-aware FIFO cache for DMatrix related data. More... | |
class | EllpackPage |
A page stored in ELLPACK format. More... | |
class | EllpackPageImpl |
struct | Entry |
Element from a sparse vector. More... | |
class | ExtSparsePage |
Sparse page for exporting DMatrix. More... | |
class | FeatureInteractionConstraintHost |
Feature interaction constraint implementation for CPU tree updaters. More... | |
class | FeatureMap |
Feature map data structure to help text model dump. TODO(tqchen) consider make it even more lightweight. More... | |
class | FederatedDataTest |
class | FederatedLearnerTest |
class | FederatedServerTest |
struct | from_chars_result |
class | GHistIndexMatrix |
preprocessed global index matrix, in CSR format. More... | |
struct | GlobalConfiguration |
class | GradientBooster |
interface of gradient boosting model. More... | |
struct | GradientBoosterReg |
Registry entry for tree updater. More... | |
class | GradientPairInt64 |
Fixed point representation for high precision gradient pair. Has a different interface so we don't accidentally use it in gain calculations. More... | |
class | GraphvizGenerator |
struct | GraphvizParam |
class | HostDeviceVector |
struct | HostDeviceVectorImpl |
struct | HostSparsePageView |
class | InitBaseScore |
Test the model initialization sequence is correctly performed. More... | |
class | IntrusivePtr |
Implementation of Intrusive Pointer. A smart pointer that points to an object with an embedded reference counter. The underlying object must implement a friend function IntrusivePtrRefCount() that returns the ref counter (of type IntrusivePtrCell). The intrusive pointer is faster than std::shared_ptr<>: std::shared_ptr<> makes an extra memory allocation for the ref counter whereas the intrusive pointer does not. More... | |
class | IntrusivePtrCell |
Helper class for embedding reference counting into client objects. See https://www.boost.org/doc/libs/1_74_0/doc/html/atomic/usage_examples.html for discussions of memory order. More... | |
class | Json |
Data structure representing JSON format. More... | |
class | JsonArray |
class | JsonBoolean |
Describes both true and false. More... | |
class | JsonGenerator |
class | JsonInteger |
class | JsonNull |
class | JsonNumber |
class | JsonObject |
class | JsonReader |
A json reader, currently error checking and utf-8 is not fully supported. More... | |
class | JsonString |
class | JsonTypedArray |
Typed array for Universal Binary JSON. More... | |
class | JsonWriter |
class | L1SerializationTest |
struct | LBitsPolicy |
class | Learner |
Learner class that does training and prediction. This is the user facing module of xgboost training. The Load/Save function corresponds to the model used in python/R. More... | |
class | LearnerConfiguration |
class | LearnerImpl |
learner that performs gradient boosting for a specific objective function. It does training and prediction. More... | |
class | LearnerIO |
struct | LearnerModelParam |
Basic model parameters, used to describe the booster. More... | |
struct | LearnerModelParamLegacy |
training parameter for regression More... | |
struct | LearnerTrainParam |
class | LinearUpdater |
interface of linear updater More... | |
struct | LinearUpdaterReg |
Registry entry for linear updater. More... | |
class | LogCallbackRegistry |
class | LogitSerializationTest |
class | MetaInfo |
Meta information about dataset, always sit in memory. More... | |
class | Metric |
interface of evaluation metric used to evaluate model performance. This has nothing to do with training, but merely act as evaluation purpose. More... | |
class | MetricNoCache |
struct | MetricReg |
Registry entry for Metric factory functions. The additional parameter const char* param gives the value after @, can be null. For example, metric map@3, then: param == "3". More... | |
struct | Model |
class | MultiClassesSerializationTest |
class | MultiTargetTree |
Tree structure for multi-target model. More... | |
struct | NumericLimits |
struct | NumericLimits< float > |
struct | NumericLimits< int64_t > |
class | NumpyArrayIterForTest |
class | ObjFunction |
interface of objective function More... | |
struct | ObjFunctionReg |
Registry entry for objective factory functions. More... | |
struct | ObjInfo |
A struct returned by objective, which determines task at hand. The struct is not used by any algorithm yet, only for future development like categorical split. More... | |
struct | PathElement |
struct | PesudoHuberParam |
struct | PredictionCacheEntry |
Contains pointer to input matrix and associated cached predictions. More... | |
class | PredictionContainer |
A container for managed prediction caches. More... | |
class | Predictor |
Performs prediction on individual training instances or batches of instances for GBTree. More... | |
struct | PredictorReg |
Registry entry for predictor. More... | |
class | RandomDataGenerator |
struct | RBitsPolicy |
class | RegTree |
define regression tree to be the most common tree model. More... | |
class | RMMAllocator |
struct | RTreeNodeStat |
node statistics used in regression tree More... | |
class | SerializationTest |
class | ServerForTest |
class | SimpleLCG |
Linear congruential generator. More... | |
class | SimpleRealUniformDistribution |
class | SortedCSCPage |
class | SparsePage |
In-memory storage unit of sparse batch, stored in CSR format. More... | |
struct | StringView |
class | TestColumnSplit |
class | TestDefaultObjConfig |
class | TestGrowPolicy |
class | TestL1MultiTarget |
class | TestMinSplitLoss |
class | TestPredictionCache |
class | TextGenerator |
struct | to_chars_result |
struct | ToDType |
Dispatch compile time type to runtime type. More... | |
struct | ToDType< double > |
struct | ToDType< float > |
struct | ToDType< int16_t > |
struct | ToDType< int32_t > |
struct | ToDType< int64_t > |
struct | ToDType< int8_t > |
struct | ToDType< T, std::enable_if_t< std::is_same< T, long double >::value &&sizeof(long double)==16 > > |
struct | ToDType< uint16_t > |
struct | ToDType< uint32_t > |
struct | ToDType< uint64_t > |
struct | ToDType< uint8_t > |
class | TrackerLogger |
class | TrainingObserver |
class | TreeGenerator |
Base class for dump model implementation, modeling closely after code generator. More... | |
struct | TreeGenReg |
struct | TreeParam |
meta parameters of the tree More... | |
class | TreeUpdater |
interface of tree update module, that performs update of a tree. More... | |
struct | TreeUpdaterReg |
Registry entry for tree updater. More... | |
struct | TypedIndex |
Helper for type casting. More... | |
class | UBJReader |
Reader for UBJSON https://ubjson.org/. More... | |
class | UBJWriter |
Writer for UBJSON https://ubjson.org/. More... | |
class | UpdaterEtaTest |
class | UpdaterTreeStatTest |
class | Value |
struct | Version |
struct | XGBAPIThreadLocalEntry |
entry to to easily hold returning information More... | |
class | XGBoostAPIGuard |
struct | XGBoostParameter |
Typedefs | |
using | bst_uint = uint32_t |
unsigned integer type used for feature index. | |
using | bst_ulong = uint64_t |
unsigned long integers | |
using | bst_float = float |
float type, used for storing statistics | |
using | bst_cat_t = int32_t |
Categorical value type. | |
using | bst_feature_t = uint32_t |
Type for data column (feature) index. | |
using | bst_bin_t = int32_t |
Type for histogram bin index. | |
using | bst_row_t = std::size_t |
Type for data row index. | |
using | bst_node_t = std::int32_t |
Type for tree node index. | |
using | bst_group_t = std::uint32_t |
Type for ranking group index. | |
using | bst_target_t = std::uint32_t |
Type for indexing into output targets. | |
using | bst_layer_t = std::int32_t |
Type for indexing boosted layers. | |
using | bst_tree_t = std::int32_t |
Type for indexing trees. | |
using | bst_d_ordinal_t = std::int16_t |
Ordinal of a CUDA device. | |
using | GradientPair = detail::GradientPairInternal< float > |
gradient statistics pair usually needed in gradient boosting | |
using | GradientPairPrecise = detail::GradientPairInternal< double > |
High precision gradient statistics pair. | |
using | Args = std::vector< std::pair< std::string, std::string > > |
using | omp_ulong = dmlc::omp_ulong |
define unsigned long for openmp loop | |
using | bst_omp_uint = dmlc::omp_uint |
define unsigned int for openmp loop | |
using | XGBoostVersionT = int32_t |
Type used for representing version number in binary form. | |
using | GlobalConfigThreadLocalStore = dmlc::ThreadLocalStore< GlobalConfiguration > |
using | F32Array = JsonTypedArray< float, Value::ValueKind::kNumberArray > |
Typed UBJSON array for 32-bit floating point. | |
using | U8Array = JsonTypedArray< uint8_t, Value::ValueKind::kU8Array > |
Typed UBJSON array for uint8_t. | |
using | I32Array = JsonTypedArray< int32_t, Value::ValueKind::kI32Array > |
Typed UBJSON array for int32_t. | |
using | I64Array = JsonTypedArray< int64_t, Value::ValueKind::kI64Array > |
Typed UBJSON array for int64_t. | |
using | Object = JsonObject |
using | Array = JsonArray |
using | Number = JsonNumber |
using | Integer = JsonInteger |
using | Boolean = JsonBoolean |
using | String = JsonString |
using | Null = JsonNull |
using | LogCallbackRegistryStore = dmlc::ThreadLocalStore< LogCallbackRegistry > |
using | LBitField64 = BitFieldContainer< uint64_t, LBitsPolicy< uint64_t > > |
using | RBitField8 = BitFieldContainer< uint8_t, RBitsPolicy< unsigned char > > |
using | LBitField32 = BitFieldContainer< uint32_t, LBitsPolicy< uint32_t > > |
using | CLBitField32 = BitFieldContainer< uint32_t, LBitsPolicy< uint32_t, true >, true > |
using | DMatrixThreadLocal = dmlc::ThreadLocalStore< std::map< DMatrix const *, XGBAPIThreadLocalEntry > > |
using | LearnerAPIThreadLocalStore = dmlc::ThreadLocalStore< std::map< Learner const *, XGBAPIThreadLocalEntry > > |
template<bool typed> | |
using | FloatArrayT = std::conditional_t< typed, F32Array const, Array const > |
template<bool typed> | |
using | U8ArrayT = std::conditional_t< typed, U8Array const, Array const > |
template<bool typed> | |
using | I32ArrayT = std::conditional_t< typed, I32Array const, Array const > |
template<bool typed> | |
using | I64ArrayT = std::conditional_t< typed, I64Array const, Array const > |
template<bool typed, bool feature_is_64> | |
using | IndexArrayT = std::conditional_t< feature_is_64, I64ArrayT< typed >, I32ArrayT< typed > > |
typedef void * | DMatrixHandle |
typedef void * | DataIterHandle |
using | RMMAllocatorPtr = std::unique_ptr< RMMAllocator, void(*)(RMMAllocator *)> |
Enumerations | |
enum class | DataType : uint8_t { kFloat32 = 1 , kDouble = 2 , kUInt32 = 3 , kUInt64 = 4 , kStr = 5 } |
data type accepted by xgboost interface | |
enum class | FeatureType : uint8_t { kNumerical = 0 , kCategorical = 1 } |
enum class | DataSplitMode : int { kRow = 0 , kCol = 1 } |
enum | GPUAccess { kNone , kRead , kWrite } |
Controls data access from the GPU. More... | |
enum class | PredictionType : std::uint8_t { kValue = 0 , kMargin = 1 , kContribution = 2 , kApproxContribution = 3 , kInteraction = 4 , kApproxInteraction = 5 , kLeaf = 6 } |
enum class | MultiStrategy : std::int32_t { kOneOutputPerTree = 0 , kMultiOutputTree = 1 } |
Strategy for building multi-target models. | |
enum | CLITask { kTrain = 0 , kDumpModel = 1 , kPredict = 2 } |
enum class | TreeMethod : int { kAuto = 0 , kApprox = 1 , kExact = 2 , kHist = 3 , kGPUHist = 5 } |
enum class | TreeProcessType : int { kDefault = 0 , kUpdate = 1 } |
Functions | |
template<typename T > | |
IntrusivePtrCell & | IntrusivePtrRefCount (T const *ptr) noexcept |
User defined function for returning embedded reference count. | |
template<class T , class U > | |
bool | operator== (IntrusivePtr< T > const &x, IntrusivePtr< U > const &y) noexcept |
template<class T , class U > | |
bool | operator!= (IntrusivePtr< T > const &x, IntrusivePtr< U > const &y) noexcept |
template<class T , class U > | |
bool | operator== (IntrusivePtr< T > const &x, U *y) noexcept |
template<class T , class U > | |
bool | operator!= (IntrusivePtr< T > const &x, U *y) noexcept |
template<class T , class U > | |
bool | operator== (T *x, IntrusivePtr< U > const &y) noexcept |
template<class T , class U > | |
bool | operator!= (T *x, IntrusivePtr< U > const &y) noexcept |
template<class T > | |
bool | operator< (IntrusivePtr< T > const &x, IntrusivePtr< T > const &y) noexcept |
template<class T > | |
bool | operator<= (IntrusivePtr< T > const &x, IntrusivePtr< T > const &y) noexcept |
template<class T > | |
bool | operator> (IntrusivePtr< T > const &x, IntrusivePtr< T > const &y) noexcept |
template<class T > | |
bool | operator>= (IntrusivePtr< T > const &x, IntrusivePtr< T > const &y) noexcept |
template<class E , class T , class Y > | |
std::basic_ostream< E, T > & | operator<< (std::basic_ostream< E, T > &os, IntrusivePtr< Y > const &p) |
template<typename T > | |
bool | IsA (Value const *value) |
template<typename T , typename U > | |
T * | Cast (U *value) |
template<typename T > | |
bool | IsA (Json const &j) |
Check whether a Json object has specific type. | |
template<typename T , typename U > | |
auto | get (U &json) -> decltype(detail::GetImpl(*Cast< T >(&json.GetValue())))& |
Get Json value. | |
template<typename... JT> | |
void | TypeCheck (Json const &value, StringView name) |
Type check for JSON-based parameters. | |
template<typename Parameter > | |
Object | ToJson (Parameter const ¶m) |
Convert XGBoost parameter to JSON object. | |
template<typename Parameter > | |
Args | FromJson (Json const &obj, Parameter *param) |
Load a XGBoost parameter from a JSON object. | |
template<typename T > | |
T | BuiltinBSwap (T v) |
template<typename T , std::enable_if_t< sizeof(T)==1 > * = nullptr> | |
T | ToBigEndian (T v) |
std::ostream & | operator<< (std::ostream &os, StringView const v) |
bool | operator== (StringView l, StringView r) |
bool | operator!= (StringView l, StringView r) |
bool | operator< (StringView l, StringView r) |
bool | operator< (std::string const &l, StringView r) |
bool | operator< (StringView l, std::string const &r) |
StringView | MTNotImplemented () |
void | XGBBuildInfoDevice (Json *p_info) |
void | CalcPredictShape (bool strict_shape, PredictionType type, size_t rows, size_t cols, size_t chunksize, size_t groups, size_t rounds, std::vector< bst_ulong > *out_shape, xgboost::bst_ulong *out_dim) |
uint32_t | GetIterationFromTreeLimit (uint32_t ntree_limit, Learner *learner) |
float | GetMissing (Json const &config) |
FeatureMap | LoadFeatureMap (std::string const &uri) |
void | GenerateFeatureMap (Learner const *learner, std::vector< Json > const &custom_feature_names, size_t n_features, FeatureMap *out_feature_map) |
template<typename JT > | |
auto const & | RequiredArg (Json const &in, StringView key, StringView func) |
template<typename JT , typename T > | |
auto const & | OptionalArg (Json const &in, StringView key, T const &dft) |
std::shared_ptr< DMatrix > | CastDMatrixHandle (DMatrixHandle const handle) |
Get shared ptr from DMatrix C handle with additional checks. | |
DMLC_REGISTER_PARAMETER (CLIParam) | |
std::string | CliHelp () |
void | CLIError (dmlc::Error const &e) |
to_chars_result | to_chars (char *first, char *last, float value) |
to_chars_result | to_chars (char *first, char *last, int64_t value) |
from_chars_result | from_chars (const char *buffer, const char *end, float &value) |
Json & | DummyJsonObject () |
void | ParseStr (std::string const &str) |
template<typename T , Value::ValueKind kind> | |
void | WriteTypedArray (JsonTypedArray< T, kind > const *arr, std::vector< char > *stream) |
DMLC_REGISTER_PARAMETER (PesudoHuberParam) | |
DMLC_REGISTER_PARAMETER (Context) | |
template<std::int32_t D, typename Fn > | |
void | DispatchDType (ArrayInterface< D > const array, std::int32_t device, Fn fn) |
template<int32_t D> | |
void | CheckArrayInterface (StringView key, ArrayInterface< D > const &array) |
void | LoadFeatureType (std::vector< std::string >const &type_names, std::vector< FeatureType > *types) |
template<typename T > | |
std::vector< T > | Gather (const std::vector< T > &in, common::Span< int const > ridxs, size_t stride=1) |
template DMatrix * | DMatrix::Create< data::DenseAdapter > (data::DenseAdapter *adapter, float missing, std::int32_t nthread, const std::string &cache_prefix, DataSplitMode data_split_mode) |
template DMatrix * | DMatrix::Create< data::ArrayAdapter > (data::ArrayAdapter *adapter, float missing, std::int32_t nthread, const std::string &cache_prefix, DataSplitMode data_split_mode) |
template DMatrix * | DMatrix::Create< data::CSRAdapter > (data::CSRAdapter *adapter, float missing, std::int32_t nthread, const std::string &cache_prefix, DataSplitMode data_split_mode) |
template DMatrix * | DMatrix::Create< data::CSCAdapter > (data::CSCAdapter *adapter, float missing, std::int32_t nthread, const std::string &cache_prefix, DataSplitMode data_split_mode) |
template DMatrix * | DMatrix::Create< data::DataTableAdapter > (data::DataTableAdapter *adapter, float missing, std::int32_t nthread, const std::string &cache_prefix, DataSplitMode data_split_mode) |
template DMatrix * | DMatrix::Create< data::FileAdapter > (data::FileAdapter *adapter, float missing, std::int32_t nthread, const std::string &cache_prefix, DataSplitMode data_split_mode) |
template DMatrix * | DMatrix::Create< data::CSRArrayAdapter > (data::CSRArrayAdapter *adapter, float missing, std::int32_t nthread, const std::string &cache_prefix, DataSplitMode data_split_mode) |
template DMatrix * | DMatrix::Create< data::CSCArrayAdapter > (data::CSCArrayAdapter *adapter, float missing, std::int32_t nthread, const std::string &cache_prefix, DataSplitMode data_split_mode) |
template DMatrix * | DMatrix::Create< data::RecordBatchesIterAdapter > (data::RecordBatchesIterAdapter *adapter, float missing, int nthread, const std::string &, DataSplitMode data_split_mode) |
template<typename Fn > | |
void | AssignColumnBinIndex (GHistIndexMatrix const &page, Fn &&assign) |
Helper for recovering feature index from row-based storage of histogram bin. | |
DMLC_REGISTER_PARAMETER (GlobalConfiguration) | |
DMLC_REGISTER_PARAMETER (LearnerModelParamLegacy) | |
DMLC_REGISTER_PARAMETER (LearnerTrainParam) | |
template<typename MetricRegistry > | |
Metric * | CreateMetricImpl (const std::string &name) |
void | ExtendPath (PathElement *unique_path, std::uint32_t unique_depth, float zero_fraction, float one_fraction, int feature_index) |
void | UnwindPath (PathElement *unique_path, std::uint32_t unique_depth, std::uint32_t path_index) |
float | UnwoundPathSum (const PathElement *unique_path, std::uint32_t unique_depth, std::uint32_t path_index) |
void | TreeShap (RegTree const &tree, const RegTree::FVec &feat, float *phi, bst_node_t node_index, std::uint32_t unique_depth, PathElement *parent_unique_path, float parent_zero_fraction, float parent_one_fraction, int parent_feature_index, int condition, std::uint32_t condition_feature, float condition_fraction) |
Recursive function that computes the feature attributions for a single tree. | |
void | CalculateContributions (RegTree const &tree, const RegTree::FVec &feat, std::vector< float > *mean_values, float *out_contribs, int condition, std::uint32_t condition_feature) |
void | CalculateContributions (RegTree const &tree, const RegTree::FVec &feat, std::vector< float > *mean_values, bst_float *out_contribs, int condition, unsigned condition_feature) |
calculate the feature contributions (https://arxiv.org/abs/1706.06060) for the tree | |
template<int32_t D> | |
void | ValidateBaseMarginShape (linalg::Tensor< float, D > const &margin, bst_row_t n_samples, bst_group_t n_groups) |
template<typename JT , typename T > | |
std::enable_if_t<!std::is_same< T, Json >::value &&!std::is_same< JT, Boolean >::value, T > | GetElem (std::vector< T > const &arr, size_t i) |
template<typename JT , typename T > | |
std::enable_if_t<!std::is_same< T, Json >::value &&std::is_same< T, uint8_t >::value &&std::is_same< JT, Boolean >::value, bool > | GetElem (std::vector< T > const &arr, size_t i) |
template<typename JT , typename T > | |
std::enable_if_t< std::is_same< T, Json >::value, std::conditional_t< std::is_same< JT, Integer >::value, int64_t, std::conditional_t< std::is_same< Boolean, JT >::value, bool, float > > > | GetElem (std::vector< T > const &arr, size_t i) |
template<bool typed, bool feature_is_64> | |
void | LoadModelImpl (Json const &in, std::vector< float > *p_weights, std::vector< bst_node_t > *p_lefts, std::vector< bst_node_t > *p_rights, std::vector< bst_node_t > *p_parents, std::vector< float > *p_conds, std::vector< bst_feature_t > *p_fidx, std::vector< std::uint8_t > *p_dft_left) |
void | ParseInteractionConstraint (std::string const &constraint_str, std::vector< std::vector< bst_feature_t > > *p_out) |
void | ParseInteractionConstraint (std::string const &constraint_str, std::vector< std::vector< xgboost::bst_feature_t > > *p_out) |
DMLC_REGISTER_PARAMETER (TreeParam) | |
std::vector< bst_cat_t > | GetSplitCategories (RegTree const &tree, int32_t nidx) |
std::string | PrintCatsAsSet (std::vector< bst_cat_t > const &cats) |
describe ("Dump text representation of tree") .set_body([](FeatureMap const &fmap | |
describe ("Dump json representation of tree") .set_body([](FeatureMap const &fmap | |
DMLC_REGISTER_PARAMETER (GraphvizParam) | |
describe ("Dump graphviz representation of tree") .set_body([](FeatureMap const &fmap | |
template<bool typed, bool feature_is_64> | |
void | LoadModelImpl (Json const &in, TreeParam const ¶m, std::vector< RTreeNodeStat > *p_stats, std::vector< RegTree::Node > *p_nodes) |
TEST (CAPI, Version) | |
TEST (CAPI, XGDMatrixCreateFromCSR) | |
TEST (CAPI, ConfigIO) | |
TEST (CAPI, JsonModelIO) | |
TEST (CAPI, CatchDMLCError) | |
TEST (CAPI, CatchDMLCErrorURI) | |
TEST (CAPI, DMatrixSetFeatureName) | |
int | TestExceptionCatching () |
TEST (CAPI, Exception) | |
TEST (CAPI, XGBGlobalConfig) | |
TEST (CAPI, BuildInfo) | |
TEST (CAPI, NullPtr) | |
TEST (CAPI, JArgs) | |
TEST (CAPI, XGDMatrixGetQuantileCut) | |
std::vector< float > | OneHotEncodeFeature (std::vector< float > x, size_t num_cat) |
TEST (BitField, Check) | |
template<typename BitFieldT , typename VT = typename BitFieldT::value_type> | |
void | TestBitFieldSet (typename BitFieldT::value_type res, size_t index, size_t true_bit) |
TEST (BitField, Set) | |
template<typename BitFieldT , typename VT = typename BitFieldT::value_type> | |
void | TestBitFieldClear (size_t clear_bit) |
TEST (BitField, Clear) | |
TEST (Ryu, Subnormal) | |
TEST (Ryu, Denormal) | |
TEST (Ryu, SwitchToSubnormal) | |
TEST (Ryu, MinAndMax) | |
TEST (Ryu, BoundaryRoundEven) | |
TEST (Ryu, ExactValueRoundEven) | |
TEST (Ryu, LotsOfTrailingZeros) | |
TEST (Ryu, Regression) | |
TEST (Ryu, RoundTrip) | |
TEST (Ryu, LooksLikePow5) | |
TEST (Ryu, OutputLength) | |
TEST (IntegerPrinting, Basic) | |
void | TestRyuParse (float f, std::string in) |
TEST (Ryu, Basic) | |
TEST (Ryu, MinMax) | |
TEST (Ryu, MantissaRoundingOverflow) | |
TEST (Ryu, TrailingZeros) | |
TEST (IntrusivePtr, Basic) | |
std::string | GetModelStr () |
TEST (Json, TestParseObject) | |
TEST (Json, ParseNumber) | |
TEST (Json, ParseArray) | |
TEST (Json, Null) | |
TEST (Json, EmptyObject) | |
TEST (Json, EmptyArray) | |
TEST (Json, Boolean) | |
TEST (Json, Indexing) | |
TEST (Json, AssigningObjects) | |
TEST (Json, AssigningArray) | |
TEST (Json, AssigningNumber) | |
TEST (Json, AssigningString) | |
TEST (Json, LoadDump) | |
TEST (Json, Invalid) | |
TEST (Json, CopyUnicode) | |
TEST (Json, WrongCasts) | |
TEST (Json, Integer) | |
TEST (Json, IntVSFloat) | |
TEST (Json, RoundTrip) | |
TEST (Json, DISABLED_RoundTripExhaustive) | |
TEST (Json, TypedArray) | |
TEST (UBJson, Basic) | |
TEST (Json, TypeCheck) | |
TEST (StringView, Basic) | |
TEST (Version, Basic) | |
TEST (Adapter, CSRAdapter) | |
TEST (Adapter, CSRArrayAdapter) | |
TEST (Adapter, CSCAdapterColsMoreThanRows) | |
int | CSRSetDataNextForTest (DataIterHandle data_handle, XGBCallbackSetData *set_function, DataHolderHandle set_function_handle) |
TEST (Adapter, IteratorAdapter) | |
TEST (ArrayInterface, Initialize) | |
TEST (ArrayInterface, Error) | |
TEST (ArrayInterface, GetElement) | |
TEST (ArrayInterface, TrivialDim) | |
TEST (ArrayInterface, ToDType) | |
template<typename T > | |
Json | GenerateDenseColumn (std::string const &typestr, size_t kRows, thrust::device_vector< T > *out_d_data) |
template<typename T > | |
Json | GenerateSparseColumn (std::string const &typestr, size_t kRows, thrust::device_vector< T > *out_d_data) |
template<typename T > | |
Json | Generate2dArrayInterface (int rows, int cols, std::string typestr, thrust::device_vector< T > *p_data) |
TEST (SparsePage, PushCSC) | |
TEST (SparsePage, PushCSCAfterTranspose) | |
TEST (SparsePage, SortIndices) | |
TEST (DMatrix, Uri) | |
TEST (MetaInfo, CPUStridedData) | |
void | TestMetaInfoStridedData (int32_t device) |
TEST (GBTree, SelectTreeMethod) | |
TEST (GBTree, PredictionCache) | |
TEST (GBTree, WrongUpdater) | |
TEST (GBTree, JsonIO) | |
TEST (Dart, JsonIO) | |
TEST_P (Dart, Prediction) | |
INSTANTIATE_TEST_SUITE_P (PredictorTypes, Dart, testing::Values("CPU")) | |
std::pair< Json, Json > | TestModelSlice (std::string booster) |
TEST (GBTree, Slice) | |
TEST (Dart, Slice) | |
TEST (GBTree, FeatureScore) | |
TEST (GBTree, PredictRange) | |
TEST (GBTree, InplacePredictionError) | |
float | GetBaseScore (Json const &config) |
std::pair< std::vector< std::string >, std::string > | MakeArrayInterfaceBatch (HostDeviceVector< float > const *storage, std::size_t n_samples, bst_feature_t n_features, std::size_t batches, std::int32_t device) |
std::shared_ptr< DMatrix > | GetDMatrixFromData (const std::vector< float > &x, std::size_t num_rows, bst_feature_t num_columns) |
std::unique_ptr< DMatrix > | CreateSparsePageDMatrix (bst_row_t n_samples, bst_feature_t n_features, size_t n_batches, std::string prefix="cache") |
Create Sparse Page using data iterator. | |
std::unique_ptr< DMatrix > | CreateSparsePageDMatrix (size_t n_entries, std::string prefix="cache") |
Deprecated, stop using it. | |
std::unique_ptr< DMatrix > | CreateSparsePageDMatrixWithRC (size_t n_rows, size_t n_cols, size_t page_size, bool deterministic, const dmlc::TemporaryDirectory &tempdir=dmlc::TemporaryDirectory()) |
Deprecated, stop using it. | |
std::unique_ptr< GradientBooster > | CreateTrainedGBM (std::string name, Args kwargs, size_t kRows, size_t kCols, LearnerModelParam const *learner_model_param, Context const *ctx) |
void | DMatrixToCSR (DMatrix *dmat, std::vector< float > *p_data, std::vector< size_t > *p_row_ptr, std::vector< bst_feature_t > *p_cids) |
void | DeleteRMMResource (RMMAllocator *) |
RMMAllocatorPtr | SetUpRMMResourceForCppTests (int, char **) |
template<typename T > | |
Json | GetArrayInterface (HostDeviceVector< T > const *storage, size_t rows, size_t cols) |
std::shared_ptr< DMatrix > | EmptyDMatrix () |
std::vector< float > | GenerateRandomCategoricalSingleColumn (int n, size_t num_categories) |
std::unique_ptr< HostDeviceVector< GradientPair > > | GenerateGradients (std::size_t rows, bst_target_t n_targets=1) |
Context | MakeCUDACtx (std::int32_t device) |
Make a context that uses CUDA if device >= 0. | |
HostDeviceVector< GradientPair > | GenerateRandomGradients (const size_t n_rows, float lower=0.0f, float upper=1.0f) |
void | Reset (DataIterHandle self) |
int | Next (DataIterHandle self) |
LearnerModelParam | MakeMP (bst_feature_t n_features, float base_score, uint32_t n_groups, int32_t device=Context::kCpuId) |
std::int32_t | AllThreadsForTest () |
template<bool use_nccl = false, typename Function , typename... Args> | |
void | RunWithInMemoryCommunicator (int32_t world_size, Function &&function, Args &&... args) |
void | TestUpdaterJsonIO (std::string updater_str) |
TEST (Linear, Shotgun) | |
TEST (Shotgun, JsonIO) | |
TEST (Linear, coordinate) | |
TEST (Coordinate, JsonIO) | |
TEST (Metric, UnknownMetric) | |
TEST (Objective, DeclareUnifiedTest(HingeObj)) | |
TEST (Objective, DeclareUnifiedTest(SoftmaxMultiClassObjGPair)) | |
TEST (Objective, DeclareUnifiedTest(SoftmaxMultiClassBasic)) | |
TEST (Objective, DeclareUnifiedTest(SoftprobMultiClassBasic)) | |
TEST (Objective, PredTransform) | |
TEST_P (TestDefaultObjConfig, Objective) | |
INSTANTIATE_TEST_SUITE_P (Objective, TestDefaultObjConfig, ::testing::ValuesIn(MakeObjNamesForTest()), [](const ::testing::TestParamInfo< TestDefaultObjConfig::ParamType > &info) { return ObjTestNameGenerator(info);}) | |
TEST (Objective, DeclareUnifiedTest(Quantile)) | |
TEST (Objective, DeclareUnifiedTest(QuantileIntercept)) | |
TEST (Objective, DeclareUnifiedTest(LinearRegressionGPair)) | |
TEST (Objective, DeclareUnifiedTest(SquaredLog)) | |
TEST (Objective, DeclareUnifiedTest(PseudoHuber)) | |
TEST (Objective, DeclareUnifiedTest(LogisticRegressionGPair)) | |
TEST (Objective, DeclareUnifiedTest(LogisticRegressionBasic)) | |
TEST (Objective, DeclareUnifiedTest(LogisticRawGPair)) | |
TEST (Objective, DeclareUnifiedTest(PoissonRegressionGPair)) | |
TEST (Objective, DeclareUnifiedTest(PoissonRegressionBasic)) | |
TEST (Objective, DeclareUnifiedTest(GammaRegressionGPair)) | |
TEST (Objective, DeclareUnifiedTest(GammaRegressionBasic)) | |
TEST (Objective, DeclareUnifiedTest(TweedieRegressionGPair)) | |
TEST (Objective, DeclareUnifiedTest(TweedieRegressionBasic)) | |
TEST (Objective, CoxRegressionGPair) | |
TEST (Objective, DeclareUnifiedTest(AbsoluteError)) | |
TEST (Objective, DeclareUnifiedTest(AbsoluteErrorLeaf)) | |
TEST (Adaptive, DeclareUnifiedTest(MissingLeaf)) | |
std::shared_ptr< DMatrix > | MakeFmatForObjTest (std::string const &obj) |
auto | MakeObjNamesForTest () |
template<typename ParamType > | |
std::string | ObjTestNameGenerator (const ::testing::TestParamInfo< ParamType > &info) |
template<typename Function , typename... Args> | |
void | RunWithFederatedCommunicator (int32_t world_size, std::string const &server_address, Function &&function, Args &&... args) |
TEST (Plugin, ExampleObjective) | |
void | VerifyLoadUri () |
TEST_F (FederatedDataTest, LoadUri) | |
TEST_P (FederatedLearnerTest, Approx) | |
TEST_P (FederatedLearnerTest, Hist) | |
INSTANTIATE_TEST_SUITE_P (FederatedLearnerObjective, FederatedLearnerTest, ::testing::ValuesIn(MakeObjNamesForTest()), [](const ::testing::TestParamInfo< FederatedLearnerTest::ParamType > &info) { return ObjTestNameGenerator(info);}) | |
TEST_F (FederatedServerTest, Allgather) | |
TEST_F (FederatedServerTest, Allreduce) | |
TEST_F (FederatedServerTest, Broadcast) | |
TEST_F (FederatedServerTest, Mixture) | |
TEST (Plugin, OneAPIPredictorBasic) | |
TEST (Plugin, OneAPIPredictorExternalMemory) | |
TEST (Plugin, OneAPIPredictorInplacePredict) | |
TEST (Plugin, LinearRegressionGPairOneAPI) | |
TEST (Plugin, SquaredLogOneAPI) | |
TEST (Plugin, LogisticRegressionGPairOneAPI) | |
TEST (Plugin, LogisticRegressionBasicOneAPI) | |
TEST (Plugin, LogisticRawGPairOneAPI) | |
TEST (Plugin, CPUvsOneAPI) | |
TEST (CpuPredictor, Basic) | |
TEST (CpuPredictor, BasicColumnSplit) | |
TEST (CpuPredictor, IterationRange) | |
TEST (CpuPredictor, IterationRangeColmnSplit) | |
TEST (CpuPredictor, ExternalMemory) | |
TEST (CpuPredictor, InplacePredict) | |
TEST (CPUPredictor, GHistIndexTraining) | |
TEST (CPUPredictor, CategoricalPrediction) | |
TEST (CPUPredictor, CategoricalPredictionColumnSplit) | |
TEST (CPUPredictor, CategoricalPredictLeaf) | |
TEST (CPUPredictor, CategoricalPredictLeafColumnSplit) | |
TEST (CpuPredictor, UpdatePredictionCache) | |
TEST (CpuPredictor, LesserFeatures) | |
TEST (CpuPredictor, LesserFeaturesColumnSplit) | |
TEST (CpuPredictor, Sparse) | |
TEST (CpuPredictor, SparseColumnSplit) | |
TEST (CpuPredictor, Multi) | |
TEST (CpuPredictor, Access) | |
TEST (Predictor, PredictionCache) | |
void | TestTrainingPrediction (Context const *ctx, size_t rows, size_t bins, std::shared_ptr< DMatrix > p_full, std::shared_ptr< DMatrix > p_hist) |
void | TestInplacePrediction (Context const *ctx, std::shared_ptr< DMatrix > x, bst_row_t rows, bst_feature_t cols) |
void | TestPredictionWithLesserFeatures (Context const *ctx) |
void | TestPredictionDeviceAccess () |
void | TestPredictionWithLesserFeaturesColumnSplit (Context const *ctx) |
void | GBTreeModelForTest (gbm::GBTreeModel *model, uint32_t split_ind, bst_cat_t split_cat, float left_weight, float right_weight) |
void | TestCategoricalPrediction (Context const *ctx, bool is_column_split) |
void | TestCategoricalPredictionColumnSplit (Context const *ctx) |
void | TestCategoricalPredictLeaf (Context const *ctx, bool is_column_split) |
void | TestCategoricalPredictLeafColumnSplit (Context const *ctx) |
void | TestIterationRange (Context const *ctx) |
void | TestIterationRangeColumnSplit (Context const *ctx) |
void | TestSparsePrediction (Context const *ctx, float sparsity) |
void | TestSparsePredictionColumnSplit (Context const *ctx, float sparsity) |
void | TestVectorLeafPrediction (Context const *ctx) |
gbm::GBTreeModel | CreateTestModel (LearnerModelParam const *param, Context const *ctx, size_t n_classes=1) |
auto | CreatePredictorForTest (Context const *ctx) |
template<typename Page > | |
void | TestPredictionFromGradientIndex (Context const *ctx, size_t rows, size_t cols, std::shared_ptr< DMatrix > p_hist) |
TEST (DMatrixCache, Basic) | |
TEST (DMatrixCache, MultiThread) | |
TEST (Context, CPU) | |
TEST (GlobalConfiguration, Verbosity) | |
TEST (GlobalConfiguration, UseRMM) | |
TEST (RandomDataGenerator, DMatrix) | |
TEST (RandomDataGenerator, GenerateArrayInterfaceBatch) | |
TEST (Learner, Basic) | |
TEST (Learner, ParameterValidation) | |
TEST (Learner, CheckGroup) | |
TEST (Learner, SLOW_CheckMultiBatch) | |
TEST (Learner, Configuration) | |
TEST (Learner, JsonModelIO) | |
TEST (Learner, ConfigIO) | |
TEST (Learner, MultiThreadedPredict) | |
TEST (Learner, BinaryModelIO) | |
TEST (Learner, Seed) | |
TEST (Learner, ConstantSeed) | |
TEST (Learner, FeatureInfo) | |
TEST (Learner, MultiTarget) | |
TEST_F (InitBaseScore, TestUpdateConfig) | |
TEST_F (InitBaseScore, FromAvgParam) | |
TEST_F (InitBaseScore, InitAfterLoad) | |
TEST_F (InitBaseScore, InitWithPredict) | |
TEST_F (InitBaseScore, UpdateProcess) | |
TEST_P (TestColumnSplit, Objective) | |
INSTANTIATE_TEST_SUITE_P (ColumnSplitObjective, TestColumnSplit, ::testing::ValuesIn(MakeObjNamesForTest()), [](const ::testing::TestParamInfo< TestColumnSplit::ParamType > &info) { return ObjTestNameGenerator(info);}) | |
TEST (Logging, Basic) | |
TEST_F (TestL1MultiTarget, Hist) | |
TEST_F (TestL1MultiTarget, Exact) | |
TEST_F (TestL1MultiTarget, Approx) | |
TEST (MultiStrategy, Configure) | |
template<typename Array > | |
void | CompareIntArray (Json l, Json r) |
void | CompareJSON (Json l, Json r) |
void | TestLearnerSerialization (Args args, FeatureMap const &fmap, std::shared_ptr< DMatrix > p_dmat) |
TEST_F (SerializationTest, Exact) | |
TEST_F (SerializationTest, Approx) | |
TEST_F (SerializationTest, Hist) | |
TEST_F (SerializationTest, CPUCoordDescent) | |
TEST_F (L1SerializationTest, Exact) | |
TEST_F (L1SerializationTest, Approx) | |
TEST_F (L1SerializationTest, Hist) | |
TEST_F (LogitSerializationTest, Exact) | |
TEST_F (LogitSerializationTest, Approx) | |
TEST_F (LogitSerializationTest, Hist) | |
TEST_F (LogitSerializationTest, CPUCoordDescent) | |
TEST_F (MultiClassesSerializationTest, Exact) | |
TEST_F (MultiClassesSerializationTest, Approx) | |
TEST_F (MultiClassesSerializationTest, Hist) | |
TEST_F (MultiClassesSerializationTest, CPUCoordDescent) | |
TEST (MultiTargetTree, JsonIO) | |
TEST (Updater, HasNodePosition) | |
TEST_F (TestPredictionCache, Approx) | |
TEST_F (TestPredictionCache, Hist) | |
TEST_F (TestPredictionCache, HistMulti) | |
TEST_F (RegenTest, Approx) | |
TEST_F (RegenTest, Hist) | |
TEST_F (RegenTest, Mixed) | |
TEST (Tree, ModelShape) | |
TEST (Tree, AllocateNode) | |
TEST (Tree, ExpandCategoricalFeature) | |
void | GrowTree (RegTree *p_tree) |
void | CheckReload (RegTree const &tree) |
TEST (Tree, CategoricalIO) | |
TEST (Tree, DumpJson) | |
TEST (Tree, DumpJsonCategorical) | |
TEST (Tree, DumpText) | |
TEST (Tree, DumpTextCategorical) | |
TEST (Tree, DumpDot) | |
TEST (Tree, DumpDotCategorical) | |
TEST (Tree, JsonIO) | |
TEST_F (TestGrowPolicy, Approx) | |
TEST_F (TestGrowPolicy, Hist) | |
TEST_F (UpdaterTreeStatTest, Hist) | |
TEST_F (UpdaterTreeStatTest, Exact) | |
TEST_F (UpdaterTreeStatTest, Approx) | |
TEST_F (UpdaterEtaTest, Hist) | |
TEST_F (UpdaterEtaTest, Exact) | |
TEST_F (UpdaterEtaTest, Approx) | |
TEST_F (TestMinSplitLoss, Approx) | |
TEST_F (TestMinSplitLoss, Hist) | |
Variables | |
constexpr bst_float | kRtEps = 1e-6f |
small eps gap for minimum split decision. | |
std::string const bool | with_stats |
std::string | attrs |
namespace of xgboost
Copyright 2022-2023 XGBoost contributors.
Copyright 2021-2023 by XGBoost contributors.
Copyright (c) 2017-2023, XGBoost contributors.
Copyright 2023, XGBoost Contributors.
Copyright (c) 2023, XGBoost contributors.
Copyright 2016-2023 by XGBoost Contributors.
Copyright 2018-2023 by XGBoost contributors.
Copyright 2022-2023, XGBoost contributors.
Copyright (c) 2019-2023, XGBoost Contributors.
Utilities for testing categorical data support.
Copyright 2020-2023 by XGBoost Contributors.
Copyright 2018-2023 by Contributors.
Copyright by XGBoost Contributors 2017-2022.
Copyright 2023 by XGBoost Contributors.
Copyright 2018-2023 by XGBoost Contributors.
Copyright 2017-2023, XGBoost Contributors.
Copyright 2017-2023 by XGBoost Contributors.
Copyright 2019-2023, XGBoost contributors.
Copyright 2014-2023 by XGBoost Contributors.
Copyright 2022 by XGBoost Contributors.
Copyright 2017-2023 by XGBoost contributors.
Implement std::to_chars
and std::from_chars
for float. Only base 10 with scientific format is supported. The implementation guarantees roundtrip reproducibility.
An implementation of Ryu algorithm:
Copyright 2016-2023 by XGBoost contributors.
Copyright 2022-2023 by XGBoost Contributors.
Copyright 2022-2023 by XGBoost contributors.
Copyright 2021-2023 by XGBoost Contributors.
Copyright 2019-2023, XGBoost Contributors.
Copyright 2019-2023 by XGBoost Contributors.
Copyright 2023 by XGBoost contributors.
Core data structure for multi-target trees.
Copyright 2021-2022 by XGBoost Contributors
Copyright 2022 XGBoost contributors
Copyright by Contributors 2017-2020
Copyright 2017-2020 XGBoost contributors
XGBoost: eXtreme Gradient Boosting library. Contributors: https://github.com/dmlc/xgboost/blob/master/CONTRIBUTORS.md
Higher level functions built on top the Communicator API, taking care of behavioral differences between row-split vs column-split distributed training, and horizontal vs vertical federated learning.
Copyright (c) 2022 by XGBoost Contributors
Copyright 2020 by XGBoost Contributors
https://dl.acm.org/citation.cfm?id=3192369
The code is adopted from original (half) c implementation: https://github.com/ulfjack/ryu.git with some more comments and tidying. License is attached below.
Copyright 2018 Ulf Adams
The contents of this file may be used under the terms of the Apache License, Version 2.0.
(See accompanying file LICENSE-Apache or copy at http: *www.apache.org/licenses/LICENSE-2.0)
Alternatively, the contents of this file may be used under the terms of the Boost Software License, Version 1.0. (See accompanying file LICENSE-Boost or copy at https://www.boost.org/LICENSE_1_0.txt)
Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Copyright 2019 by XGBoost Contributors
Copyright 2022 by XGBoost Contributors
Copyright 2022, by XGBoost Contributors
Copyright 2020-2022 by XGBoost Contributors
Copyright by Contributors 2019
Copyright by Contributors 2017-2019
Copyright 2018-2022 XGBoost contributors
Copyright 2019 XGBoost contributors
Context object used for controlling runtime parameters.
Data type for fast histogram aggregation.
Copyright 2019-2021 XGBoost contributors
Copyright 2021 by XGBoost Contributors
Copyright 2019-2022 by Contributors
Copyright 2018-2019 by Contributors
Copyright 2018 XGBoost contributors
Utilities for estimating initial score.
Copyright 2019 by Contributors
Copyright 2019-2022 by XGBoost Contributors
Copyright 2022, XGBoost contributors.
Copyright (c) by Contributors 2020
Copyright 2021 XGBoost contributors
Copyright 2020 XGBoost contributors
Copyright (c) 2023 by XGBoost Contributors
Copyright 2018-2019 XGBoost contributors
Copyright 2022-2023 XGBoost contributors
Copyright 2023 XGBoost contributors
Copyright 2017-2019 XGBoost contributors
using xgboost::bst_row_t = typedef std::size_t |
Type for data row index.
Be careful ‘std::size_t’ is implementation-defined. Meaning that the binary representation of DMatrix might not be portable across platform. Booster model should be portable as parameters are floating points.
enum xgboost::GPUAccess |
Controls data access from the GPU.
Since a HostDeviceVector
can have data on both the host and device, access control needs to be maintained to keep the data consistent.
There are 3 scenarios supported:
void xgboost::AssignColumnBinIndex | ( | GHistIndexMatrix const & | page, |
Fn && | assign | ||
) |
Helper for recovering feature index from row-based storage of histogram bin.
assign | A callback function that takes bin index, index into the whole batch, row index and feature index |
void xgboost::CalculateContributions | ( | RegTree const & | tree, |
const RegTree::FVec & | feat, | ||
std::vector< float > * | mean_values, | ||
bst_float * | out_contribs, | ||
int | condition, | ||
unsigned | condition_feature | ||
) |
calculate the feature contributions (https://arxiv.org/abs/1706.06060) for the tree
feat | dense feature vector, if the feature is missing the field is set to NaN |
out_contribs | output vector to hold the contributions |
condition | fix one feature to either off (-1) on (1) or not fixed (0 default) |
condition_feature | the index of the feature to fix |
std::unique_ptr< DMatrix > xgboost::CreateSparsePageDMatrix | ( | bst_row_t | n_samples, |
bst_feature_t | n_features, | ||
size_t | n_batches, | ||
std::string | prefix = "cache" |
||
) |
std::unique_ptr< DMatrix > xgboost::CreateSparsePageDMatrixWithRC | ( | size_t | n_rows, |
size_t | n_cols, | ||
size_t | page_size, | ||
bool | deterministic, | ||
const dmlc::TemporaryDirectory & | tempdir = dmlc::TemporaryDirectory() |
||
) |
Deprecated, stop using it.
Creates dmatrix with some records, each record containing random number of features in [1, n_cols]
n_rows | Number of records to create. |
n_cols | Max number of features within that record. |
page_size | Sparse page size for the pages within the dmatrix. If page size is 0 then the entire dmatrix is resident in memory; else, multiple sparse pages of page size are created and backed to disk, which would have to be streamed in at point of use. |
deterministic | The content inside the dmatrix is constant for this configuration, if true; else, the content changes every time this method is invoked |
Args xgboost::FromJson | ( | Json const & | obj, |
Parameter * | param | ||
) |
Load a XGBoost parameter from a JSON object.
Parameter | An instantiation of XGBoostParameter |
obj | JSON object representing the parameter. |
param | Output parameter. |
auto xgboost::get | ( | U & | json | ) | -> decltype(detail::GetImpl(*Cast<T>(&json.GetValue())))& |
bool xgboost::IsA | ( | Json const & | j | ) |
Check whether a Json object has specific type.
xgboost::TEST | ( | CAPI | , |
JsonModelIO | |||
) |
In memory
Object xgboost::ToJson | ( | Parameter const & | param | ) |
Convert XGBoost parameter to JSON object.
Parameter | An instantiation of XGBoostParameter |
param | Input parameter |
void xgboost::TreeShap | ( | RegTree const & | tree, |
const RegTree::FVec & | feat, | ||
float * | phi, | ||
bst_node_t | node_index, | ||
std::uint32_t | unique_depth, | ||
PathElement * | parent_unique_path, | ||
float | parent_zero_fraction, | ||
float | parent_one_fraction, | ||
int | parent_feature_index, | ||
int | condition, | ||
std::uint32_t | condition_feature, | ||
float | condition_fraction | ||
) |
Recursive function that computes the feature attributions for a single tree.
feat | dense feature vector, if the feature is missing the field is set to NaN |
phi | dense output vector of feature attributions |
node_index | the index of the current node in the tree |
unique_depth | how many unique features are above the current node in the tree |
parent_unique_path | a vector of statistics about our current path through the tree |
parent_zero_fraction | what fraction of the parent path weight is coming as 0 (integrated) |
parent_one_fraction | what fraction of the parent path weight is coming as 1 (fixed) |
parent_feature_index | what feature the parent node used to split |
condition | fix one feature to either off (-1) on (1) or not fixed (0 default) |
condition_feature | the index of the feature to fix |
condition_fraction | what fraction of the current weight matches our conditioning feature |
void xgboost::TypeCheck | ( | Json const & | value, |
StringView | name | ||
) |
Type check for JSON-based parameters.
JT | Expected JSON types. |
value | Value to be checked. |
std::string bool xgboost::with_stats |