R: Can I pass the weight parameter into the params = list() in LightGBMPass a list of parameters in read.table( )Python - LightGBM with GridSearchCV, is running foreverMulticlass Classification with LightGBMAccessing LightGBM model parametersHigh AUC but bad predictions with imbalanced databinary:logistic like parameter in LightGBMWhat is lightgbm's query information concept (for map metric)?GLS: Weights from external object not evaluated properly in loop (invalid type (list) for variable)Lightgbm, Force use of all featuresParameter tuning for LightGBM

English word for "product of tinkering"

What can I, as a user, do about offensive reviews in App Store?

How come the nude protesters were not arrested?

Soft question: Examples where lack of mathematical rigour cause security breaches?

Taxi Services at Didcot

Stellaris Sectors

Is counterpoint still used today?

A curious prime counting approximation or just data overfitting?

Is a lack of character descriptions a problem?

How to construct an hbox with negative height?

What is wrong with this proof that symmetric matrices commute?

Did Milano or Benatar approve or comment on their namesake MCU ships?

Overlapping String-Blocks

Medieval flying castle propulsion

SQL counting distinct over partition

Arriving at the same result with the opposite hypotheses

PhD - Well known professor or well known school?

Passing multiple files through stdin (over ssh)

Prime Sieve and brute force

Inward extrusion is not working

Is using haveibeenpwned to validate password strength rational?

Trapping Rain Water

Determining fair price for profitable mobile app business

Can tefillin be "switched"?



R: Can I pass the weight parameter into the params = list() in LightGBM


Pass a list of parameters in read.table( )Python - LightGBM with GridSearchCV, is running foreverMulticlass Classification with LightGBMAccessing LightGBM model parametersHigh AUC but bad predictions with imbalanced databinary:logistic like parameter in LightGBMWhat is lightgbm's query information concept (for map metric)?GLS: Weights from external object not evaluated properly in loop (invalid type (list) for variable)Lightgbm, Force use of all featuresParameter tuning for LightGBM






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Recently, I am learning the LightGBM package and want to tune the parameters of it.



I want to try all the parameters which can be tuned in the LightGBM.



One question is: when I build the model using the function: lightgbm(data, label = NULL, weight = NULL, params = list(), nrounds = 10, verbose = 1), can I put the weight and nrounds and many other parameters into a list object and feed to the params argument?



The following code is what I used:



# input data for lgb.Dataset() 
data_lgb <- lgb.Dataset(
data = X_tr,
label = y_tr
)

# can I put all parameters to be tuned into this list?
params_list <- list(weight = NULL, nrounds = 20, verbose = 1, learning_rate = 0.1)

# build lightgbm model using only: data_lgb and params_list
lgb_model <- lightgbm(data_lgb, params = params_list)


Can I do this using the above code?



I ask because I have a large training data set (2 million rows and 700 features). If I put the lgb.Dataset() into the lightgbm such as lightgbm(data = lgb.Dataset(data = X_tr,label = y_tr), params = params_list), then It takes time for multiple model building. Therefore, I first get the dataset used for lightgbm and for each model, the dataset is constant, what I did can only focus on the different parameters.



However, I am not sure, in total, how many parameters can be put into the params_list? Such as can the weight parameter be in the params_list? When I look the help ?lightgbm, I notice that the weight parameter and many other parameters are out side of the params_list.



Can you help me figure out: in total which parameters can be put into the params_list? That is the final model is built only using the data argument and params argument (other parameters are put into the params list object) as shown above, is that feasible?



Thank you.










