Skip to content

Commit ac01329

Browse files
committed
feat:Argument specifying the default tag-type weight.
1 parent 7504e7c commit ac01329

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ML/SparseMatrixRecommender.rakumod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ class ML::SparseMatrixRecommender
458458
##========================================================
459459
## Apply tag type weights
460460
##========================================================
461-
method apply-tag-type-weights($weights) {
461+
method apply-tag-type-weights($weights, Numeric:D :default(:$default-weight) = 1) {
462462
my @weights-list;
463463

464464
if $weights ~~ (Array:D | List:D | Seq:D) {
@@ -475,7 +475,7 @@ class ML::SparseMatrixRecommender
475475
if @unknown-keys;
476476

477477
for %!matrices.keys -> $key {
478-
my $w = $weights{$key} // 1;
478+
my $w = $weights{$key} // $default-weight;
479479
@weights-list.append( $w xx %!matrices{$key}.columns-count );
480480
}
481481
} else {

0 commit comments

Comments
 (0)