Why the data on y-axis is represented as x_train and x_valid?

Referring to lab code below i am just confused why series data is stored as x_train and x_valid, while time is already represented on x-axis. Better convention would be y_train and y_valid. Is there any specific reason to series as x_train and x_valid. Thank you!
`# Define the split time
split_time = 1000

Get the train set

time_train = time[:split_time]
x_train = series[:split_time]

Get the validation set

time_valid = time[split_time:]
x_valid = series[split_time:]`

This is to get a python “slice”. A standard way to get a slice from 1D array is to specify [(begin):(end)]. But, if we want to get a slice from “the start”, we do not need to specify (begin). And, if we want to get a slice “to the end”, we do not need to specify (end). So, with [:split \_time], data from 0 to (split_time-1) became a slice for a training set, and, with [split \_time:], data from (split_time) to the end became a slice for a validation set.

Hi, my question was why we took x_train and x_valid as we have already on x-axis time represented. Rather we have to take points or coordinates on y-axis instead of x.Thanks!

Sorry that I could not catch your point.
“x” in here is not for “x axis”. In the series of exercises, “x” typically represents “sample data”, and “y” represents “labels”. It may not be used in this exercise, but we usually use “y_train” and “y_valid” as labels to train a model for a “supervised learning”. Similarly, x_test and y_test are usually prepared for testing.
This is to split original data into “training” data, and “validation data” for latter use. In this sense, it is still working on x-axis, though… :slight_smile:

Thanks a lot. That was really helpful!