weibozhao commented on code in PR #189:
URL: https://github.com/apache/flink-ml/pull/189#discussion_r1057045262
##########
flink-ml-lib/src/main/java/org/apache/flink/ml/feature/randomsplitter/RandomSplitter.java:
##########
@@ -83,11 +84,12 @@ public Table[] transform(Table... inputs) {
private static class SplitterOperator extends AbstractStreamOperator<Row>
implements OneInputStreamOperator<Row, Row> {
- private final Random random = new Random(0);
+ private final Random random;
OutputTag<Row>[] outputTag;
final double[] fractions;
- public SplitterOperator(OutputTag<Row>[] outputTag, Double[] weights) {
+ public SplitterOperator(OutputTag<Row>[] outputTag, Double[] weights,
long seed) {
+ random = new Random(seed);
Review Comment:
Sounds good!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]