Skip to content
C

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_state value both times.

Example Input

text
X, y, random_state=42

Example Output

text
Splits are identical: True

Concepts Covered

random_state, reproducibility, array comparison.

Input (stdin)

Output

Run your code to see output here...