Сплит-программа Train TestPython

Программы на Python
Anonymous
Сплит-программа Train Test

Сообщение Anonymous »

Код: Выделить всё

def shuffle_and_split(data, test_ratio):
shuffled_indices=np.random.permutation(len(data))
test_set_size= int(len(data)*test_ratio)
test_indeces= shuffled_indices[:test_set_size]
train_indices= shuffled_indices[test_set_size]
return data.iloc[train_indices], data.iloc[test_indices]
Кто-нибудь может объяснить код, поскольку я его не понимаю.

Подробнее здесь: https://stackoverflow.com/questions/798 ... it-program

Вернуться в «Python»