<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Sklearn
sklearn.cross_validation
документация
Step1:  Разовое разбиение данных на обучение и тест с помощью train_test_split
Step2:  Стратегии проведения кросс-валидации
KFold
Step3:  StratifiedKFold
Step4:  ShuffleSplit
Step5:  StratifiedShuffleSplit
Step6:  Leave-One-Out
<ASSISTANT_TASK:>
Python Code:
from sklearn import cross_validation, datasets
import numpy as np
Explanation: Sklearn
sklearn.cross_validation
документация: http://scikit-learn.org/stable/modules/cross_validation.html
End of explanation
iris = datasets.load_iris()
train_data, test_data, train_labels, test_labels = cross_validation.train_test_split(iris.data, iris.target, 
                                                                                     test_size = 0.3)
#убедимся, что тестовая выборка действительно составляет 0.3 от всех данных
float(len(test_labels))/len(iris.data)
print 'Размер обучающей выборки: {} объектов \nРазмер тестовой выборки: {} объектов'.format(len(train_data),
                                                                                            len(test_data))
print 'Обучающая выборка:\n', train_data[:5]
print '\n'
print 'Тестовая выборка:\n', test_data[:5]
print 'Метки классов на обучающей выборке:\n', train_labels
print '\n'
print 'Метки классов на тестовой выборке:\n', test_labels
Explanation: Разовое разбиение данных на обучение и тест с помощью train_test_split
End of explanation
for train_indices, test_indices in cross_validation.KFold(10, n_folds = 5):
    print train_indices, test_indices
for train_indices, test_indices in cross_validation.KFold(10, n_folds = 2, shuffle = True):
    print train_indices, test_indices
for train_indices, test_indices in cross_validation.KFold(10, n_folds = 2, shuffle = True, random_state = 1):
    print train_indices, test_indices
Explanation: Стратегии проведения кросс-валидации
KFold
End of explanation
target = np.array([0] * 5 + [1] * 5)
print target
for train_indices, test_indices in cross_validation.StratifiedKFold(target, n_folds = 2, shuffle = True, random_state = 0):
    print train_indices, test_indices
target = np.array([0, 1] * 5)
print target
for train_indices, test_indices in cross_validation.StratifiedKFold(target, n_folds = 2,shuffle = True):
    print train_indices, test_indices
Explanation: StratifiedKFold
End of explanation
for train_indices, test_indices in cross_validation.ShuffleSplit(10, n_iter = 10, test_size = 0.2):
    print train_indices, test_indices
Explanation: ShuffleSplit
End of explanation
target = np.array([0] * 5 + [1] * 5)
print target
for train_indices, test_indices in cross_validation.StratifiedShuffleSplit(target, n_iter = 4, test_size = 0.2):
    print train_indices, test_indices
Explanation: StratifiedShuffleSplit
End of explanation
for train_indices, test_index in cross_validation.LeaveOneOut(10):
    print train_indices, test_index
Explanation: Leave-One-Out
End of explanation
<END_TASK>