How to split dataset into test and validation sets

Double post, answered here.