Giter Site home page Giter Site logo

titsuki / raku-algorithm-xgboost Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 85 KB

Algorithm::XGBoost - A Raku bindings for XGBoost ( https://github.com/dmlc/xgboost ).

License: Artistic License 2.0

Raku 93.31% CMake 6.69%
xgboost raku rakulang perl6

raku-algorithm-xgboost's Introduction

Actions Status

NAME

Algorithm::XGBoost - A Raku bindings for XGBoost ( https://github.com/dmlc/xgboost ).

SYNOPSIS

use Algorithm::XGBoost;
use Algorithm::XGBoost::Booster;
use Algorithm::XGBoost::DMatrix;
use Algorithm::XGBoost::Model;

# agaricus.txt.test is here: https://github.com/dmlc/xgboost/tree/master/demo/data
my $dmat = Algorithm::XGBoost::DMatrix.from-file("agaricus.txt.train");
say $dmat.num-row; # 6513
say $dmat.num-col; # 127
my $model = Algorithm::XGBoost.train($dmat, 10);
$model.num-feature.say; # 127

my @test = [[0e0,0e0],[0e0,1e0]];
my $test = Algorithm::XGBoost::DMatrix.from-matrix(@test);
say $model.predict($test); # (0.9858561754226685 0.9858561754226685)

DESCRIPTION

Algorithm::XGBoost is a Raku bindings for XGBoost ( https://github.com/dmlc/xgboost ).

METHODS

train

Defined as:

method train(Algorithm::XGBoost::DMatrix $dmat, Int $num-iteration, %param --> Algorithm::XGBoost::Model)

Trains a XGBoost model.

  • $dmat The instance of Algorithm::XGBoost::DMatrix.

  • $num-iteration The number of iterations for training.

  • %param The parameter for training.

version

Defined as:

method version(--> Version)

Returns the libxgboost version.

global-config

Defined as:

multi method global-config(Str $json-str)
multi method global-config(--> Str)

Sets/Gets the global parameters: verbosity and use_rmm.

  • verbosity The verbosity of printing messages. Valid values of 0 (silent), 1 (warning), 2 (info), and 3 (debug).

  • use_rmm Whether to use RAPIDS Memory Manager (RMM) to allocate GPU memory. This option is only applicable when XGBoost is built (compiled) with the RMM plugin enabled. Valid values are true and false.

AUTHOR

Itsuki Toyota [email protected]

COPYRIGHT AND LICENSE

Copyright 2021 Itsuki Toyota

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

raku-algorithm-xgboost's People

Contributors

titsuki avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

raku-algorithm-xgboost's Issues

Set missing = 1e0 is harmful

Setting missing=Float.NaN is the best way but AFAIK num32 doesn't have NaN:

$ raku -e 'use NativeCall; my num32 $x; $x.say;'
0

CI is broken

this library needs a build utility which compiles xgboost and sets the resulting .so (or maybe .dylib) file under the proper dir

[OSX] Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)

===> Building: Algorithm::XGBoost:ver<0.0.5>:auth<cpan:TITSUKI>
Aborting due to build failure: Algorithm::XGBoost:ver<0.0.[5](https://github.com/titsuki/raku-Algorithm-XGBoost/actions/runs/5985977285/job/16238623157?pr=18#step:6:6)>:auth<cpan:TITSUKI> (use --force-build to override)
[Algorithm::XGBoost] Command: /Users/runner/hostedtoolcache/rakudo/2023.08-01/x8[6](https://github.com/titsuki/raku-Algorithm-XGBoost/actions/runs/5985977285/job/16238623157?pr=18#step:6:7)_64/bin/rakudo -I/Users/runner/work/raku-Algorithm-XGBoost/raku-Algorithm-XGBoost -MMONKEY-SEE-NO-EVAL -e exit((require ::(q|Algorithm::XGBoost::CustomBuilder|)).new(:meta(EVAL($*IN.slurp(:close)))).build(q|/Users/runner/work/raku-Algorithm-XGBoost/raku-Algorithm-XGBoost|)??0!!1)
[Algorithm::XGBoost] Warning: libomp 16.0.6 is already installed and up-to-date.
[Algorithm::XGBoost] To reinstall 16.0.6, run:
[Algorithm::XGBoost]   brew reinstall libomp
[Algorithm::XGBoost] -- The CXX compiler identification is AppleClang 14.0.0.14000029
[Algorithm::XGBoost] -- The C compiler identification is AppleClang 14.0.0.14000029
[Algorithm::XGBoost] -- Detecting CXX compiler ABI info
[Algorithm::XGBoost] -- Detecting CXX compiler ABI info - done
[Algorithm::XGBoost] -- Check for working CXX compiler: /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
[Algorithm::XGBoost] -- Detecting CXX compile features
[Algorithm::XGBoost] -- Detecting CXX compile features - done
[Algorithm::XGBoost] -- Detecting C compiler ABI info
[Algorithm::XGBoost] -- Detecting C compiler ABI info - done
[Algorithm::XGBoost] -- Check for working C compiler: /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
[Algorithm::XGBoost] -- Detecting C compile features
[Algorithm::XGBoost] -- Detecting C compile features - done
[Algorithm::XGBoost] -- CMake version 3.2[7](https://github.com/titsuki/raku-Algorithm-XGBoost/actions/runs/5985977285/job/16238623157?pr=18#step:6:8).2
[Algorithm::XGBoost] -- Performing Test XGBOOST_MM_PREFETCH_PRESENT
[Algorithm::XGBoost] -- Performing Test XGBOOST_MM_PREFETCH_PRESENT - Success
[Algorithm::XGBoost] -- Performing Test XGBOOST_BUILTIN_PREFETCH_PRESENT
[Algorithm::XGBoost] -- Performing Test XGBOOST_BUILTIN_PREFETCH_PRESENT - Success
[Algorithm::XGBoost] -- xgboost VERSION: 1.4.2
[Algorithm::XGBoost] -- Setting build type to 'Release' as none was specified.
[Algorithm::XGBoost] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
[Algorithm::XGBoost] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
[Algorithm::XGBoost] -- Found Threads: TRUE  
[Algorithm::XGBoost] CMake Error at /usr/local/Cellar/cmake/3.27.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
[Algorithm::XGBoost]   Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
[Algorithm::XGBoost] Call Stack (most recent call first):
[Algorithm::XGBoost]   /usr/local/Cellar/cmake/3.27.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
[Algorithm::XGBoost]   /usr/local/Cellar/cmake/3.27.2/share/cmake/Modules/FindOpenMP.cmake:577 (find_package_handle_standard_args)
[Algorithm::XGBoost]   CMakeLists.txt:14[8](https://github.com/titsuki/raku-Algorithm-XGBoost/actions/runs/5985977285/job/16238623157?pr=18#step:6:9) (find_package)
[Algorithm::XGBoost] -- Configuring incomplete, errors occurred!
[Algorithm::XGBoost] The spawned command 'brew install libomp && cmake . && make' exited unsuccessfully (exit code: 1, signal: 0)
[Algorithm::XGBoost]   in method build at /Users/runner/work/raku-Algorithm-XGBoost/raku-Algorithm-XGBoost/lib/Algorithm/XGBoost/CustomBuilder.rakumod (Algorithm::XGBoost::CustomBuilder) line [21](https://github.com/titsuki/raku-Algorithm-XGBoost/actions/runs/5985977285/job/16238623157?pr=18#step:6:22)
[Algorithm::XGBoost]   in block <unit> at -e line 1
===> Building [FAIL]: Algorithm::XGBoost:ver<0.0.5>:auth<cpan:TITSUKI>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.