Skip to content

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

@derek1909

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions