Skip to content

Commit

Permalink
Reordered method parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed Jul 3, 2020
1 parent 2b053ca commit d8eb2e8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/org/jpmml/h2o/SharedTreeMojoModelConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ public List<TreeModel> encodeTreeModels(Schema schema){
public TreeModel encodeTreeModel(byte[] compressedTree, PredicateManager predicateManager, Schema schema){
Label label = new ContinuousLabel(null, DataType.DOUBLE);

AtomicInteger idSequence = new AtomicInteger(1);
ByteBufferWrapper byteBuffer = new ByteBufferWrapper(compressedTree);

ByteBufferWrapper buffer = new ByteBufferWrapper(compressedTree);
AtomicInteger idSequence = new AtomicInteger(1);

Node root = encodeNode(True.INSTANCE, idSequence, compressedTree, buffer, predicateManager, new CategoryManager(), schema);
Node root = encodeNode(byteBuffer, True.INSTANCE, compressedTree, idSequence, new CategoryManager(), predicateManager, schema);

TreeModel treeModel = new TreeModel(MiningFunction.REGRESSION, ModelUtil.createMiningSchema(label), root)
.setMissingValueStrategy(TreeModel.MissingValueStrategy.DEFAULT_CHILD);
Expand All @@ -91,7 +91,7 @@ public TreeModel encodeTreeModel(byte[] compressedTree, PredicateManager predica
}

static
public Node encodeNode(Predicate predicate, AtomicInteger idSequence, byte[] compressedTree, ByteBufferWrapper byteBuffer, PredicateManager predicateManager, CategoryManager categoryManager, Schema schema){
public Node encodeNode(ByteBufferWrapper byteBuffer, Predicate predicate, byte[] compressedTree, AtomicInteger idSequence, CategoryManager categoryManager, PredicateManager predicateManager, Schema schema){
Integer id = nextId(idSequence);

int nodeType = byteBuffer.get1U();
Expand Down Expand Up @@ -205,7 +205,7 @@ public Node encodeNode(Predicate predicate, AtomicInteger idSequence, byte[] com
} else

{
leftChild = encodeNode(leftPredicate, idSequence, compressedTree, leftByteBuffer, predicateManager, leftCategoryManager, schema);
leftChild = encodeNode(leftByteBuffer, leftPredicate, compressedTree, idSequence, leftCategoryManager, predicateManager, schema);
}

Node rightChild;
Expand Down Expand Up @@ -241,7 +241,7 @@ public Node encodeNode(Predicate predicate, AtomicInteger idSequence, byte[] com
} else

{
rightChild = encodeNode(rightPredicate, idSequence, compressedTree, rightByteBuffer, predicateManager, rightCategoryManager, schema);
rightChild = encodeNode(rightByteBuffer, rightPredicate, compressedTree, idSequence, rightCategoryManager, predicateManager, schema);
}

Node result = new BranchNode(null, predicate)
Expand Down

0 comments on commit d8eb2e8

Please sign in to comment.