We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b21953f + 0265e86 commit 9d76224Copy full SHA for 9d76224
lib/Algorithm/LibSVM.pm6
@@ -66,7 +66,7 @@ method !_load-problem(\lines) {
66
my @feature-list = $features.split(/\s+/);
67
68
my $next = Algorithm::LibSVM::Node.new(index => -1, value => 0e0);
69
- for @feature-list>>.split(":", :skip-empty).sort({ $^b[0] <=> $^a[0] }) -> ($index, $value) {
+ for @feature-list>>.split(":", :skip-empty).map({ .[0] => .[1] }).sort(-*.key).map({ .key, .value }) -> ($index, $value) {
70
$!nr-feature = ($!nr-feature, $index.Int).max;
71
$next = Algorithm::LibSVM::Node.new(index => $index.Int, value => $value.Num, next => $next);
72
}
0 commit comments