hex.splitframe.ShuffleSplitFrame Maven / Gradle / Ivy
package hex.splitframe;
import java.util.Random;
import water.*;
import water.fvec.*;
/** Frame splitter function to divide given frame into multiple partitions
* based on given ratios.
*
* The task creates ratios.length+1
output frame each
* containing a demanded fraction of rows from source dataset
*
* Rows are selected at random for each split, but remain ordered.
*/
public class ShuffleSplitFrame {
public static Frame[] shuffleSplitFrame( Frame fr, Key[] keys, final double ratios[], final long seed ) {
// Sanity check the ratios
assert keys.length == ratios.length;
double sum = ratios[0];
for( int i = 1; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy