GithubHelp home page GithubHelp logo

xgboost.jl's Introduction

XGBoost.jl

Build Status Latest Version Pkg Eval Dependents docs

eXtreme Gradient Boosting in Julia.

Abstract

This package is a Julia interface of XGBoost. It is an efficient and scalable implementation of distributed gradient boosting framework. The package includes efficient linear model solver and tree learning algorithms. The library is parallelized using OpenMP, and it can be more than 10 times faster than some existing gradient boosting packages. It supports various objective functions, including regression, classification and ranking. The package is also made to be extensible, so that users are also allowed to define their own objectives easily.

See the documentation for more information.

Installation

] add XGBoost

This package uses xgboost_jll to package the xgboost binaries (will be installed automatically).

Preview

xgboost.jl's People

Contributors

a-lost-wapiti avatar ablaom avatar allardvm avatar andreasnoack avatar antinucleon avatar artemsolod avatar aviks avatar david-sun-1 avatar deepaksuresh avatar devmotion avatar expandingman avatar fionnan avatar freeboson avatar iblislin avatar jackdunnnz avatar jumutc avatar khosravipasha avatar maximsch2 avatar moelf avatar rikhuijzer avatar simonschoelly avatar slundberg avatar staticfloat avatar tanmaykm avatar tqchen avatar tylerjthomas9 avatar zhmz90 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xgboost.jl's Issues

Build errors in Julia 0.3.8

I tried to add XGBoost.jl to Julia and hot build errors.

Pkg.add("XGBoost")
.. none of the available packages can install dependcy xgboostwrapper
WARNING: XGBoost had build errors

i tried also
Pkg.clone("https://github.com/antinucleon/XGBoost.jl.git")
Pkg.build("XGBoost")

Same result.

Any Ideas?

ye the way: This is th eoutput from Pkg.clone/Pkg.build
julia> Pkg.clone("https://github.com/antinucleon/XGBoost.jl.git")
INFO: Cloning XGBoost from https://github.com/antinucleon/XGBoost.jl.git
INFO: Computing changes...
INFO: No packages to install, update or remove
INFO: Package database updated

julia> Pkg.build("XGBoost")
INFO: Building XGBoost
===============================[ ERROR: XGBoost ]===============================

None of the selected providers can install dependency xgboostwrapper.
Use BinDeps.debug(package_name) to see available providers

while loading C:\dev\WinPython-64bit-3.4.3.2FlavorJulia\settings.julia\v0.3\XGB
oost\deps\build.jl, in expression starting on line 24

================================[ BUILD ERRORS ]================================

WARNING: XGBoost had build errors.

  • packages with build errors remain installed in C:\dev\WinPython-64bit-3.4.3.2
    FlavorJulia\settings.julia\v0.3
  • build the package(s) and all dependencies with Pkg.build("XGBoost")
  • build a single package by running its deps/build.jl script

julia> BinDeps.debug("xgboostwrapper")
INFO: Reading build script...
ERROR: could not open file C:\dev\WinPython-64bit-3.4.3.2FlavorJulia\settings.j
ulia\v0.3\xgboostwrapper\deps\build.jl
in include at boot.jl:245
in include_from_node1 at loading.jl:128
in debug_context at C:\dev\WinPython-64bit-3.4.3.2FlavorJulia\settings.julia\v
0.3\BinDeps\src\debug.jl:54
in debug at C:\dev\WinPython-64bit-3.4.3.2FlavorJulia\settings.julia\v0.3\BinD
eps\src\debug.jl:59
in debug at C:\dev\WinPython-64bit-3.4.3.2FlavorJulia\settings.julia\v0.3\BinD
eps\src\debug.jl:65

Need better error validation for improper inputs

I provided an improper data structure for labels to and got the following error. I was providing a vector of tuples instead of what it expects. I think validating the types of the inputs and providing a better error message would be helpful.

