Function to split data into subsets, for testing and training data
[x_train, x_test, y_train, y_test] = train_test_split(x, y) [x_train, x_test, y_train, y_test] = train_test_split(x, y, test_size) [x_train, x_test, y_train, y_test] = train_test_split(x, y, test_size, shuffle)
x data to be split
y data to be split
The fraction of data to be split into test data, or number of data points to split into training data. The default value is 0.25.
A True/False value to shuffle the data or provide it in linear order. %t is the default value
Split training x data
Split testing x data
Split training y data
Split testing y data