Giter Site home page Giter Site logo

Comments (4)

tqchen avatar tqchen commented on May 6, 2024

If you mean evaluating the results and print it into screen, you can
directly put 'test set' into the watchlist(note xgboost support watch
multiple test sets), this will give you the loss of testset of entire
training phase.

On Mon, Jun 2, 2014 at 3:07 AM, andreh7 [email protected] wrote:

is it possible to use only the first n classifiers (e.g. trees) in the
ensemble ? Is it possible to do this from python ?

(this would be interesting in order to see at which point the 'loss' on
the test set increases again or becomes larger than the loss on the
training set)


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

from xgboost.

andreh7 avatar andreh7 commented on May 6, 2024

thanks a lot for the quick reply ! I was actually more thinking of getting the values programmatically but I'll start by what you suggested. Thanks !

from xgboost.

tqchen avatar tqchen commented on May 6, 2024

Another possible way, if you want to do it in python way, is to take a look at train function in
https://github.com/tqchen/xgboost/blob/master/python/xgboost.py
tweak it a bit (adding prediction, evaluation after each update, which is not hard),
you should remember to add your testing data to cachelist by

 bst = Booster(params, [dtrain]+[dtest] )

So that it caches test prediction as well and make it faster to repeatily predict dtest

from xgboost.

tqchen avatar tqchen commented on May 6, 2024

OK there is another request for this feature in #63 , and it is now supported by the most recent version in master. In python, you can do bst.predict(data, ntree_limit=10) to use first 10 trees.

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.