dmlc / dmlc/xgboost

Training a model with zero iterations

Open
#11,854 7 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
C++
Stars
28.8k
Forks
8.9k
Avg merge
1d 12h
Merged PRs (30d)
54

Description

Hey, I noticed that training an xgboost model with `nrounds = 0` creates a model with 2 boosting iterations in the new R package 3.1.2.1.

```r
data(mtcars)

model_regression = xgboost(mtcars[, -1], mtcars$mpg, nthreads = 1, nrounds = 0)

model_regression

# XGBoost model object
# Call:
# xgboost(x = mtcars[, -1], y = mtcars$mpg, nrounds = 0, nthreads = 1)
# Objective: reg:squarederror
# Number of iterations: 2
# Number of features: 10
```

Is this intentional?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the provided mtcars example with the R package and nrounds = 0. Then inspect how the R training entry point handles the requested iteration count and reports the resulting model; the issue is resolved when the intended zero-iteration behavior is established and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.