Skip to content

Commit

Permalink
Merge pull request #11 from titsuki/set-missing-nan
Browse files Browse the repository at this point in the history
Use NaN instead of 1e0 as the default value of missing
  • Loading branch information
titsuki authored Aug 7, 2021
2 parents 5bb2488 + a6a6d8c commit 8bd38ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Algorithm/XGBoost/DMatrix.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ method from-file(::?CLASS:U: Str $path --> ::?CLASS:D) {
nativecast(Algorithm::XGBoost::DMatrix, $h);
}

method from-matrix(::?CLASS:U: @x where { $_.shape ~~ ($,$) }, @y?, Num :$missing = 1e0 --> ::?CLASS:D) {
method from-matrix(::?CLASS:U: @x where { $_.shape ~~ ($,$) }, @y?, Num :$missing = NaN --> ::?CLASS:D) {
my $h = Pointer.new;
my $data = CArray[num32].new(@x.flat);
my ($nr, $nc) = @x.shape;
Expand Down

0 comments on commit 8bd38ff

Please sign in to comment.