Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
♻️ Simplify the model training
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Jun 22, 2023
1 parent e3dccab commit d9b6c35
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/trainer/item_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ impl Params {
.filter(|(j, _)| *i != **j)
.map(|(j, bias_j)| {
// FIXME: I do the same calculation twice: for `(i, j)` and `(j, i)`.
let similarity =
self.calculate_similarity(*bias_i, &votes[i], *bias_j, &votes[j]);
(*j, similarity)
(*j, self.calculate_similarity(*bias_i, &votes[i], *bias_j, &votes[j]))
})
.collect();
(*i, similarities)
Expand Down

0 comments on commit d9b6c35

Please sign in to comment.