From d2204e4b31bc915360f81054ec441d9635811b23 Mon Sep 17 00:00:00 2001 From: Ryan Hausen Date: Wed, 21 Aug 2024 11:43:17 -0400 Subject: [PATCH] simplified sparse matrix instantiation --- treeple/stats/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/treeple/stats/utils.py b/treeple/stats/utils.py index ad24b05e..abafc88c 100644 --- a/treeple/stats/utils.py +++ b/treeple/stats/utils.py @@ -476,15 +476,15 @@ def _compute_null_distribution_coleman_sparse( :, 0 ] # (n_oob_samples) - oob_predictions = sp.coo_matrix( + oob_predictions = sp.csc_matrix( (all_oob_values, (tree_row_ids, all_oob_idxs)), shape=(n_trees, len(y_test)), - ).tocsc() # (n_trees, n_samples) + ) # (n_trees, n_samples) - oob_indicators = sp.coo_matrix( + oob_indicators = sp.csc_matrix( (np.ones_like(all_oob_values, dtype=np.uint8), (tree_row_ids, all_oob_idxs)), shape=(n_trees, len(y_test)), - ).tocsc() # (n_trees, n_samples) + ) # (n_trees, n_samples) observe_stat, permute_stat = _parallel_build_null_forests_sparse( np.arange(n_trees),