Skip to content

Commit 9261f05

Browse files
authored
[enc] Support trianing continuation. (#11598)
- Use the `__arrow_c_device_array__` in cuDF 25.06. - Reuse the `feature_types` for reference encoding. - Change the columnar schema to include a handle to the cat container. - Support training continuation through re-coding the `DMatrix`. - Handle invalid input type. - Support all integer types.
1 parent a9644bf commit 9261f05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1659
-798
lines changed

doc/python/python_api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Core Data Structure
4343
:members:
4444
:show-inheritance:
4545

46+
.. autoclass:: xgboost.core.Categories
47+
4648
Learning API
4749
------------
4850
.. automodule:: xgboost.training

include/xgboost/json.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ class Value {
4545
kI8Array = 9,
4646
kU8Array = 10,
4747
kI16Array = 11,
48-
kI32Array = 12,
49-
kI64Array = 13
48+
kU16Array = 12,
49+
kI32Array = 13,
50+
kU32Array = 14,
51+
kI64Array = 15,
52+
kU64Array = 16,
5053
};
5154

5255
explicit Value(ValueKind _kind) : kind_{_kind} {}
@@ -192,14 +195,26 @@ using U8Array = JsonTypedArray<std::uint8_t, Value::ValueKind::kU8Array>;
192195
* @brief Typed UBJSON array for int16_t.
193196
*/
194197
using I16Array = JsonTypedArray<std::int16_t, Value::ValueKind::kI16Array>;
198+
/**
199+
* @brief Typed UBJSON array for uint16_t.
200+
*/
201+
using U16Array = JsonTypedArray<std::uint16_t, Value::ValueKind::kU16Array>;
195202
/**
196203
* @brief Typed UBJSON array for int32_t.
197204
*/
198205
using I32Array = JsonTypedArray<std::int32_t, Value::ValueKind::kI32Array>;
206+
/**
207+
* @brief Typed UBJSON array for uint32_t.
208+
*/
209+
using U32Array = JsonTypedArray<std::uint32_t, Value::ValueKind::kU32Array>;
199210
/**
200211
* @brief Typed UBJSON array for int64_t.
201212
*/
202213
using I64Array = JsonTypedArray<std::int64_t, Value::ValueKind::kI64Array>;
214+
/**
215+
* @brief Typed UBJSON array for uint64_t.
216+
*/
217+
using U64Array = JsonTypedArray<std::uint64_t, Value::ValueKind::kU64Array>;
203218

204219
class JsonObject : public Value {
205220
public:

include/xgboost/json_io.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,11 @@ class JsonWriter {
143143
virtual void Visit(I8Array const* arr);
144144
virtual void Visit(U8Array const* arr);
145145
virtual void Visit(I16Array const* arr);
146+
virtual void Visit(U16Array const* arr);
146147
virtual void Visit(I32Array const* arr);
148+
virtual void Visit(U32Array const* arr);
147149
virtual void Visit(I64Array const* arr);
150+
virtual void Visit(U64Array const* arr);
148151
virtual void Visit(JsonObject const* obj);
149152
virtual void Visit(JsonNumber const* num);
150153
virtual void Visit(JsonInteger const* num);

python-package/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ follow_imports = "silent"
5959

6060
[tool.pylint.main]
6161
ignore = ["tests"]
62-
extension-pkg-whitelist = ["numpy"]
62+
extension-pkg-whitelist = ["numpy", "cuda"]
6363
disable = [
6464
"import-error",
6565
"attribute-defined-outside-init",

0 commit comments

Comments
 (0)