microsoft / FLAML

A fast library for AutoML and tuning. Join our Discord: https://discord.gg/Cppx2vSPVP.
https://microsoft.github.io/FLAML/
MIT License
3.75k stars 495 forks source link

Wrong index during CV #1294

Open uzhao opened 3 months ago

uzhao commented 3 months ago

I got this error after a few rounds. Previous rounds works ok.

[flaml.automl.logger: 04-01 15:17:50] {2392} INFO -  at 5349.0s,        estimator lgbm's best error=0.6645,     best estimator lgbm's best error=0.6645
[flaml.automl.logger: 04-01 15:17:50] {2219} INFO - iteration 17, current learner lgbm
Traceback (most recent call last):
  File "/home/papillon/eden/projects/test.py", line 275, in <module>
    models.fit()
  File "/home/papillon/eden/packages/ib2_base_rf/model.py", line 188, in fit
    model.fit(raw_ys=raw_ys, x_list=x_list)
  File "/home/papillon/eden/packages/ib2_base_rf/model.py", line 116, in fit
    self.model.fit(xs, ys, **self.params["fit"])
  File "/home/papillon/miniforge3/envs/eden/lib/python3.10/site-packages/flaml/automl/automl.py", line 1929, in fit
    self._search()
  File "/home/papillon/miniforge3/envs/eden/lib/python3.10/site-packages/flaml/automl/automl.py", line 2483, in _search
    self._search_sequential()
  File "/home/papillon/miniforge3/envs/eden/lib/python3.10/site-packages/flaml/automl/automl.py", line 2319, in _search_sequential
    analysis = tune.run(
  File "/home/papillon/miniforge3/envs/eden/lib/python3.10/site-packages/flaml/tune/tune.py", line 814, in run
    result = evaluation_function(trial_to_run.config)
  File "/home/papillon/miniforge3/envs/eden/lib/python3.10/site-packages/flaml/automl/state.py", line 304, in _compute_with_config_base
    ) = compute_estimator(
  File "/home/papillon/miniforge3/envs/eden/lib/python3.10/site-packages/flaml/automl/ml.py", line 369, in compute_estimator
    val_loss, metric_for_logging, train_time, pred_time = task.evaluate_model_CV(
  File "/home/papillon/miniforge3/envs/eden/lib/python3.10/site-packages/flaml/automl/task/generic_task.py", line 723, in evaluate_model_CV
    X_train, X_val = X_train_split[train_index], X_train_split[val_index]
IndexError: index 1152921504610266636 is out of bounds for axis 0 with size 5236644

The setting is

            "time_budget": 60 * 60 * 8,
            "metric": "accuracy",
            "task": "classification",
            "estimator_list": ["lgbm"],
            "eval_method": "cv",
            "ensemble": True,

FLAML version is 2.1.2 Lightgbm version is 4.3.0

Programmer-RD-AI commented 1 month ago

can you provide the code you used?