share|improve this question




























    0















    Recently, I am learning the LightGBM package and want to tune the parameters of it.



    I want to try all the parameters which can be tuned in the LightGBM.



    One question is: when I build the model using the function: lightgbm(data, label = NULL, weight = NULL, params = list(), nrounds = 10, verbose = 1), can I put the weight and nrounds and many other parameters into a list object and feed to the params argument?



    The following code is what I used:



    # input data for lgb.Dataset() 
    data_lgb <- lgb.Dataset(
    data = X_tr,
    label = y_tr
    )

    # can I put all parameters to be tuned into this list?
    params_list <- list(weight = NULL, nrounds = 20, verbose = 1, learning_rate = 0.1)

    # build lightgbm model using only: data_lgb and params_list
    lgb_model <- lightgbm(data_lgb, params = params_list)


    Can I do this using the above code?



    I ask because I have a large training data set (2 million rows and 700 features). If I put the lgb.Dataset() into the lightgbm such as lightgbm(data = lgb.Dataset(data = X_tr,label = y_tr), params = params_list), then It takes time for multiple model building. Therefore, I first get the dataset used for lightgbm and for each model, the dataset is constant, what I did can only focus on the different parameters.



    However, I am not sure, in total, how many parameters can be put into the params_list? Such as can the weight parameter be in the params_list? When I look the help ?lightgbm, I notice that the weight parameter and many other parameters are out side of the params_list.



    Can you help me figure out: in total which parameters can be put into the params_list? That is the final model is built only using the data argument and params argument (other parameters are put into the params list object) as shown above, is that feasible?



    Thank you.










    share|improve this question
























      0












      0








      0








      Recently, I am learning the LightGBM package and want to tune the parameters of it.



      I want to try all the parameters which can be tuned in the LightGBM.



      One question is: when I build the model using the function: lightgbm(data, label = NULL, weight = NULL, params = list(), nrounds = 10, verbose = 1), can I put the weight and nrounds and many other parameters into a list object and feed to the params argument?



      The following code is what I used:



      # input data for lgb.Dataset() 
      data_lgb <- lgb.Dataset(
      data = X_tr,
      label = y_tr
      )

      # can I put all parameters to be tuned into this list?
      params_list <- list(weight = NULL, nrounds = 20, verbose = 1, learning_rate = 0.1)

      # build lightgbm model using only: data_lgb and params_list
      lgb_model <- lightgbm(data_lgb, params = params_list)


      Can I do this using the above code?



      I ask because I have a large training data set (2 million rows and 700 features). If I put the lgb.Dataset() into the lightgbm such as lightgbm(data = lgb.Dataset(data = X_tr,label = y_tr), params = params_list), then It takes time for multiple model building. Therefore, I first get the dataset used for lightgbm and for each model, the dataset is constant, what I did can only focus on the different parameters.



      However, I am not sure, in total, how many parameters can be put into the params_list? Such as can the weight parameter be in the params_list? When I look the help ?lightgbm, I notice that the weight parameter and many other parameters are out side of the params_list.



      Can you help me figure out: in total which parameters can be put into the params_list? That is the final model is built only using the data argument and params argument (other parameters are put into the params list object) as shown above, is that feasible?



      Thank you.










      share|improve this question














      Recently, I am learning the LightGBM package and want to tune the parameters of it.



      I want to try all the parameters which can be tuned in the LightGBM.



      One question is: when I build the model using the function: lightgbm(data, label = NULL, weight = NULL, params = list(), nrounds = 10, verbose = 1), can I put the weight and nrounds and many other parameters into a list object and feed to the params argument?



      The following code is what I used:



      # input data for lgb.Dataset() 
      data_lgb <- lgb.Dataset(
      data = X_tr,
      label = y_tr
      )

      # can I put all parameters to be tuned into this list?
      params_list <- list(weight = NULL, nrounds = 20, verbose = 1, learning_rate = 0.1)

      # build lightgbm model using only: data_lgb and params_list
      lgb_model <- lightgbm(data_lgb, params = params_list)


      Can I do this using the above code?



      I ask because I have a large training data set (2 million rows and 700 features). If I put the lgb.Dataset() into the lightgbm such as lightgbm(data = lgb.Dataset(data = X_tr,label = y_tr), params = params_list), then It takes time for multiple model building. Therefore, I first get the dataset used for lightgbm and for each model, the dataset is constant, what I did can only focus on the different parameters.



      However, I am not sure, in total, how many parameters can be put into the params_list? Such as can the weight parameter be in the params_list? When I look the help ?lightgbm, I notice that the weight parameter and many other parameters are out side of the params_list.



      Can you help me figure out: in total which parameters can be put into the params_list? That is the final model is built only using the data argument and params argument (other parameters are put into the params list object) as shown above, is that feasible?



      Thank you.







      r lightgbm






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 17:31









      BioChemoinformaticsBioChemoinformatics

      451213




      451213






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Lightgbm has many params which you can tune. Please read the documentation.



          I am pasting some part from one of my model script which shows the process. Should be a good hint for you.



          nthread <- as.integer(future::availableCores())
          seed <- 1000
          EARLY_STOPPING <- 50
          nrounds <- 1000
          param <- list(objective = "regression"
          metric = "rmse",
          max_depth = 3,
          num_leaves = 5,
          learning_rate = 0.1,
          nthread = nthread,
          bagging_fraction = 0.7,
          feature_fraction = 0.7,
          bagging_freq = 5,
          bagging_seed = seed,
          verbosity = -1,
          min_data_in_leaf = 5)


          dtrain <- lgb.Dataset(data = as.matrix(train_X),
          label = train_y)

          dval <- lgb.Dataset(data = as.matrix(val_X),
          label = val_y)
          valids <- list(val = dval)
          bst <- lgb.train(param,
          data = dtrain,
          nrounds = nrounds,
          data_random_seed = seed,
          early_stopping_rounds = EARLY_STOPPING,
          valids = valids)





          share|improve this answer

























          • thank you. I will try different parameters then.

            – BioChemoinformatics
            Mar 24 at 20:55











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326546%2fr-can-i-pass-the-weight-parameter-into-the-params-list-in-lightgbm%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Lightgbm has many params which you can tune. Please read the documentation.



          I am pasting some part from one of my model script which shows the process. Should be a good hint for you.



          nthread <- as.integer(future::availableCores())
          seed <- 1000
          EARLY_STOPPING <- 50
          nrounds <- 1000
          param <- list(objective = "regression"
          metric = "rmse",
          max_depth = 3,
          num_leaves = 5,
          learning_rate = 0.1,
          nthread = nthread,
          bagging_fraction = 0.7,
          feature_fraction = 0.7,
          bagging_freq = 5,
          bagging_seed = seed,
          verbosity = -1,
          min_data_in_leaf = 5)


          dtrain <- lgb.Dataset(data = as.matrix(train_X),
          label = train_y)

          dval <- lgb.Dataset(data = as.matrix(val_X),
          label = val_y)
          valids <- list(val = dval)
          bst <- lgb.train(param,
          data = dtrain,
          nrounds = nrounds,
          data_random_seed = seed,
          early_stopping_rounds = EARLY_STOPPING,
          valids = valids)





          share|improve this answer

























          • thank you. I will try different parameters then.

            – BioChemoinformatics
            Mar 24 at 20:55















          1














          Lightgbm has many params which you can tune. Please read the documentation.



          I am pasting some part from one of my model script which shows the process. Should be a good hint for you.



          nthread <- as.integer(future::availableCores())
          seed <- 1000
          EARLY_STOPPING <- 50
          nrounds <- 1000
          param <- list(objective = "regression"
          metric = "rmse",
          max_depth = 3,
          num_leaves = 5,
          learning_rate = 0.1,
          nthread = nthread,
          bagging_fraction = 0.7,
          feature_fraction = 0.7,
          bagging_freq = 5,
          bagging_seed = seed,
          verbosity = -1,
          min_data_in_leaf = 5)


          dtrain <- lgb.Dataset(data = as.matrix(train_X),
          label = train_y)

          dval <- lgb.Dataset(data = as.matrix(val_X),
          label = val_y)
          valids <- list(val = dval)
          bst <- lgb.train(param,
          data = dtrain,
          nrounds = nrounds,
          data_random_seed = seed,
          early_stopping_rounds = EARLY_STOPPING,
          valids = valids)





          share|improve this answer

























          • thank you. I will try different parameters then.

            – BioChemoinformatics
            Mar 24 at 20:55













          1












          1








          1







          Lightgbm has many params which you can tune. Please read the documentation.



          I am pasting some part from one of my model script which shows the process. Should be a good hint for you.



          nthread <- as.integer(future::availableCores())
          seed <- 1000
          EARLY_STOPPING <- 50
          nrounds <- 1000
          param <- list(objective = "regression"
          metric = "rmse",
          max_depth = 3,
          num_leaves = 5,
          learning_rate = 0.1,
          nthread = nthread,
          bagging_fraction = 0.7,
          feature_fraction = 0.7,
          bagging_freq = 5,
          bagging_seed = seed,
          verbosity = -1,
          min_data_in_leaf = 5)


          dtrain <- lgb.Dataset(data = as.matrix(train_X),
          label = train_y)

          dval <- lgb.Dataset(data = as.matrix(val_X),
          label = val_y)
          valids <- list(val = dval)
          bst <- lgb.train(param,
          data = dtrain,
          nrounds = nrounds,
          data_random_seed = seed,
          early_stopping_rounds = EARLY_STOPPING,
          valids = valids)





          share|improve this answer















          Lightgbm has many params which you can tune. Please read the documentation.



          I am pasting some part from one of my model script which shows the process. Should be a good hint for you.



          nthread <- as.integer(future::availableCores())
          seed <- 1000
          EARLY_STOPPING <- 50
          nrounds <- 1000
          param <- list(objective = "regression"
          metric = "rmse",
          max_depth = 3,
          num_leaves = 5,
          learning_rate = 0.1,
          nthread = nthread,
          bagging_fraction = 0.7,
          feature_fraction = 0.7,
          bagging_freq = 5,
          bagging_seed = seed,
          verbosity = -1,
          min_data_in_leaf = 5)


          dtrain <- lgb.Dataset(data = as.matrix(train_X),
          label = train_y)

          dval <- lgb.Dataset(data = as.matrix(val_X),
          label = val_y)
          valids <- list(val = dval)
          bst <- lgb.train(param,
          data = dtrain,
          nrounds = nrounds,
          data_random_seed = seed,
          early_stopping_rounds = EARLY_STOPPING,
          valids = valids)






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 24 at 18:05

























          answered Mar 24 at 17:41









          SonnySonny

          2,6351517




          2,6351517












          • thank you. I will try different parameters then.

            – BioChemoinformatics
            Mar 24 at 20:55

















          • thank you. I will try different parameters then.

            – BioChemoinformatics
            Mar 24 at 20:55
















          thank you. I will try different parameters then.

          – BioChemoinformatics
          Mar 24 at 20:55





          thank you. I will try different parameters then.

          – BioChemoinformatics
          Mar 24 at 20:55



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326546%2fr-can-i-pass-the-weight-parameter-into-the-params-list-in-lightgbm%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript