As Elham said, you can use scikit-learn to make this easy. scikit-learn is an open source library for machine learning. There are many tools for preparing data, including a module that handles comparison, validation, and parameter selection. model_selection
model_selection.train_test_split() .
X_train, X_test, y_train, y_test = train_test_split(features,
labels,
test_size=0.33,
random_state=42)
test_size - , , random_state - .
. train_test_split , . .. (Train + Validation) Test, Train + Validation .