Code Monkey home page Code Monkey logo

Comments (4)

tqchen avatar tqchen commented on May 3, 2024

Yes, the group information was not accessible in current version. The
reason is internal data structure of group is not exactly what you set. It
is the only information you can not access but can set

On Wed, Sep 24, 2014 at 11:29 AM, Blind Ape [email protected]
wrote:

require(xgboost)
data(agaricus.train, package='xgboost')
train <- agaricus.train
group = rep(seq(1:3), length.out = length(train[[1]]))
dtrain <- xgb.DMatrix(data = train$data, label = train$label, group =
group)
works

labels <- getinfo(dtrain, 'label')
head(labels)
[1] 1 0 0 1 0 0
doesn't works

groups <- getinfo(dtrain, 'group')
Error en .local(object, ...) : xgb.getinfo: unknown info name group
low level works

labels <- .Call("XGDMatrixGetInfo_R", dtrain, 'label', PACKAGE = "xgboost")
head(labels)
[1] 1 0 0 1 0 0
low level doesn't works

groups <- .Call("XGDMatrixGetInfo_R", dtrain, 'group', PACKAGE = "xgboost")
Error: unknown field group
explicit setinfo

setinfo(dtrain, 'group', group)
[1] TRUE
groups <- .Call("XGDMatrixGetInfo_R", dtrain, 'group', PACKAGE = "xgboost")
Error: unknown field group


Reply to this email directly or view it on GitHub
https://github.com/tqchen/xgboost/issues/83.

from xgboost.

tqchen avatar tqchen commented on May 3, 2024

See updated customized obj script, where you will be able to set anything to DMatrix for customized function to use

https://github.com/tqchen/xgboost/blob/master/R-package/demo/custom_objective.R

from xgboost.

pommedeterresautee avatar pommedeterresautee commented on May 3, 2024

@tqchen any change for getinfo "group" ?
I just tried with no success (by modifying the R source code) :-(

> getinfo(dtrain, 'group')
Error in getinfo.xgb.DMatrix(dtrain, "group") : 
  [16:58:17] ../..//amalgamation/../src/c_api/c_api.cc:488: Unknown float field name group

Stack trace returned 10 entries:
[bt] (0) /home/benesty_local/R/x86_64-pc-linux-gnu-library/3.4/xgboost/libs/xgboost.so(_ZN4dmlc15LogMessageFatalD1Ev+0x36) [0x7fc23a9d9996]
[bt] (1) /home/benesty_local/R/x86_64-pc-linux-gnu-library/3.4/xgboost/libs/xgboost.so(XGDMatrixGetFloatInfo+0x10e) [0x7fc23a9e04fe]
[bt] (2) /home/benesty_local/R/x86_64-pc-linux-gnu-library/3.4/xgboost/libs/xgboost.so(XGDMatrixGetInfo_R+0x51) [0x7fc23a9d6671]
[bt] (3) /usr/lib/R/lib/libR.so(+0xd2d3c) [0x7fc263f52d3c]
[bt] (4) /usr/lib/R/lib/libR.so(Rf_eval+0x7c5) [0x7fc263f8fab5]
[bt] (5) /usr/lib/R/lib/libR.so(+0x1136a6) [0x7fc263f936a6]
[bt] (6) /usr/lib/R/lib/libR.so(Rf_eval+0x5a0) [0x7fc263f8f890]
[bt] (7) /usr/lib/R/lib/libR.so(+0x112538) [0x7fc263f92538]
[bt] (8) /usr/lib/R/lib/libR.so(Rf_eval+0x5a0) [0x7fc263f8f890]
[bt] (9) /usr/lib/R/lib/libR.so(Rf_eval+0x5a0) [0x7fc263f8f890]

from xgboost.

pommedeterresautee avatar pommedeterresautee commented on May 3, 2024

linked to
#1431
#574 (comment) (closure solution)

from xgboost.

Related Issues (20)

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.