Train Test Split with Hidden y-test

Original Data
X1X2XnY
train_test_split() ➡
X-train
X1X2Xn
y-train
Y

X-test
X1X2Xn
y-test (Hidden)
Y

Why Use a Train/Test Split?

If you have 10 years of historical data and no test set, you might have to wait another 2 years to collect enough new data to evaluate your model. By splitting your existing 10 years of data into 80% training (8 years) and 20% testing (2 years), you can start evaluating and improving your model immediately — without waiting for additional data to arrive.
Scenario 1: No Test Set (Must Wait 2 Years)
Train: 10 years
Wait: 2 years
Test
Scenario 2: Train/Test Split (Immediate Testing)
Train: 8 years
Test: 2 years