Skip to content

Commit e40d925

Browse files
committed
scaffold: Replace matrix.length -> size() in Splitter.java
1 parent fcf4f57 commit e40d925

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scaffold/Splitter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private double impurity(int count) {
9292

9393
// Returns a new Splitter containing only data where indices are true for the given predicate.
9494
private Splitter mask(IntPredicate predicate) {
95-
int[] indices = IntStream.range(0, matrix.length).filter(predicate).toArray();
95+
int[] indices = IntStream.range(0, size()).filter(predicate).toArray();
9696
double[][] newMatrix = new double[indices.length][];
9797
boolean[] newLabels = new boolean[indices.length];
9898
for (int i = 0; i < indices.length; i += 1) {
@@ -104,7 +104,7 @@ private Splitter mask(IntPredicate predicate) {
104104

105105
// Returns an array of all possible feature splits for each matrix variable.
106106
private FeatureSplit[] featureSplits() {
107-
int m = matrix.length;
107+
int m = size();
108108
int n = matrix[0].length;
109109
FeatureSplit[] result = new FeatureSplit[n];
110110
for (int j = 0; j < n; j += 1) {

0 commit comments

Comments
 (0)