public class ShuffleColumnsCfps extends CreateFramePostprocessStep
Constructor and Description |
---|
ShuffleColumnsCfps() |
ShuffleColumnsCfps(boolean reassignNames,
boolean responseFirst) |
Modifier and Type | Method and Description |
---|---|
void |
exec(Frame fr,
java.util.Random rng)
This method performs the actual work of the postprocessing task.
|
static java.lang.String |
removeNumericSuffix(java.lang.String name)
Helper function which strips the provided name from any numeric suffix in the end.
|
workAmount
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonString, write, writeExternal, writeJSON
public ShuffleColumnsCfps()
public ShuffleColumnsCfps(boolean reassignNames, boolean responseFirst)
reassignNames
- If true, the columns will be renamed within each group starting with a common alpha-prefix.
I.e. if the original frame had columns [A1, A3, B2, B5] then after shuffling it may look like
this: [B1, A1, A2, B2]. In this new frame column "A1" may have been either "A1" or "A3" in
the original frame.
If false, each vec will keep its name.responseFirst
- If true, the "response" column will be moved to the beginning of the frame. Otherwise it
will be shuffled together with the rest of the columns.public void exec(Frame fr, java.util.Random rng)
CreateFramePostprocessStep
exec
in class CreateFramePostprocessStep
fr
- Frame that the task modifies.rng
- Random number generator to use if the task needs to modify the
frame randomly.public static java.lang.String removeNumericSuffix(java.lang.String name)
name.rstrip("0123456789")
in Python.