|
198 | 198 | function save(b::Booster, ::Type{Vector{UInt8}}; format::AbstractString="json") |
199 | 199 | cfg = JSON.json(Dict("format"=>format)) |
200 | 200 | olen = Ref{Lib.bst_ulong}() |
201 | | - o = Ref{Ptr{Int8}}() |
| 201 | + o = Ref{Ptr{Cchar}}() |
202 | 202 | xgbcall(XGBoosterSaveModelToBuffer, b.handle, cfg, olen, o) |
203 | 203 | unsafe_wrap(Array, convert(Ptr{UInt8}, o[]), olen[]) |
204 | 204 | end |
@@ -245,7 +245,7 @@ The output of this function can be loaded with [`deserialize`](@ref). |
245 | 245 | """ |
246 | 246 | function serialize(b::Booster) |
247 | 247 | olen = Ref{Lib.bst_ulong}() |
248 | | - o = Ref{Ptr{Int8}}() # don't know why it insists on Int8 |
| 248 | + o = Ref{Ptr{Cchar}}() # don't know why it insists on Cchar |
249 | 249 | xgbcall(XGBoosterSerializeToBuffer, b.handle, olen, o) |
250 | 250 | unsafe_wrap(Array, convert(Ptr{UInt8}, o[]), olen[]) |
251 | 251 | end |
@@ -336,7 +336,7 @@ predict(b::Booster, Xy::DMatrix; kw...) = copy(predict_nocopy(b, Xy; kw...)) |
336 | 336 | predict(b::Booster, Xy; kw...) = predict(b, DMatrix(Xy); kw...) |
337 | 337 |
|
338 | 338 | function evaliter(b::Booster, watch, n::Integer=1) |
339 | | - o = Ref{Ptr{Int8}}() |
| 339 | + o = Ref{Ptr{Cchar}}() |
340 | 340 | names = collect(Iterators.map(string, keys(watch))) |
341 | 341 | watch = collect(Iterators.map(x -> x.handle, values(watch))) |
342 | 342 | xgbcall(XGBoosterEvalOneIter, b.handle, n, watch, names, length(watch), o) |
|
0 commit comments