Switch transform.sample to use reservoir sampling

Works on streaming data.