julia> bst = xgboost(s, 20, label = labels, eta = 1, max_depth = 2)
ERROR: MethodError: no method matching (::getfield(XGBoost, Symbol("#_setinfo#8")))(::Ptr{Nothing}, ::String, ::Array{Tuple{Vararg{String,N} where N},1})
Closest candidates are:
  _setinfo(::Ptr{Nothing}, ::String, ::Array{#s12,1} where #s12<:Number) at /Users/viral/.julia/packages/XGBoost/udvqz/src/xgboost_lib.jl:10
Stacktrace:
 [1] (::getfield(XGBoost, Symbol("##DMatrix#6#10")){getfield(XGBoost, Symbol("#_setinfo#8"))})(::Base.Iterators.Pairs{Symbol,Array{Tuple{Vararg{String,N} where N},1},Tuple{Symbol},NamedTuple{(:label,),Tuple{Array{Tuple{Vararg{String,N} where N},1}}}}, ::Type, ::SparseMatrixCSC{Float64,Int64}, ::Bool) at /Users/viral/.julia/packages/XGBoost/udvqz/src/xgboost_lib.jl:40
 [2] (::getfield(Core, Symbol("#kw#Type")))(::NamedTuple{(:label,),Tuple{Array{Tuple{Vararg{String,N} where N},1}}}, ::Type{DMatrix}, ::SparseMatrixCSC{Float64,Int64}, ::Bool) at ./none:0 (repeats 2 times)
 [3] makeDMatrix(::SparseMatrixCSC{Float64,Int64}, ::Array{Tuple{Vararg{String,N} where N},1}) at /Users/viral/.julia/packages/XGBoost/udvqz/src/xgboost_lib.jl:137
 [4] #xgboost#20(::Array{Tuple{Vararg{String,N} where N},1}, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Type, ::Type, ::Array{Any,1}, ::Base.Iterators.Pairs{Symbol,Int64,Tuple{Symbol,Symbol},NamedTuple{(:eta, :max_depth),Tuple{Int64,Int64}}}, ::typeof(xgboost), ::SparseMatrixCSC{Float64,Int64}, ::Int64) at /Users/viral/.julia/packages/XGBoost/udvqz/src/xgboost_lib.jl:147
 [5] (::getfield(XGBoost, Symbol("#kw##xgboost")))(::NamedTuple{(:label, :eta, :max_depth),Tuple{Array{Tuple{Vararg{String,N} where N},1},Int64,Int64}}, ::typeof(xgboost), ::SparseMatrixCSC{Float64,Int64}, ::Int64) at ./none:0
 [6] top-level scope at none:0

Discuss package refactoring and the road to feature parity

I'm currently refactoring the internals of this package to make optimal use of the Julia language and I keep running into the same trade-off, and I'd like some input.

On the one hand, we can keep the package as close as possible to the Python package (as it is now). This makes it quite easy for new users to get started, since they might be familiar with the Python package. Even if they aren't, they can rely on the Python documentation. Nevertheless, the current Julia interface differs in some respects; functions have different names, arguments have a different order, and some functions are not (yet) supported. A refactoring of the update() function in this style would look something like:

function update(bst::Booster, dtrain::DMatrix, iteration::Integer;
                fobj::Union{Function,Void} = nothing)
    if typeof(fobj) == Function
        pred = predict(bst, dtrain)
        grad, hess = fobj(pred, dtrain)
        @assert size(grad) == size(hess)
        XGBoosterBoostOneIter(bst.handle, dtrain.handle, grad, hess, length(hess))
    else
        XGBoosterUpdateOneIter(bst.handle, iteration, dtrain.handle)
    end
end

On the other hand, it is important to use a coding style that'll be familiar to other Julia users. This avoids errors (such as users not recognizing that an argument is keyword argument), makes it more likely that we'll attract contributions, and more likely that users spot a bug. There is also some performance to be gained by doing this. Keyword arguments, for example, are not accounted for in Julia's multiple dispatch, and can lead to type-instability. For this kind of package, the performance loss will not be too severe when fitting large models, but the performance penalty can be noticeably when evaluating a large number of small models. A refactor in this style that uses multiple dispatch would look something like:

function update(bst::Booster, dtrain::DMatrix, iteration::Integer)
    XGBoosterUpdateOneIter(bst.handle, iteration, dtrain.handle)
end

function update(bst::Booster, dtrain::DMatrix, iteration::Integer, fobj::Function)
    pred = predict(bst, dtrain)
    grad, hess = fobj(pred, dtrain)
    @assert size(grad) == size(hess)
    XGBoosterBoostOneIter(bst.handle, dtrain.handle, grad, hess, length(hess))
end

In addition to these considerations, there is the issue of breaking compatibility with previous versions. There are some functions, such as xgboost(), that have an unconventional name and are also not available in other XGBoost libraries (which use train()). I'd say we should rename these functions, because this increases cross-language consistency regardless of the coding style that we adopt. What do you think?

Processing restricted to a single thread

This may not be specific to Julia, but when I work with XGBoost.jl models in memory, I often see the performance drop from ~3600% CPU usage to 100% next time I train. No errors are given, and there is plenty of RAM and CPU available.

Any ideas why this might be occurring? The only solution I have right now is to restart my whole session.

Build error on master on Windows 10

After checking out master, I tried to build:

Pkg.build("XGBoost")

INFO: Building XGBoost
INFO: Using the latest stable version (0.60) of the XGBoost library
===============================[ ERROR: XGBoost ]===============================

LoadError: None of the selected providers can install dependency xgboost.
Use BinDeps.debug(package_name) to see available providers

while loading C:\Users\Chris\.julia\v0.6\XGBoost\deps\build.jl, in expression starting on line 36

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: XGBoost had build errors.

 - packages with build errors remain installed in C:\Users\Chris\.julia\v0.6
 - build the package(s) and all dependencies with `Pkg.build("XGBoost")`
 - build a single package by running its `deps/build.jl` script

================================================================================

Documentation up to date?

Hello

Is the documentation up to date? I cant even get a single example work.

num_round = 2
bst = xgboost(train_X, num_round, label = train_Y, eta = 1, max_depth = 2)

returns error:
got unsupported keyword argument "label"

and when I remove the label keyword I get another error
ERROR: MethodError: no method matching xgboost(::Array{Float64,1}, ::Int64, ::Array{Int64,1}; eta=1, max_depth=2)

Are Julia arrays compatible with XGBoost.jl?
For boolean target, should I convert it to integer?

I use Julia 1.2, "XGBoost" => v"0.4.2"
Thank you!

Can't set DMatrix attributes in Julia

I urgently need to be able to set and access attibutes in Julia, like I have been used to doing in R.

In R, after I have defined a DMatrix object (say, 'dtrain') all I have to do is:

attr(dtrain, "myparam") = value

And then to retrieve this (e.g. within a customised objective function) I use:

myparam = attr(dtrain, "myparam")

and the assigned value(s) will be loaded into myparam .

I have tried everything in Julia, but I can't seem to achieve the same thing
in a way which is compatible with XGBoost. I can't seem to find
any documentation or examples relating to this anywhere.

I would be grateful for any help.

XGBoost fails on Julia 0.6.beta.0 (OSX)

Hello,

XGBoost fails to compile/start on Julia 0.6 with the following exception: invalid return type or argument type in ccall

julia> import XGBoost: nfold_cv, predict, xgboost, DMatrix, importance
INFO: Precompiling module XGBoost.

WARNING: deprecated syntax "typealias Bst_ulong Culonglong" at /Users/dc/.julia/v0.6/XGBoost/src/xgboost_wrapper_h.jl:5.
Use "const Bst_ulong = Culonglong" instead.

WARNING: deprecated syntax "typealias Bst_ulong Culong" at /Users/dc/.julia/v0.6/XGBoost/src/xgboost_wrapper_h.jl:7.
Use "const Bst_ulong = Culong" instead.
ERROR: LoadError: LoadError: LoadError: invalid return type or argument type in ccall
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:539
 [2] include(::String) at ./sysimg.jl:14
 [3] include_from_node1(::String) at ./loading.jl:539
 [4] include(::String) at ./sysimg.jl:14
 [5] include_from_node1(::String) at ./loading.jl:539
 [6] include(::String) at ./sysimg.jl:14
 [7] anonymous at ./<missing>:2
while loading /Users/dc/.julia/v0.6/XGBoost/src/xgboost_wrapper_h.jl, in expression starting on line 22
while loading /Users/dc/.julia/v0.6/XGBoost/src/xgboost_lib.jl, in expression starting on line 1
while loading /Users/dc/.julia/v0.6/XGBoost/src/XGBoost.jl, in expression starting on line 5
ERROR: Failed to precompile XGBoost to /Users/dc/.julia/lib/v0.6/XGBoost.ji.
Stacktrace:
 [1] compilecache(::String) at ./loading.jl:673
 [2] require(::Symbol) at ./loading.jl:460

Julia versioninfo

julia> versioninfo()
Julia Version 0.6.0-pre.beta.0
Commit bd84fa1* (2017-03-31 12:58 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin16.5.0)
CPU: Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

If we look in the code https://github.com/dmlc/XGBoost.jl/blob/master/src/xgboost_wrapper_h.jl, line 12, 13 and 14 reference to the wrong elements in the expression (args[1] represents "=>").

        err = ccall(($f, _jl_libxgboost), Int64,
                    ($((esc(i.args[2]) for i in params)...),),
                    $((esc(i.args[1]) for i in params)...))

but should be

        err = ccall(($f, _jl_libxgboost), Int64,
                    ($((esc(i.args[3]) for i in params)...),),
                    $((esc(i.args[2]) for i in params)...))

Don't work for Julia1.0

Installation fails with the following error:
┌ Error: Error building XGBoost:
│ ERROR: LoadError: syntax: misplaced assignment statement in "[libxgboostwrapper = library_dependency("xgboostwrapper", aliases = ["libxgboostwrapper.so"])]"
│ Stacktrace:
│ [1] include at ./boot.jl:317 [inlined]
│ [2] include_relative(::Module, ::String) at ./loading.jl:1038
│ [3] include(::Module, ::String) at ./sysimg.jl:29
│ [4] include(::String) at ./client.jl:388
│ [5] top-level scope at none:0
│ in expression starting at /Users/dmitrypenzar/.julia/packages/XGBoost/ZDo2d/deps/build.jl:4
└ @ Pkg.Operations /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1068

Hyperparameter Tuning

Hello,

May someone confirm whether this package support hyperparameter tuning?
Either grid or random search? If not, any plan to add it in the future?

Thank you!

Error using XGBoost

When I type using XGBoost, I got following error:


julia> Pkg.build("XGBoost")
INFO: Building XGBoost
INFO: Using the latest stable version (0.60) of the XGBoost library

julia> using XGBoost
INFO: Precompiling module XGBoost.

WARNING: deprecated syntax "typealias Bst_ulong Culonglong" at /home/ubuntu/.julia/v0.6/XGBoost/src/xgboost_wrapper_h.jl:5.
Use "const Bst_ulong = Culonglong" instead.

WARNING: deprecated syntax "typealias Bst_ulong Culong" at /home/ubuntu/.julia/v0.6/XGBoost/src/xgboost_wrapper_h.jl:7.
Use "const Bst_ulong = Culong" instead.
ERROR: LoadError: LoadError: LoadError: could not evaluate ccall argument type (it might depend on a local variable)
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:576
 [2] include(::String) at ./sysimg.jl:14
 [3] include_from_node1(::String) at ./loading.jl:576
 [4] include(::String) at ./sysimg.jl:14
 [5] include_from_node1(::String) at ./loading.jl:576
 [6] include(::String) at ./sysimg.jl:14
 [7] anonymous at ./<missing>:2
while loading /home/ubuntu/.julia/v0.6/XGBoost/src/xgboost_wrapper_h.jl, in expression starting on line 22
while loading /home/ubuntu/.julia/v0.6/XGBoost/src/xgboost_lib.jl, in expression starting on line 1
while loading /home/ubuntu/.julia/v0.6/XGBoost/src/XGBoost.jl, in expression starting on line 5
ERROR: Failed to precompile XGBoost to /home/ubuntu/.julia/lib/v0.6/XGBoost.ji.
Stacktrace:
 [1] compilecache(::String) at ./loading.jl:710
 [2] _require(::Symbol) at ./loading.jl:497
 [3] require(::Symbol) at ./loading.jl:405

compilation error on win 10 julia 0.7

julia> Pkg.build("XGBoost")
Building XGBoost → C:\Users\chatura\.julia\dev\XGBoost\deps\build.log
Resolving package versions...
┌ Error: Error building XGBoost:
│ [ Info: Using the latest master version of the XGBoost library
│ ERROR: LoadError: None of the selected providers can install dependency xgboost.
│ Use BinDeps.debug(package_name) to see available providers

│ Stacktrace:
│ [1] error(::String) at .\error.jl:33
│ [2] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at C:\Users\chatura.julia\packages\BinDeps\ZEval\src\dependencies.jl:949
│ [3] satisfy!(::BinDeps.LibraryDependency) at C:\Users\chatura.julia\packages\BinDeps\ZEval\src\dependencies.jl:922
│ [4] top-level scope at C:\Users\chatura.julia\packages\BinDeps\ZEval\src\dependencies.jl:977
│ [5] include at .\boot.jl:317 [inlined]
│ [6] include_relative(::Module, ::String) at .\loading.jl:1038
│ [7] include(::Module, ::String) at .\sysimg.jl:29
│ [8] include(::String) at .\client.jl:398
│ [9] top-level scope at none:0
│ in expression starting at C:\Users\chatura.julia\dev\XGBoost\deps\build.jl:36
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Operations.jl:1068

Permission denied error during test

If the package is installed normally, the folder is read-only and this causes the tests to fail when it tries to save the model to a file in the test directory:

Example: Error During Test at /Users/jack/.julia/packages/XGBoost/fI0vs/test/runtests.jl:78
  Got exception outside of a @test
  LoadError: Call to XGBoost C function XGBoosterSaveModel failed: [09:55:26] /workspace/srcdir/xgboost/dmlc-core/src/io/local_filesys.cc:209: Check failed: allow_null:  LocalFileSystem::Open "xgb.model": Permission denied
  Stack trace:
    [bt] (0) 1   libxgboost.dylib                    0x000000011b1fe02e dmlc::LogMessageFatal::~LogMessageFatal() + 110
    [bt] (1) 2   libxgboost.dylib                    0x000000011b3cb414 dmlc::io::LocalFileSystem::Open(dmlc::io::URI const&, char const*, bool) + 1060
    [bt] (2) 3   libxgboost.dylib                    0x000000011b3ae09e dmlc::Stream::Create(char const*, char const*, bool) + 62
    [bt] (3) 4   libxgboost.dylib                    0x000000011b1f872a XGBoosterSaveModel + 122
    [bt] (4) 5   ???                                 0x000000011a8f2356 0x0 + 4740555606
    [bt] (5) 6   ???                                 0x000000011a8f25bb 0x0 + 4740556219
    [bt] (6) 7   libjulia.1.5.dylib                  0x000000010fc5b560 eval_body + 1360
    [bt] (7) 8   libjulia.1.5.dylib                  0x000000010fc5b83d jl_interpret_toplevel_thunk + 269
    [bt] (8) 9   libjulia.1.5.dylib                  0x000000010fc74e3f jl_toplevel_eval_flex + 3151


  Stacktrace:
   [1] error(::String, ::String, ::String, ::String) at ./error.jl:42
   [2] XGBoosterSaveModel(::Ptr{Nothing}, ::String) at /Users/jack/.julia/packages/XGBoost/fI0vs/src/xgboost_wrapper_h.jl:11
   [3] save(::Booster, ::String) at /Users/jack/.julia/packages/XGBoost/fI0vs/src/xgboost_lib.jl:109
   [4] top-level scope at /Users/jack/.julia/packages/XGBoost/fI0vs/test/example.jl:52
   [5] include(::String) at ./client.jl:457
   [6] top-level scope at /Users/jack/.julia/packages/XGBoost/fI0vs/test/runtests.jl:79
   [7] top-level scope at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1115
   [8] top-level scope at /Users/jack/.julia/packages/XGBoost/fI0vs/test/runtests.jl:79
   [9] top-level scope at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1115
   [10] top-level scope at /Users/jack/.julia/packages/XGBoost/fI0vs/test/runtests.jl:10
   [11] include(::String) at ./client.jl:457
   [12] top-level scope at none:6
   [13] eval(::Module, ::Any) at ./boot.jl:331
   [14] exec_options(::Base.JLOptions) at ./client.jl:272
   [15] _start() at ./client.jl:506
  in expression starting at /Users/jack/.julia/packages/XGBoost/fI0vs/test/example.jl:52

SoftmaxMultiClassObj: label exceed num_class

I am using covertype

unique(labels)
7-element Array{Int64,1}:
2
1
5
6
7
3
4

bst = xgboost(instances, num_round, label = labels, eta=1, max_depth=10, num_class=7, objective="multi:softmax")

errors out with SoftmaxMultiClassObj: label exceed num_class

however

bst = xgboost(instances, num_round, label = labels, eta=1, max_depth=10, num_class=8, objective="multi:softmax")

trains a model.

Tag new release

Whenever people install XGBoost via Pkg.add("XGBoost") it gives them an old broken version because a new version of the Julia package has not been tagged for a long time. Worse, even if you then Pkg.checkout("XGBoost") to get the master it will still fail because the old build files are still around.

Could we tag a new Julia package release? Thanks!

how to get the trees

Hi,

I am trying to get the prediction values of each tree from XGBoost model, to find the standard deviation of the results. Since xgboost only gives me one prediction, I don't have access to that.

I tried

dump_model(bst, “dump.raw.txt”)
# If you have feature map file, you can dump the model in a more readable way
dump_model(bst, “dump.nice.txt”, fmap = joinpath(DATAPATH, “featmap.txt”))

to get the individual trees. But I don't know how to load them to use in Julia.

Thank you for your help
Ali

Julia 1.0: Compatible XGBoost version?

Hi,
I am trying to add the XGBoost package in a fresh julia 1.0 installation. I am running ubuntu (uname -a output):
Linux 4.4.0-134-generic #160~14.04.1-Ubuntu SMP Fri Aug 17 11:07:07 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

It appears that there is not a Julia 1.0 compatible version of XGBoost:

(v1.0) pkg> add XGBoost
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package XGBoost [009559a3]:
XGBoost [009559a3] log:
├─possible versions are: [0.0.1, 0.1.0, 0.2.0] or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions [0.0.1, 0.1.0, 0.2.0]
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left

Is there a timeline for the package update? Is there anything the community can do to help?
Thanks

Loading model files created by CLI xgboost?

I was trying to load a model saved from CLI xgboost into Julia for examination. The CLI was running the latest master version of xgboost, and so I also built XGBoost.jl with the master version of xgboost. But when I try and load a model I get a segmentation fault. Is this expected to work? Thanks!

(julia version 0.3.1-pre+48 in case it matters)

julia> bst = Booster(model_file="/homes/gws/slund1/local/xgboost/0160.model")

signal (11): Segmentation fault
unknown function (ip: -2145099837)
unknown function (ip: -2145197437)
fread at /lib64/libc.so.6 (unknown line)
_ZN7xgboost7learner12BoostLearner9LoadModelERN4dmlc6StreamEb at /homes/gws/slund1/.julia/v0.3/XGBoost/deps/usr/lib/libxgboostwrapper.so (unknown line)
XGBoosterLoadModel at /homes/gws/slund1/.julia/v0.3/XGBoost/deps/usr/lib/libxgboostwrapper.so (unknown line)
Booster at /homes/gws/slund1/.julia/v0.3/XGBoost/src/xgboost_lib.jl:83
jl_apply at /homes/gws/slund1/local/julia/src/gf.c:1429
julia_Booster;19828 at  (unknown line)
do_call at /homes/gws/slund1/local/julia/src/interpreter.c:66
eval at /homes/gws/slund1/local/julia/src/interpreter.c:207
eval at /homes/gws/slund1/local/julia/src/interpreter.c:215
eval_body at /homes/gws/slund1/local/julia/src/interpreter.c:541
jl_interpret_toplevel_thunk_with at /homes/gws/slund1/local/julia/src/interpreter.c:569
jl_toplevel_eval_flex at /homes/gws/slund1/local/julia/src/toplevel.c:511
jl_f_top_eval at /homes/gws/slund1/local/julia/src/builtins.c:397
eval_user_input at REPL.jl:54
jlcall_eval_user_input;19701 at  (unknown line)
jl_apply at /homes/gws/slund1/local/julia/src/gf.c:1431
anonymous at task.jl:96
start_task at /homes/gws/slund1/local/julia/src/task.c:427
julia_trampoline at /homes/gws/slund1/local/julia/src/init.c:1006
unknown function (ip: 4201197)
__libc_start_main at /lib64/libc.so.6 (unknown line)
unknown function (ip: 4199257)
Segmentation fault (core dumped)

support for multi-dimensional "label" for regressions?

Hello all. I haven't dug too far into the source code yet, but I'm wondering if it's possible to do regressions where the "label" (target value) consists of multi-dimensional data points. (i.e. the label argument of the xgboost function would be an Array{T<:Number,2}.) This seems like a pretty important feature, but I can't find any literature about it in the xgboost documentation for any language.

It seems to me that even if it's not explicitly supported this should be possible by setting a custom loss function, however I get the following error any time I try to pass a matrix-valued "label":

ERROR: LoadError: MethodError: no method matching (::XGBoost.#_setinfo#8)(::Ptr{Void}, ::String, ::Array{Float64,2})
Closest candidates are:
  _setinfo{T<:Number}(::Ptr{Void}, ::String, ::Array{T<:Number,1}) at /home/user/.julia/v0.5/XGBoost/src/xgboost_lib.jl:10
 in (::XGBoost.##call#7#11)(::Array{Any,1}, ::Type{T}, ::Array{Float64,2}, ::Bool, ::Float32) at /home/user/.julia/v0.5/XGBoost/src/xgboost_lib.jl:59
 in (::Core.#kw#Type)(::Array{Any,1}, ::Type{XGBoost.DMatrix}, ::Array{Float64,2}, ::Bool, ::Float32) at ./<missing>:0
 in makeDMatrix(::Array{Float64,2}, ::Array{Float64,2}) at /home/user/.julia/v0.5/XGBoost/src/xgboost_lib.jl:137
 in #xgboost#20(::Array{Float64,2}, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}, ::Type{T}, ::Type{T}, ::Array{Any,1}, ::Array{Any,1}, ::XGBoost.#xgboost, ::Array{Float64,2}, ::Int64) at /home/user/.julia/v0.5/XGBoost/src/xgboost_lib.jl:147
 in (::XGBoost.#kw##xgboost)(::Array{Any,1}, ::XGBoost.#xgboost, ::Array{Float64,2}, ::Int64) at ./<missing>:0
 in include_from_node1(::String) at ./loading.jl:488
while loading /home/user/RatingsPrediction/xgboost0.jl, in expression starting on line 43

Taking a look at the source code I get the impression it is not designed to pass labels that aren't Vectors into the C code. Certainly the above error seems to indicate that it is impossible to set a "label" that cannot be converted to Vector.

Is there any way around this? Does the Python API support this? Thanks.

compliance with ScikitLearn API

Like many, I frequently use the "ScikitLearn" paradigm where I create a model object and then call functions like fit! and predict. In Julia, with multiple dispatch, it's trivially easy to get arbitrarily complicated machine learning methods to follow this paradigm.

Except... with this package. This is because the model creation and training are done with one function call. This means that in most cases one has to write custom code to plug in XGBoost, as this is the only package I'm aware of where these are done in one step.

Has there been any thought to adding user friendly code to allow separate creation of model objects? It looks like this is possible using the Booster class, but as it is one would have to rewrite most of the xgboost function to set the parameters and so forth.

nfold_cv doesn't work

When I tried out some code from demo:

dtrain = DMatrix("agaricus.txt.train")
param = ["max_depth"=>2, "eta"=>1, "silent"=>1, "objective"=>"binary:logistic"]
num_round = 2
nfold = 5

xgboost(dtrain, num_round, param = param, metrics=["error"], seed = 0) #this works
nfold_cv(dtrain, num_round, nfold, param = param, metrics=["error"], seed = 0) #this doesn't

*_I got this error:
*_MethodError: isless has no method matching isless(::Array{Float64,1}, ::Array{Float64,1})
Closest candidates are:
isless(!Matched::DataArrays.NAtype, ::Any)
isless(::Any, !Matched::DataArrays.NAtype)
in sort! at sort.jl:221
in sort! at sort.jl:310
in sort! at sort.jl:402
in aggcv at /Users/skondrat/.julia/v0.4/XGBoost/src/xgboost_lib.jl:284
in nfold_cv at /Users/skondrat/.julia/v0.4/XGBoost/src/xgboost_lib.jl:307
in include_string at /Users/skondrat/.julia/v0.4/CodeTools/src/eval.jl:28
in include_string at /Users/skondrat/.julia/v0.4/CodeTools/src/eval.jl:32
[inlined code] from /Users/skondrat/.julia/v0.4/Atom/src/eval.jl:39
in anonymous at /Users/skondrat/.julia/v0.4/Atom/src/eval.jl:62
in withpath at /Users/skondrat/.julia/v0.4/Requires/src/require.jl:37
in withpath at /Users/skondrat/.julia/v0.4/Atom/src/eval.jl:53
[inlined code] from /Users/skondrat/.julia/v0.4/Atom/src/eval.jl:61
in anonymous at task.jl:58

Error on using XGBoost

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.0 (2017-06-19 13:05 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-apple-darwin13.4.0

julia> using XGBoost
INFO: Precompiling module XGBoost.

WARNING: deprecated syntax "typealias Bst_ulong Culonglong" at /Users/alha02/.julia/v0.6/XGBoost/src/xgboost_wrapper_h.jl:5.
Use "const Bst_ulong = Culonglong" instead.

WARNING: deprecated syntax "typealias Bst_ulong Culong" at /Users/alha02/.julia/v0.6/XGBoost/src/xgboost_wrapper_h.jl:7.
Use "const Bst_ulong = Culong" instead.
ERROR: LoadError: LoadError: LoadError: UndefVarError: build_version not defined
Stacktrace:
 [1] include_from_node1(::String) at ./loading.jl:569
 [2] include(::String) at ./sysimg.jl:14
 [3] include_from_node1(::String) at ./loading.jl:569
 [4] include(::String) at ./sysimg.jl:14
 [5] include_from_node1(::String) at ./loading.jl:569
 [6] include(::String) at ./sysimg.jl:14
 [7] anonymous at ./<missing>:2
while loading /Users/alha02/.julia/v0.6/XGBoost/src/xgboost_wrapper_h.jl, in expression starting on line 3
while loading /Users/alha02/.julia/v0.6/XGBoost/src/xgboost_lib.jl, in expression starting on line 1
while loading /Users/alha02/.julia/v0.6/XGBoost/src/XGBoost.jl, in expression starting on line 5
ERROR: Failed to precompile XGBoost to /Users/alha02/.julia/lib/v0.6/XGBoost.ji.
Stacktrace:
 [1] compilecache(::String) at ./loading.jl:703
 [2] _require(::Symbol) at ./loading.jl:490
 [3] require(::Symbol) at ./loading.jl:398

There were no errors when building and I'm using latest checkout.

Loading of XGBoost module fails

The latest WIP in julia JuliaLang/julia#10380 is causing this for julia 0.4.-.

julia> using XGBoost
ERROR: LoadError: LoadError: TypeError: apply_type: in Array, expected Type{T}, got Tuple{DataType,DataType}
 in include at boot.jl:250
 in include_from_node1 at loading.jl:129
 in include at boot.jl:250
 in include_from_node1 at loading.jl:129
 in reload_path at loading.jl:153
 in _require at loading.jl:68
 in require at loading.jl:51
while loading /users/stadius/vjumutc/.julia/v0.4/XGBoost/src/xgboost_lib.jl, in expression starting on line 183
while loading /users/stadius/vjumutc/.julia/v0.4/XGBoost/src/XGBoost.jl, in expression starting on line 3

How to treat missing values

I was trying the Julia version of the Kaggle-Higgs code, and when I do xgmat = DMatrix( data, label=label, missing=-999.0) I get an _setinfo has no method matching _setinfo(::Ptr{Void}, ::ASCIIString, ::Float64) error. But in the implementation of DMatrix() function I see that we can pass the missing parameter. Can you please let me know how are we supposed to pass the data? Thanks.

Introductory 'acarius' example fails on Mac OSX

I tried to run the introductory example posted here on OSX-Mojave, running everything verbatim. installing/loading XGBoost went fine (I tried both methods) but package would not run on the example data provided, with the error given:

ERROR: Call to XGBoost C function XGBoosterUpdateOneIter failed: [22:51:55] src/objective/regression_obj.cu:65: Check failed: preds.Size() == info.labels_.Size() (6513 vs. 1611) labels are not correctly providedpreds.size=6513, label.size=1611

Stack trace returned 0 entries:

My call to xgboost was cut and pasted so I don't think there were syntax errors.
Has anyone run this simple example on a MAC? I post a screenshot below.
Thanks for any help
xgboost_example

Package fails to build on Julia 1.0.5

XGBoost v0.4.2 fails to build with Julia 1.0.5 and throws this exception:

...
Building XGBoost → `~/.julia/packages/XGBoost/LXjD0/deps/build.log`
┌ Error: Error building `XGBoost`: 
│ [ Info: Downloading https://github.com/JuliaPackaging/Yggdrasil/releases/download/XGBoost-v0.82-2/XGBoost.v0.82.0.x86_64-linux-gnu-cxx11.tar.gz to /root/.julia/packages/XGBoost/LXjD0/deps/usr/downloads/XGBoost.v0.82.0.x86_64-linux-gnu-cxx11.tar.gz...
│ ERROR: LoadError: LibraryProduct(nothing, ["libxgboost", "xgboost"], :libxgboost, "Prefix(/root/.julia/packages/XGBoost/LXjD0/deps/usr)") is not satisfied, cannot generate deps.jl!
│ Stacktrace:
│  [1] error(::String) at ./error.jl:33
│  [2] #write_deps_file#152(::Bool, ::Function, ::String, ::Array{LibraryProduct,1}) at /root/.julia/packages/BinaryProvider/TcAwt/src/Products.jl:414
│  [3] (::getfield(BinaryProvider, Symbol("#kw##write_deps_file")))(::NamedTuple{(:verbose,),Tuple{Bool}}, ::typeof(write_deps_file), ::String, ::Array{LibraryProduct,1}) at ./none:0
│  [4] top-level scope at none:0
│  [5] include at ./boot.jl:317 [inlined]
│  [6] include_relative(::Module, ::String) at ./loading.jl:1044
│  [7] include(::Module, ::String) at ./sysimg.jl:29
│  [8] include(::String) at ./client.jl:392
│  [9] top-level scope at none:0
│ in expression starting at /root/.julia/packages/XGBoost/LXjD0/deps/build.jl:56
[14:19:07] ######################################################################## 100.0% 
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1096

Steps to reproduce:

docker run -it --rm amazonlinux
yum install -y curl tar gzip
curl -O https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0.5-linux-x86_64.tar.gz
tar xf julia-1.0.5-*
./julia-1.0.5/bin/julia --color=yes -e 'using Pkg; pkg"add XGBoost"'

Has anyone used XGBoost in Julia with Customised Objective Function?

There are a couple of examples in the XGBoost forums using customised objective functions in R, but I have not seen any in Julia/XGB. Any hints would be appreciated. Also, if I get something working, I will post it.

Since I first put this up, I noticed the example given on here, which is much appreciated. Unfortunately, it does not quite run as written, but does run with a few minor changes.
These are (1 putting the names of the objective function and evalerror in quotes in the calling sequence, and (2, more subtle) changing exp(-preds) to exp.(-preds) as Julia is picky about functions acting elementwise on arrays or vectors (fair enough in this case, as exp() of a square matrix has another meaning).

Wrapper functions use UInt64 instead of UInt32

It looks like the functions in xgboost_wrapper_h.jl erroneously expect XGBoost's library to return results as UInt64, while they actually return the equivalent of Julia's UInt32. The result is that these functions return the wrong values.

Take the example of XGDMatrixNumRow(), which expects XGBoost's output to be stored in a reference to a UInt64.

function XGDMatrixNumRow(handle::Ptr{Void})
    ret = Ref{UInt64}()
    @xgboost_ccall(
        :XGDMatrixNumRow,
        (Ptr{Void}, Ref{UInt64}),
         handle, ret
    )
    return ret[]
end

If we take a loot at XGBoost's c_api.cc:451-456, we find that it expects a pointer to a bst_ulong and second argument:

int XGDMatrixNumRow(const DMatrixHandle handle,
                    bst_ulong *out) {
  API_BEGIN();
  *out = static_cast<bst_ulong>(static_cast<const DMatrix*>(handle)->info().num_row);
  API_END();
}

In XGBoost's c_api.h:26, we find that bst_ulong is defined as an unsigned long. As far as I know, Julia's equivalent to this is an UInt32, not an UInt64.

// manually define unsign long
typedef unsigned long bst_ulong;  // NOLINT(*)

This frequently causes errors when Julia previously stored large arrays that were subsequently freed, which causes it to reuse memory. Since calls to Ref{UInt64}() do not zero out the memory, it is not guarateed to be zero. In this case, the call to XGDMatrixNumRow() will store valid data in the 32 bit part of the UInt64, but leave whatever value was in the remainder intact. The result is that it sometimes erroneously reports the number of rows.

I can replicate this by calling XGBoost.XGDMatrixNumRow(trainer.handle) a few times in a Julia session that has previously been used to store and release a large number of sizable arrays. The call usually returns:

XGBoost.XGDMatrixNumRow(trainer.handle)
0x00000000000007d0

But sometimes (notice that the 32bit portion of the UInt32 is still correct):

XGBoost.XGDMatrixNumRow(trainer.handle)
0x3feff5f2000007d0

Custom verbosity

Hi,

I haven't find out how to change verbosity in the xgboost call.
And the print

[1] train-rmse:1.2
[2] train-rmse:1.3

is quite annoying when you launch multiple runs.

Is there something I miss to adjust the verbosity ?

Thanks for your help.

Error building on Julia 1.1 | Mac and NextJournal

I haven't been able to build XGBoost on either platform due to this error with DMatrix; I am new to Julia so please let me know if I might just be Doing It Wrong

julia> Pkg.add("XGBoost")
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
 Installed XGBoost ─ v0.3.1
  Updating `~/.julia/environments/v1.1/Project.toml`
  [009559a3] + XGBoost v0.3.1
  Updating `~/.julia/environments/v1.1/Manifest.toml`
  [009559a3] + XGBoost v0.3.1
  Building XGBoost  `~/.julia/packages/XGBoost/udvqz/deps/build.log`
...

Here's the error itself

c++ -c -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude   -Idmlc-core/include -Irabit/include -I/include -O3 -funroll-loops -fPIC -DDISABLE_OPENMP src/data/data.cc -o build/data/data.o
│ In file included from src/data/data.cc:10:
│ src/data/./simple_dmatrix.h:19:7: error: exception specification of overriding function is more lax than base version
│ class SimpleDMatrix : public DMatrix {
│       ^
│ include/xgboost/data.h:347:11: note: overridden virtual function is here
│   virtual ~DMatrix() = default;
│           ^
│ 1 error generated.
│ make: *** [build/data/data.o] Error 1
│ [ Info: Using the latest stable version (0.80) of the XGBoost library
│ [ Info: Attempting to create directory /Users/ndoiron404/.julia/packages/XGBoost/udvqz/deps/src
│ [ Info: Changing directory to /Users/ndoiron404/.julia/packages/XGBoost/udvqz/deps/src
│ [ Info: Changing directory to /Users/ndoiron404/.julia/packages/XGBoost/udvqz/deps/src
│ [ Info: Changing directory to /Users/ndoiron404/.julia/packages/XGBoost/udvqz/deps/src/xgboost
│ [ Info: Changing directory to /Users/ndoiron404/.julia/packages/XGBoost/udvqz/deps/src/xgboost
│ ERROR: LoadError: failed process: Process(`bash build.sh`, ProcessExited(2)) [2]
│ Stacktrace:
│  [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
│  [2] pipeline_error at ./process.jl:785 [inlined]
│  [3] #run#515(::Bool, ::Function, ::Cmd) at ./process.jl:726
│  [4] run(::Cmd) at ./process.jl:724
│  [5] run(::BinDeps.SynchronousStepCollection) at /Users/ndoiron404/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:521 (repeats 2 times)
│  [6] run(::FileRule) at /Users/ndoiron404/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:483
│  [7] run(::BinDeps.SynchronousStepCollection) at /Users/ndoiron404/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:521
│  [8] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at /Users/ndoiron404/.julia/packages/BinDeps/ZEval/src/dependencies.jl:944
│  [9] satisfy!(::BinDeps.LibraryDependency) at /Users/ndoiron404/.julia/packages/BinDeps/ZEval/src/dependencies.jl:922
│  [10] top-level scope at /Users/ndoiron404/.julia/packages/BinDeps/ZEval/src/dependencies.jl:977
│  [11] include at ./boot.jl:326 [inlined]
│  [12] include_relative(::Module, ::String) at ./loading.jl:1038
│  [13] include(::Module, ::String) at ./sysimg.jl:29
│  [14] include(::String) at ./client.jl:403
│  [15] top-level scope at none:0
│ in expression starting at /Users/ndoiron404/.julia/packages/XGBoost/udvqz/deps/build.jl:37
└ @ Pkg.Operations /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075

On retrieving weights of boosters

  1. Is there a way to retrieve the weight of each booster from a trained model?
  2. During boosting the weights on each datapoint will keep changing, and the outliers or datapoints that are hard to classify will accumulate a lot of weight. Is there a way to get these weights either during each stage of boosting, or after all boosters have been built

New release

Would be great if you could tag a new release since the current released version doesn't load on Julia 0.6.

Tests not passing on mac

I am using the current tagged version of XGBoost.jl (0.3.1) on a mac with Julia 1.1.0 official binaries. The tests do not pass for me.

julia> Pkg.test("XGBoost")
   Testing XGBoost
    Status `/var/folders/rj/njz8jnv11637flz6vgnb6bz00000gp/T/tmpSvYwmb/Manifest.toml`
  [9e28174c] BinDeps v0.8.10
  [34da2185] Compat v2.1.0
  [30578b45] URIParser v0.4.0
  [009559a3] XGBoost v0.3.1
  [2a0f44e3] Base64  [`@stdlib/Base64`]
  [ade2ca70] Dates  [`@stdlib/Dates`]
  [8bb1440f] DelimitedFiles  [`@stdlib/DelimitedFiles`]
  [8ba89e20] Distributed  [`@stdlib/Distributed`]
  [b77e0a4c] InteractiveUtils  [`@stdlib/InteractiveUtils`]
  [76f85450] LibGit2  [`@stdlib/LibGit2`]
  [8f399da3] Libdl  [`@stdlib/Libdl`]
  [37e2e46d] LinearAlgebra  [`@stdlib/LinearAlgebra`]
  [56ddb016] Logging  [`@stdlib/Logging`]
  [d6f4376e] Markdown  [`@stdlib/Markdown`]
  [a63ad114] Mmap  [`@stdlib/Mmap`]
  [44cfe95a] Pkg  [`@stdlib/Pkg`]
  [de0858da] Printf  [`@stdlib/Printf`]
  [3fa0cd96] REPL  [`@stdlib/REPL`]
  [9a3f8284] Random  [`@stdlib/Random`]
  [ea8e919c] SHA  [`@stdlib/SHA`]
  [9e88b42a] Serialization  [`@stdlib/Serialization`]
  [1a1011a3] SharedArrays  [`@stdlib/SharedArrays`]
  [6462fe0b] Sockets  [`@stdlib/Sockets`]
  [2f01184e] SparseArrays  [`@stdlib/SparseArrays`]
  [10745b16] Statistics  [`@stdlib/Statistics`]
  [8dfed614] Test  [`@stdlib/Test`]
  [cf7118a7] UUIDs  [`@stdlib/UUIDs`]
  [4ec0a83e] Unicode  [`@stdlib/Unicode`]
[10:38:56] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train
[10:38:57] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train
[10:38:57] 1611x126 matrix with 35442 entries loaded from ../data/agaricus.txt.test
[10:38:58] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train
[10:38:58] 1611x126 matrix with 35442 entries loaded from ../data/agaricus.txt.test
[1]	cv-test-error:0.046522+0.002437	cv-train-error:0.046522+0.001219
[2]	cv-test-error:0.022263+0.000704	cv-train-error:0.022263+0.000352
[3]	cv-test-error:0.010287+0.004705	cv-train-error:0.009520+0.004733
[4]	cv-test-error:0.015200+0.000461	cv-train-error:0.015200+0.000231
[5]	cv-test-error:0.005834+0.003135	cv-train-error:0.004760+0.003541
[10:38:59] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train
[10:38:59] 1611x126 matrix with 35442 entries loaded from ../data/agaricus.txt.test
training xgboost with dense matrix
[1]	train-error:0.046522
[2]	train-error:0.022263
training xgboost with sparse matrix
[1]	train-error:0.046522
[2]	train-error:0.022263
training xgboost with DMatrix[1]	train-error:0.000614
[2]	train-error:0.000000
[10:39:00] 6513x126 matrix with 143286 entries loaded from ../data/agaricus.txt.train
[1]	train-error:0.046522
[2]	train-error:0.022263
test-error=0.48168839230291743
Example: Error During Test at /Users/viral/.julia/packages/XGBoost/udvqz/test/runtests.jl:78
  Got exception outside of a @test
  LoadError: Call to XGBoost C function XGBoosterSaveModel failed: [10:39:00] src/io/local_filesys.cc:209: Check failed: allow_null  LocalFileSystem::Open "xgb.model": Permission denied
  
  Stack trace returned 10 entries:
  [bt] (0) 0   libxgboost.dylib                    0x000000012362fdcc dmlc::StackTrace(unsigned long) + 460
  [bt] (1) 1   libxgboost.dylib                    0x000000012362fab4 dmlc::LogMessageFatal::~LogMessageFatal() + 52
  [bt] (2) 2   libxgboost.dylib                    0x00000001237095cd dmlc::io::LocalFileSystem::Open(dmlc::io::URI const&, char const*, bool) + 1069
  [bt] (3) 3   libxgboost.dylib                    0x00000001237011a1 dmlc::Stream::Create(char const*, char const*, bool) + 65
  [bt] (4) 4   libxgboost.dylib                    0x000000012364a496 XGBoosterSaveModel + 118
  [bt] (5) 5   ???                                 0x0000000123200166 0x0 + 4884267366
  [bt] (6) 6   ???                                 0x00000001232000cb 0x0 + 4884267211
  [bt] (7) 7   libjulia.1.1.dylib                  0x0000000109bc6798 do_call + 200
  [bt] (8) 8   libjulia.1.1.dylib                  0x0000000109bc5275 eval_body + 1333
  [bt] (9) 9   libjulia.1.1.dylib                  0x0000000109bc5788 jl_interpret_toplevel_thunk_callback + 408
  
  
  Stacktrace:
   [1] error(::String, ::String, ::String, ::String) at ./error.jl:42
   [2] XGBoosterSaveModel(::Ptr{Nothing}, ::String) at /Users/viral/.julia/packages/XGBoost/udvqz/src/xgboost_wrapper_h.jl:17
   [3] save(::Booster, ::String) at /Users/viral/.julia/packages/XGBoost/udvqz/src/xgboost_lib.jl:111
   [4] top-level scope at none:0
   [5] include at ./boot.jl:326 [inlined]
   [6] include_relative(::Module, ::String) at ./loading.jl:1038
   [7] include(::Module, ::String) at ./sysimg.jl:29
   [8] include(::String) at ./client.jl:403
   [9] top-level scope at /Users/viral/.julia/packages/XGBoost/udvqz/test/runtests.jl:79
   [10] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
   [11] top-level scope at /Users/viral/.julia/packages/XGBoost/udvqz/test/runtests.jl:79
   [12] top-level scope at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083
   [13] top-level scope at /Users/viral/.julia/packages/XGBoost/udvqz/test/runtests.jl:10
   [14] include at ./boot.jl:326 [inlined]
   [15] include_relative(::Module, ::String) at ./loading.jl:1038
   [16] include(::Module, ::String) at ./sysimg.jl:29
   [17] include(::String) at ./client.jl:403
   [18] top-level scope at none:0
   [19] eval(::Module, ::Any) at ./boot.jl:328
   [20] exec_options(::Base.JLOptions) at ./client.jl:243
   [21] _start() at ./client.jl:436
  in expression starting at /Users/viral/.julia/packages/XGBoost/udvqz/test/example.jl:52
Test Summary:        | Pass  Error  Total
XGBoost              |    6      1      7
  Sparse matrices    |              No tests
  DMatrix loading    |    2             2
  Agaricus training  |    3             3
  Cross validation   |              No tests
  Feature importance |    1             1
  Example            |           1      1
ERROR: LoadError: Some tests did not pass: 6 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/viral/.julia/packages/XGBoost/udvqz/test/runtests.jl:8
ERROR: Package XGBoost errored during testing
Stacktrace:
 [1] pkgerror(::String, ::Vararg{String,N} where N) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Types.jl:120
 [2] #test#66(::Bool, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1328
 [3] #test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:0 [inlined]
 [4] #test#44(::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:193
 [5] test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:178 [inlined]
 [6] #test#43 at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:175 [inlined]
 [7] test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:175 [inlined]
 [8] #test#42 at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:174 [inlined]
 [9] test at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:174 [inlined]
 [10] #test#41(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:173
 [11] test(::String) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.1/Pkg/src/API.jl:173
 [12] top-level scope at none:0

nfold_cv returns

I think nfold_cv should also return the computed statistics, not nothing, like the Python API

2017-03-20_095609

Inconsistency between sparse and dense inputs

It seems as though models trained on dense data cannot predict using sparse matrices:

using XGBoost

srand(1)
X = randn(1000,10)
X .*= randbool(size(X)...)
y = randn(1000)
m = xgboost(X, 2, label=y, silent=2)
println("diff with sparse(X) = ", norm(predict(m, X) .- predict(m, sparse(X))))
println("diff with full(sparse(X)) = ", norm(predict(m, X) .- predict(m, full(sparse(X)))))

produces

diff with sparse(X) = 12.708112
diff with full(sparse(X)) = 0.0

I am looking into it, but want to note the issue here for now.

Number of threads used may be more than number of processes

In its current implementation, the interface does not acknowledge the number of processes that Julia is being run with. By default, it uses all available CPU cores. This can be limited by using the parameter "nthread" during training. However, many Julia methods are mindful of the number of processes and limit themselves to that.

Perhaps it could be considered to pass this number of Julia processes value as the default argument during xgboost model training.

Missing XGBoost parameters when calling nfold_cv

Hi guys,

I've just started using Julia and noticed XGBoost is missing some parameters.
Any plans to implement early_stopping_rounds and print_every_n rows in the next version when doing nfold_cv?

I have started writing my own implementation to fix the issues but it would be great if it is available out of the box.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.