Skip to content

Random seed may exceed XGBoost's supported int32 range #412

Description

@derek1909

Description:
In random_seed.py the code may generate a seed larger than 2,147,483,647, which exceeds the int32 positive range required by XGBoost and some other libraries. This can cause errors like

xgboost.core.XGBoostError: Invalid Parameter format for seed expect int but value='2488161806'

Proposed fix:
Change the code to
self.seed = uuid.uuid4().int % (2**31)
to ensure the seed is always within the valid int32 range.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions