Skip to content

Commit

Permalink
Comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Jul 13, 2021
1 parent a2c8d26 commit d8eea6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion demo/guide-python/external_memory.py
Expand Up @@ -12,6 +12,7 @@


def make_batches(
"""Generate random batches."""
n_samples_per_batch: int, n_features: int, n_batches: int
) -> Tuple[List[np.ndarray], List[np.ndarray]]:
X = []
Expand All @@ -26,6 +27,7 @@ def make_batches(
class Iterator(xgboost.DataIter):
"""A custom iterator for loading files in batches."""
def __init__(self, file_paths: List[Tuple[str, str]]):
self._file_paths = file_paths
self._it = 0
Expand Down Expand Up @@ -76,7 +78,7 @@ def main(tmpdir: str) -> xgboost.Booster:
Xy = xgboost.DMatrix(it)

# Other tree methods including ``hist`` and ``gpu_hist`` also work, but has some
# caveats as noted in following sections. This is still an experimental feature.
# caveats. This is still an experimental feature.
booster = xgboost.train({"tree_method": "approx"}, Xy)
return booster

Expand Down

0 comments on commit d8eea6b

Please sign in to comment.