Giter VIP home page Giter VIP logo

Comments (2)

parsiad avatar parsiad commented on May 25, 2024 1

That works. Let's move the discussion to the PR: #6396

from lightgbm.

jameslamb avatar jameslamb commented on May 25, 2024

Thanks for using LightGBM.

All I did to create the booster was LGBM_BoosterCreate.

Ensure that you have objective=custom in the parameters.

const char* parameters,

That will tell LightGBM to set objective_function_ on the Booster to a nullptr.

} else if (type == std::string("custom")) {
return nullptr;
}

I believe that CHECK() is there because objective_function_ == nullptr is used by other code in Booster::TrainOneIter() to mean "gradients are being computed outside of LightGBM and provided directly", like in these places:

if (objective_function_ == nullptr && is_use_subset && bag_data_cnt < num_data_ && !boosting_on_gpu_ && !data_sample_strategy_->IsHessianChange()) {
ResetGradientBuffers();
}

// only add default score one-time
if (models_.size() < static_cast<size_t>(num_tree_per_iteration_)) {
if (objective_function_ != nullptr && !config_->boost_from_average && !train_score_updater_->has_init_score()) {


If this works, we should add a code comment on that CHECK() you hit and document "custom" in https://lightgbm.readthedocs.io/en/latest/Parameters.html#objective. Are you interested in contributing that?

from lightgbm.

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.