Skip to content

Commit

Permalink
weight matrix inverse fix
Browse files Browse the repository at this point in the history
  • Loading branch information
martinju committed Jul 26, 2023
1 parent 5921d36 commit 34d3681
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Also allow the method to be used on models with categorical data ([#315](https:
Now heavily utilizing [snapshots](https://testthat.r-lib.org/articles/snapshotting.html) on a large set of benchmark calls to `explain`, also using [vdiffr](https://vdiffr.r-lib.org/) for plot tests.
Test functions are only written for exported core functions. Internal functions are only tested through the exported ones.
* Update GitHub actions ([#335](https://github.com/NorskRegnesentral/shapr/pull/335)).
* Avoid unnecessary computation of inverse for weight matrix ([#280](https://github.com/NorskRegnesentral/shapr/issues/280))


## Minor improvements and bug fixes
Expand Down
2 changes: 1 addition & 1 deletion src/weighted_matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ arma::mat weight_matrix_cpp(List subsets, int m, int n, NumericVector w){
}
}

R = inv(X.t() * Z) * X.t();
R = solve(X.t() * Z, X.t());

return R;
}
Expand Down

0 comments on commit 34d3681

Please sign in to comment.