Problem 2: Reproducible Split with random_state
Easypython
Problem Description
Write a Python program that performs the same train-test split twice using the same random_state, and confirms both splits produce identical results.
Input
A dataset with features (X) and a label (y).
Output
A confirmation that both splits are identical.
Constraints
- Use the same
random_statevalue both times.
Example Input
textX, y, random_state=42
Example Output
textSplits are identical: True
Concepts Covered
random_state, reproducibility, array comparison.