@@ -27,8 +27,8 @@ function stack_function_results(row_fun::Function, X::Matrix)
27
27
N = size (X, 1 )
28
28
N_cols = length (row_fun (X[1 , :])) # gets the number of columns
29
29
out = Array {Float64} (undef, N, N_cols)
30
- Threads . @threads for i in 1 : N
31
- out[i, :] = row_fun (@view X[i, :])
30
+ for i in 1 : N
31
+ out[i, :] = row_fun (X[i, :])
32
32
end
33
33
return out
34
34
end
@@ -137,9 +137,9 @@ function prune_tree(tree::LeafOrNode{S, T}, purity_thresh=1.0) where {S, T}
137
137
end
138
138
139
139
140
- apply_tree (leaf:: Leaf{T} , feature:: AbstractVector {S} ) where {S, T} = leaf. majority
140
+ apply_tree (leaf:: Leaf{T} , feature:: Vector {S} ) where {S, T} = leaf. majority
141
141
142
- function apply_tree (tree:: Node{S, T} , features:: AbstractVector {S} ) where {S, T}
142
+ function apply_tree (tree:: Node{S, T} , features:: Vector {S} ) where {S, T}
143
143
if features[tree. featid] < tree. featval
144
144
return apply_tree (tree. left, features)
145
145
else
@@ -266,7 +266,7 @@ n_labels` matrix of probabilities, each row summing up to 1.
266
266
`col_labels` is a vector containing the distinct labels
267
267
(eg. ["versicolor", "virginica", "setosa"]). It specifies the column ordering
268
268
of the output matrix. """
269
- function apply_forest_proba (forest:: Ensemble{S, T} , features:: AbstractVector {S} , labels) where {S, T}
269
+ function apply_forest_proba (forest:: Ensemble{S, T} , features:: Vector {S} , labels) where {S, T}
270
270
votes = [apply_tree (tree, features) for tree in forest. trees]
271
271
return compute_probabilities (labels, votes)
272
272
end
0 commit comments