Skip to content

Commit

Permalink
[docs] document CLI behavior when label_column is omitted (#4485)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Jul 25, 2021
1 parent 5d40dc4 commit fdc582e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/Parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ Dataset Parameters

- add a prefix ``name:`` for column name, e.g. ``label=name:is_click``

- if omitted, the first column in the training data is used as the label

- **Note**: works only in case of loading data directly from file

- ``weight_column`` :raw-html:`<a id="weight_column" title="Permalink to this parameter" href="#weight_column">&#x1F517;&#xFE0E;</a>`, default = ``""``, type = int or string, aliases: ``weight``
Expand Down
3 changes: 3 additions & 0 deletions examples/binary_classification/train.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ metric_freq = 1
# true if need output metric for training data, alias: tranining_metric, train_metric
is_training_metric = true

# column in data to use as label
label_column = 0

# number of bins for feature bucket, 255 is a recommend setting, it can save memories, and also has good accuracy.
max_bin = 255

Expand Down
3 changes: 3 additions & 0 deletions examples/lambdarank/train.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ metric_freq = 1
# true if need output metric for training data, alias: tranining_metric, train_metric
is_training_metric = true

# column in data to use as label
label_column = 0

# number of bins for feature bucket, 255 is a recommend setting, it can save memories, and also has good accuracy.
max_bin = 255

Expand Down
3 changes: 3 additions & 0 deletions examples/multiclass_classification/train.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ metric_freq = 1
# true if need output metric for training data, alias: tranining_metric, train_metric
is_training_metric = true

# column in data to use as label
label_column = 0

# number of bins for feature bucket, 255 is a recommend setting, it can save memories, and also has good accuracy.
max_bin = 255

Expand Down
3 changes: 3 additions & 0 deletions examples/parallel_learning/train.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ metric_freq = 1
# true if need output metric for training data, alias: tranining_metric, train_metric
is_training_metric = true

# column in data to use as label
label_column = 0

# number of bins for feature bucket, 255 is a recommend setting, it can save memories, and also has good accuracy.
max_bin = 255

Expand Down
3 changes: 3 additions & 0 deletions examples/regression/train.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ metric_freq = 1
# true if need output metric for training data, alias: tranining_metric, train_metric
is_training_metric = true

# column in data to use as label
label_column = 0

# number of bins for feature bucket, 255 is a recommend setting, it can save memories, and also has good accuracy.
max_bin = 255

Expand Down
3 changes: 3 additions & 0 deletions examples/xendcg/train.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ metric_freq = 1
# true if need output metric for training data, alias: tranining_metric, train_metric
is_training_metric = true

# column in data to use as label
label_column = 0

# number of bins for feature bucket, 255 is a recommend setting, it can save memories, and also has good accuracy.
max_bin = 255

Expand Down
1 change: 1 addition & 0 deletions include/LightGBM/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ struct Config {
// desc = used to specify the label column
// desc = use number for index, e.g. ``label=0`` means column\_0 is the label
// desc = add a prefix ``name:`` for column name, e.g. ``label=name:is_click``
// desc = if omitted, the first column in the training data is used as the label
// desc = **Note**: works only in case of loading data directly from file
std::string label_column = "";

Expand Down

0 comments on commit fdc582e

Please sign in to comment.